Question: Please help me out. thanks Question is: 1.create proposition describing each query in the file chapter 3 join.sql * I attached chapter 3 joins.sql 2.







USE TSQLV4 database to test the queries using the TSQLV4 database to demonstrate that they work. use Northwinds 2020TSQLV6 and correct the queries to work with tables and columns for the assignment below Create a proposition describing each query in the file Chapter 03 - Joins.sql Execute each of the corrected queriesusing Northwinds2019TSQLVS Create screen shots of the execution of the examples Submit as one pdf (paste each screen shot into a word and export the word document as a pdf) Export 5 queries as a flat file (CSV format) using the Importiexport wizard into a folder Save in a folder of your choice for each chapter (Example: CSC1331 Chapter 3) Do the same for the Chapter 03 - Joins - Exercises.sql by writing the queries and creating a single pdf of the output The submission should include 2 PDF's and all of the import export files Chapter 03 - Joins.sql 10 11 USE TSOLVA: 12 13 -- SQL-92 14 SELECT c.custid, E.empid 15 FRON Sales. Customers AS C 16 CROSS JOIN HR. Employees AS E 17 18 -- SOL-89 19 SELECT C.custid, E.empid 20 FROM Sales. Customers AS C, HR. Employees AS E: 21 22 -- Sell Cross-Join 23 SELECT 24 El.empid, El. firstname, El. lastname, 25 E2.empid, E2.firstname, E2.lostnane 26 FROM HR.Employees AS E1 27 CROSS JOIN HR. Employees AS E2: 28 00 29 30 - All numbers From - 1000 32 32 -- Auxiliary table or digits 33 USE TSQLV4: 30 35 DROP TABLE IN EXISTS dbo. Digits; 36 37 CREATE TABLE dbo. Dita (d1910 INT NOT NULL PRIMARY KBY): 39 INSERT INTO dbo.Digits (digit) 40 VALUES (9.). (2), (3), (4), (5),().0), (3), (: 42 42 SELECT disc EROM dbo. Digita 43 00 64 Chapter 03 - Joins.sql 49 45 -- All numbers from 1 - 1000 46 SELECT 13.digit - 100 + D2.digit 10 + Di.digit + 1 AS n 47 FROM dbo. Digits AS DI 49 CROSS JOIN dbo. Digits AS D2 CROSS JOIN dbo. Digits AS D3 SO ORDER BY n 51 52 53 -- INNER Joins 54 55 56 USE TSQLV4; 57 58 -- SOL-92 59 SELECT E.empid, E.firstnane, 2. lastname, o.orderia 60 FROM HR.Employees AS E 62 INNER JOIN Sales.Orders AS O 62 ON E. cmpid - O.empid; 63 64 -- SQL-59 65 SELECT E.cmpid, E.Firstname, E. lastname, O.orderid 66 PROM MR. Employees AS E, Sales. Orders AS O 67 WHERE E.empid - 0.empid; 69 00 69 70 -- Inner Joan Safety 72 SETE Epid. E. firstnane, str. o.orderid 73 ROK NR.Loyees AS 74 5 76 78 SELECT Empid, Efirstname, Elastrame, 0.orderid 79 PROM HR. Employees AS E, Sales. Orders AS O 20 GO Chapter 03 - Joins.sql 83 -- More Join Examples 84 85 86 87 -- Composite Joins 88 89 90 -- Audit table for updates against Order Details 91 USE TSQLV4: 92 93 DROP TABLE IP EXISTS Sales Order DetailsAudit; 94 95 CREATE TABLE Sales.Order DetailsAudit 97 lan INT NOT NULL IDENTITY 98 orderid INT NOT NULL. 99 productid INT NOT NULL, 100 dt DATETIME NOT NULL, 102 loginname yaname NOT NULL, 102 coluname yaname NOT NULL, 203 oldal SQL VARIANT, 104 newval SQL VARIANT 205 CONSTRAINT PK_Order Detailsudit PRIMARY KEY (12) CONSTRAINT FX_Order Detailsudit_Order Details 107 FOREIGN KEY Torderad, product:) 109 REPERENCES Sales.Order Details forderid, productid) 209) 110 191 SELECT OD.orderid, OD.produccid, D.qty, ODA.dt, Op.loginname, ODA. oldval, ODA.newal 13 PROM Sales. Order Details AS OD INNER JOIN Sales. Order Detailsaudit AS ODA ON OD. ordersd - ODA.azderad AND OD. productid - ODA.products 27 WHERE ODR. Gonname - ' . Chapter 03 - Joins.sal 119 120 -- Non-Equi Joins 121 122 123 -- Unique pairs of employees 124 SELECT 125 El.empid, El. firstnane, El. lastname, 126 E2.empid, E2. firstname, E2.lastname 127 PROM HR.Employees AS EI 128 INNER JOIN HR. Employees AS E2 129 ON El.empid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
