Wednesday, April 20, 2022

Task 4: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order... 1 answer below » Task 4: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order is placed. List theINVOICE_NUM,CUST_ID,FIRST_NAME,LAST_NAME,INVOICE_DATE, and the promotion date for each invoice asPROMOTION_DATE. The promotion date is20 days after theINVOICE_DATE was placed

 

Task 4: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order...1 answer below »

Task 4: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order is placed. List theINVOICE_NUM,CUST_ID,FIRST_NAME,LAST_NAME,INVOICE_DATE, and the promotion date for each invoice asPROMOTION_DATE. The promotion date is20 days after theINVOICE_DATE was placed







R A 
5 Ratings,(9 Votes)

Query:

SELECT inv.INVOICE_NUM, cus.CUST_ID, cus.FIRST_NAME, cus.LAST_NAME, inv.INVOICE_DATE, DATE_ADD(INVOICE_DATE, INTERVAL 20 DAY) as 'PROMOTION_DATE'
FROM INVOICES as inv
JOIN CUSTOMER as cus 
ON inv.CUST_ID = cus.CUST_ID; 

inv is the alias of INVOICES table

cus is the alias of CUSTOMER table.

DATE_ADD method is used to add 20 days from the INVOICE_DATE.

No comments:

Post a Comment