Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

With this question I need to make a view that will display the items sold within

ID: 3834751 • Letter: W

Question

With this question I need to make a view that will display the items sold within the last 18 months. I am stuck on making the view for the 18 months. I need this in Microsoft Sql, Not Oracle.

5. Write a view that will display the items sold within the last 18 months. You can find the items sold in LINE table and product information in PRODUCTS table [5] LINE NV NUMBER LINE NUMBER PROD CODE LINE UNITS LINE PRICE LINE AMOUNT 1001 4243213 1200247 69.99 69.99 1001 1003 4243213 85 85 1003 0637032 1003 1200247 69.99 69.99 PRODUCT PROD QOH PROD MIN PROD PRICE PROD DISCOUNT VEND NUMBER PROD CODE PROD DESCRIPT PROD NDATE 4243213 2015-11-03 00:00:00.000 8 Snow Suit 21225 0.05 21344 Mens Training Shoes 2015-12-13 00:00:00.000 32 15 0637032 Womens Basketbal... 2015-02-24 00:00:00.000 237 69.99 1200247 100 21344

Explanation / Answer

CREATE OR REPLACE VIEW view_name AS

SELECT line.inv_number,line.line_number,line.prod_code,line.line_units,line.line_price,line.line_amount

FROM LINE

INNER JOIN PRODUCT ON PRODUCT.PROD_CODE=LINE.PROD_CODE

WHERE

and PRODUCT.PROD_INDATE>= DATE_ADD(CURDATE(), INTERVAL 18 MONTH);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote