Question: Given the three tables below, write the following queries. - A DDL command to build order table, including all integrity constraints. Make sure that ordDate

Given the three tables below, write the following queries.

Given the three tables below, write the following queries. - A DDL

- A DDL command to build order table, including all integrity constraints. Make sure that ordDate value exists and quantity value is always positive.

Ans:

- A DML command to answer: How many orders were made by customer C01 and how many products pieces did he order?

Ans:

- A DML command to list customers who have ordered the product 100. (Hint: use join)

Ans:

- A DML command to find products with price more than average (Hint: use nested queries)

Ans:

Customer Olaya St Jeddah Mains SRiyadh Mains Rd Rivadh25 20 30 C2 C3 C4 Mains Rd Dammam C5 Mains Rd Rivadh Product prodDes Food healthy Food price 100 100 200 prodNo prodName Pl 103 P3 self.araising flour.80%wheat | 300 104 P4 network 80x Order ordNo R03010101 R03010203 R03010102 R03010103 R03010301 R03030601 ordDate 01-jan-2003 02-jan-2003 01-jan-2003 01-jan-2003 03-jan-2003 06-mar-2003 custNe prodNoquantity 100 101 102 100 101 100 C0l C0l C2 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!