Let us consider the following relational database. The primary key column(s) of each table is denoted by an underline. The foreign keys are italicized. Schema: Customers (custID, fName, IName, password) Phones (custID, phone) Items (ilD, name, price, qtyInStock) Orders Places (olD, ordDate, shippingDate, receivalDate pay Amount, payMethod, custID) Contain (o/D, iID, price, qty) Specifically, the foreign keys for this database are as follows: the column custID of relation Phones that references table Customers, ⚫the column custID of relation Orders Places that references table Customers, the column olD of relation Contain references table OrdersPlaces, and ⚫ the column iID of relation Contain references table Items, you s based on thes as lab Lastvang bmwns for creating these tables in the file and and it Task 1 (Customer Information): Retrieve the ID and name of all customers and display the results as the following output. CustID | 900001715 0000CD123 0000PD456 000234541 555000201 555000202 **Output* Jazmine Elzey Jalen Harrison Clark Kent Peter Parker Alice Johnson Bob Smith John Doe Dante Grante Johnson Washington Jane Swith Lebron Smith Kevin Smith 555000243 Jake Frost 555000205 Anthony Seith Sarah Brown Terry Donaldson Jack Willian Larry Taylor Mary Price Noch Lee Alonzo Mckee Sarah Sheet Kyle Haskett Aiden Harbor Miles Brown Jazmine Jenkins rows in set (0.001 sec) **************** *****/ Task 2 (Inventory Control): Retrieve information on items with a quantity in stock below 10. Its results should be the same as the following output. iID **Output* price qtyInStock 36.30 @cr78 red boots On 12 web shooters 42.30 11234 Flashlight 15.50 50002 | Himalayan Salst 10.99 14 rows in set (0.000 sec) Task 3 (Monthly Sale Information): List February's ordering information and sort the results in descending order based on the pay amount. Rename and format the column payAmount as the following output. *Output* Date paysethod Task 4 (Monthly Sale Analysis): List the total number and the total amount of orders placed in February 2024. Rename the columns and format one of the columns as indicated in the following output. ***Output** Orders in February 2024 (0.000 sec) Task 5 (Frequent purchasing customers): List the ID of customers with two or more orders in February 2024 and the total number of orders this month. Rename one of the columns as the following output. CustID 920111222 920111227 920111266 **Output* Number of Orders in February 2024 rows in set (0.001 sec) Assignment Submission Instructions: This is an individual assignment - no group submissions are allowed. Submit a script file that contains the SELECT statements by assigned date. The outline of the script file lists as follows: Name: YourNameGoesHere * Class: CST 235 * Section: Date: *I have not received or given help on this assignment: YourName USE RetailDB; ####### Tasks: Write SQL Queries ######### --Task 1 (Customer Information): --List your SELECT statement below. --Task 2 (Inventory Control): --List your SELECT statement below. --Task 3 (Monthly Sale Information): --List your SELECT statement below. --Task 4 (Monthly Sale Analysis): --List your SELECT statement below. --Task 5 (Frequent purchasing customers): -List your SELECT statement below.
Let us consider the following relational database. The primary key column(s) of each table is denoted by an underline. The foreign keys are italicized. Schema: Customers (custID, fName, IName, password) Phones (custID, phone) Items (ilD, name, price, qtyInStock) Orders Places (olD, ordDate, shippingDate, receivalDate pay Amount, payMethod, custID) Contain (o/D, iID, price, qty) Specifically, the foreign keys for this database are as follows: the column custID of relation Phones that references table Customers, ⚫the column custID of relation Orders Places that references table Customers, the column olD of relation Contain references table OrdersPlaces, and ⚫ the column iID of relation Contain references table Items, you s based on thes as lab Lastvang bmwns for creating these tables in the file and and it Task 1 (Customer Information): Retrieve the ID and name of all customers and display the results as the following output. CustID | 900001715 0000CD123 0000PD456 000234541 555000201 555000202 **Output* Jazmine Elzey Jalen Harrison Clark Kent Peter Parker Alice Johnson Bob Smith John Doe Dante Grante Johnson Washington Jane Swith Lebron Smith Kevin Smith 555000243 Jake Frost 555000205 Anthony Seith Sarah Brown Terry Donaldson Jack Willian Larry Taylor Mary Price Noch Lee Alonzo Mckee Sarah Sheet Kyle Haskett Aiden Harbor Miles Brown Jazmine Jenkins rows in set (0.001 sec) **************** *****/ Task 2 (Inventory Control): Retrieve information on items with a quantity in stock below 10. Its results should be the same as the following output. iID **Output* price qtyInStock 36.30 @cr78 red boots On 12 web shooters 42.30 11234 Flashlight 15.50 50002 | Himalayan Salst 10.99 14 rows in set (0.000 sec) Task 3 (Monthly Sale Information): List February's ordering information and sort the results in descending order based on the pay amount. Rename and format the column payAmount as the following output. *Output* Date paysethod Task 4 (Monthly Sale Analysis): List the total number and the total amount of orders placed in February 2024. Rename the columns and format one of the columns as indicated in the following output. ***Output** Orders in February 2024 (0.000 sec) Task 5 (Frequent purchasing customers): List the ID of customers with two or more orders in February 2024 and the total number of orders this month. Rename one of the columns as the following output. CustID 920111222 920111227 920111266 **Output* Number of Orders in February 2024 rows in set (0.001 sec) Assignment Submission Instructions: This is an individual assignment - no group submissions are allowed. Submit a script file that contains the SELECT statements by assigned date. The outline of the script file lists as follows: Name: YourNameGoesHere * Class: CST 235 * Section: Date: *I have not received or given help on this assignment: YourName USE RetailDB; ####### Tasks: Write SQL Queries ######### --Task 1 (Customer Information): --List your SELECT statement below. --Task 2 (Inventory Control): --List your SELECT statement below. --Task 3 (Monthly Sale Information): --List your SELECT statement below. --Task 4 (Monthly Sale Analysis): --List your SELECT statement below. --Task 5 (Frequent purchasing customers): -List your SELECT statement below.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Make sure that the SQL script file can be run successfully for each task and insert data for each tables and show the outcome of the code on MySQL
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education