Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Table : PURCHASE ORDER ORDER_NO AMOUNT ORDER DATE CUSTOMER_ID SALESMAN_ID DELIVERY_DATE 1001 300 05-03-2017 2001 3001 05-05-2017 1002 200.20 10-07-2017 2002 3003 10-10-2017 1003 600
Table : PURCHASE ORDER ORDER_NO AMOUNT ORDER DATE CUSTOMER_ID SALESMAN_ID DELIVERY_DATE 1001 300 05-03-2017 2001 3001 05-05-2017 1002 200.20 10-07-2017 2002 3003 10-10-2017 1003 600 12-06-2017 2005 3002 12-08-2017 1004 400.25 10-05-2017 2003 3004 10-07-2017 1005 500.10 03-08-2017 2004 3005 03-05-2017 1006 400 10-07-2017 2005 3006 10-10-2017 Table: PURCHASE DETAILS ORDER_NO PRODUCT_NAME 1001 KEYBOARD PRICE QUANTITY 56 100 1002 MONITOR 36 200 1003 MOUSE 6 100 1004 HARD DISK 58 300 1005 RAM 25 500 1007 CABINET 5 100 a) Write a SQL query to display PRODUCT_NAME, ORDER_DATE and find number of years between the DELIVERY_DATE from the CURRENT DATE. (Hint: Use ON Clause). b) Write a SQL query to display matched records from PURCHASE_ORDER table and all records from PURCHASE_DETAILS
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started