Question: Answer the following questions based on the CLIENT and ORDER tables: CLIENT Clientid 1 2 3 4 LastName Jason Smith Wagner Blake Jones Lynn Walters


Answer the following questions based on the CLIENT and ORDER tables: CLIENT Clientid 1 2 3 4 LastName Jason Smith Wagner Blake Jones Lynn Walters Poplar Robb Henlon FirstName Rita Jackson James Susan Tania Karina 5 6 Suburb Bella Boulevard High Park Richmond Rockdale Como Dural High Park Crasspark Elwood Hawthrone Phone 3432422 5535333 4425253 5141412 5474574 1231241 4574774 1312425 6746236 1235636 City Sydney Sydney Perth Brisbane Melbourne Sydney Perth Brisbane Melbourne Darwin 7 Max 8 9 10 Liam Noah James ORDER Order No Order Desc Clientld Order Date shippedDate Country Total Amount 200.50 17895 3 2 4 21678 22456 24562 34764 36533 36536 37454 Large Item Small Item Item ABC Medium Item 3 Tier Design Round Box Brand-005 Express Delivery 2 5 12/10/18 05/01/19 10/03/19 26/12/19 18/07/20 22/09/20 22/09/20 11/11/20 16/10/18 09/01/19 12/03/19 27/12/19 20/07/20 27/09/20 24/09/20 14/11/20 Australia Italy France Australia Japan Australia China Denmark 300.00 400.75 150.00 370.60 190.85 216.75 625.00 8 3 1 Questions: 1. Write CREATE and INSERT statements for the above tables and identify constraints. Make sure that primary key, foreign key, not null and other constraints are included in the table creation scripts. (3 marks) 2. Write SQL statements to fulfill the following requirements and provide the screenshot of the output: (7 marks) a. Display client details in descending order of the client first name. (1 mark) b. Find details of all clients whose last name begins with 'Ja'. Display results in descending order of country. (2 marks) c. Display number of clients living in Sydney. (2 marks) d. Display order ld, client details (name, ID of clients) and country for the orders placed in 2020. Display results in descending order of OrderID. (2 marks) wwwwwww
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
