Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Table : PURCHASE ORDER ORDER_NO AMOUNT ORDER_DATE CUSTOMER_ID SALESMAN_ID DELIVERY_DATE 300 200.20 600 1001 1002 1003 1004 1005 1006 05-03-2017 10-07-2017 12-06-2017 10-05-2017 03-08-2017 10-07-2017

image text in transcribed

Table : PURCHASE ORDER ORDER_NO AMOUNT ORDER_DATE CUSTOMER_ID SALESMAN_ID DELIVERY_DATE 300 200.20 600 1001 1002 1003 1004 1005 1006 05-03-2017 10-07-2017 12-06-2017 10-05-2017 03-08-2017 10-07-2017 2001 2002 2005 2003 2004 2005 3001 3003 3002 3004 3005 3006 05-05-2017 10-10-2017 12-08-2017 10-07-2017 03-05-2017 10-10-2017 400.25 500.10 400 PRICE 56 36 Table: PURCHASE_DETAILS ORDER_NO PRODUCT_NAME 1001 KEYBOARD 1002 MONITOR 1003 MOUSE 1004 HARD_DISK 1005 RAM 1007 CABINET 6 QUANTITY 100 200 100 300 500 100 58 25 5 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

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

Timeline for implementation report

Answered: 1 week ago

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago