logo

SQL Statement and Result Assignment

12 Pages1135 Words69 Views
   

Added on  2020-03-16

SQL Statement and Result Assignment

   Added on 2020-03-16

ShareRelated Documents
Student IDStudent NameSubject Code
SQL Statement and Result Assignment_1
Table of ContentsQuery 1..............................................................................................................................................................................3Query 2..............................................................................................................................................................................4Query 3..............................................................................................................................................................................4Query 4..............................................................................................................................................................................5Query 5..............................................................................................................................................................................6Query 6..............................................................................................................................................................................7Query 7..............................................................................................................................................................................8Query 8..............................................................................................................................................................................8Query 9..............................................................................................................................................................................9Query 10...........................................................................................................................................................................10Query 11...........................................................................................................................................................................11
SQL Statement and Result Assignment_2
Query 1Show sums of line totals for each invoice.SQL Statement & ResultSELECT INV_NUMBER, SUM(LINE_TOTAL) AS SUMFROM lineGROUP BY INV_NUMBER;INV_NUMBER SUM---------- ----------------1001 24.93999958038331002 9.979999542236331003 153.8499984741211004 34.86999988555911005 70.44000244140621006 397.829987525941007 34.96999931335451008 399.150006294251Screenshot
SQL Statement and Result Assignment_3
Query 2Locate the record in the vendor table that does not have a value for the attribute V_STATESQL Statement & ResultSELECT * FROM vendorWHERE V_STATE IS NULL;V_CODE V_NAME V_CONTACT V_AREACODE V_PHONE V_STATE V_ORDER---------- ---------- ---------- ---------- ---------- ---------- ----------25443 B&K, Inc. Smith 904 227-0093 NScreenshotQuery 3Find the customers whose balance is greater than 200 but less than 300SQL Statement & ResultSELECT * FROM customerWHERE CUS_BALANCE > 200 AND CUS_BALANCE < 300;CUS_CODE CUS_LNAME CUS_FNAME CUS_INITIAL CUS_AREACODE CUS_PHONE CUS_BALANCE---------- ---------- ---------- ----------- ------------ ---------- ----------------10016 Brown James G 615 297-1228 221.19000244140610018 Farriss Anne G 713 382-7185 216.550003051758
SQL Statement and Result Assignment_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Use assignment5 to show sums of line totals for each invoice
|13
|559
|82

SQL Assignment: SQL Queries Using Workbench
|14
|432
|147

Research and SQL Queries
|10
|692
|446