Question: SQL Syntax Summary From a database there are 3 tables, namely InvoiceHeader, InvoiceDetail and Items InvoiceHeader table Docnum DocEntry DocDate Doctotal 2013434 55651 11/2/2020 75,000,000

SQL Syntax Summary

From a database there are 3 tables, namely InvoiceHeader, InvoiceDetail and Items InvoiceHeader table Docnum DocEntry DocDate Doctotal 2013434 55651 11/2/2020 75,000,000 2013614 55831 4/11/2020 20,400,000 2013615 55832 4/11/2020 42,000,000 2013619 55836 11/3/2020 71,406,900 2013637 55854 4/11/2020 288,000,000 2013639 55856 4/11/2020 20,800,000 2013640 55857 4/11/2020 161,700,000 2013641 55858 4/11/2020 98,000,000 Invoice Detail table DocEntry ItemCode price quantity linetotal 55650 ONI-00001-KM200025 260,000 800 208,000,000 55651 ONI-00001-KM200025 250,000 300 75,000,000 55831 ONI-00002-KM200027 240,000 33 7,920,000 55831 ONI-00002-KM200028 240,000 52 12,480,000 55832 ONI-00002-KM200027 280,000 150 42,000,000 55836 ONINZ 7,950 9,010 71,629,500 55854 ONI-00002-KM200026 240,000 1,200 288,000,000 55856 ONI-00002-KM200026 260,000 80 20,800,000 55857 ONI-00002-KM200026 245,000 660 161,700,000 55858 ONI-00002-KM200026 245,000 400 98,000,000 Item Table item code itemname ONI-00001-KM200024 Onion Flevo #144/JS-X/2020 ONI-00001-KM200025 Onion Flevo #147/JS-X/2020 ONI-00001-KM200029 Onion Flevo #141/JS-X/2020 ONI-00002-KM200026 Onion Holland #136/JS-X/2020 ONI-00002-KM200027 Onion Holland #131/JS-IX/2020 ONI-00002-KM200028 Onion Holland #130/JS-IX/2020 ONINZ Onions New Zealand Output ItemCode itemname SubTotalQty SubTotalVal ONI-00001-KM200025 ONI-00002-KM200027 ONI-00002-KM200028 ONINZ ONI-00002-KM200026 Please make a query (SQL syntax) according to the expected output. Use Join in the form of relations from 3 existing tables and then calculate with Group By and SUM

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!