Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

q: Table : PURCHASE ORDER ORDER_NO AMOUNT ORDER_DATE CUSTOMER_ID SALESMAN_ID DELIVERY_DATE 1001 300 2001 3001 1002 3003 200.20 600 1003 05-03-2017 10-07-2017 12-06-2017 10-05-2017 03-08-2017

q: image text in transcribed
image text in transcribed
Table : PURCHASE ORDER ORDER_NO AMOUNT ORDER_DATE CUSTOMER_ID SALESMAN_ID DELIVERY_DATE 1001 300 2001 3001 1002 3003 200.20 600 1003 05-03-2017 10-07-2017 12-06-2017 10-05-2017 03-08-2017 10-07-2017 2002 2005 2003 3002 05-05-2017 10-10-2017 12-08-2017 10-07-2017 03-05-2017 10-10-2017 1004 400.25 500.10 400 3004 3005 1005 2004 1006 2005 3006 PRICE QUANTITY 100 56 36 200 Table: PURCHASE_DETAILS ORDER_NO PRODUCT_NAME 1001 KEYBOARD 1002 MONITOR 1003 MOUSE 1004 HARD_DISK 1005 RAM 1007 CABINET 6 100 58 300 500 25 5 100 a. Write an SQL query to display PRODUCT_NAME, ORDER_DATE and find no of months between the DELIVERY_DATE from the CURRENT DATE. (Hint: Use Inner join). b. Write an SQL query to display all records from both tables PURCHASE_ORDER and PURCHASE DETAILS. c. Write an SQL query to display ORDER_NO, PRODUCT_NAME from table PURCHASE_DETAILS of products where the ORDER_NO is equal to the order_no placed in the date 05-05-2017. [Hint: Use Subquery]. d. Write an SQL query to display ORDER_NO, PRODUCT_NAME, QUANTITY from PURCHASE _DETAILS table where the quantity is less than all values in Quantity for products except Mouse and keyboard. (Hint: Use Subquery]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago