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 (iID, name, price, qtyInStock) Orders Places (OID, ordDate, shippingDate, receivalDate receivalDate, payMethod, custID) Contains (oID, 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 oID of relation Contains references table OrdersPlaces, and • the column iID of relation Contains references table Items, For your convenience, the SQL statements for creating these tables are available in the file retailDB.sql. Download it on your computer and run it to build the retailDB database on the MySQL database server. Write one SQL query statement for each of the following queries and run them on the MySQL Database Server. The query answers must not contain duplicates, and you should use the SQL keyword DISTINCT only when necessary. Execute your queries based on these tables. Please put query (SELECT) statements into a SQL script file and save it as lab4YourLastName.sql. Then, submit it to the Assignment Link - Lab 4 Assignment. Task 1 (Customer Information): Retrieve the ID and name of all customers and display the results as the following output. ********** **Output* *********** custID Name 000006798 Jazmine Elzey 000007543 | Jalen Harrison |00000ac01 Clark Kent /************* *Output** ************** ********* custID | Name 000006798 Jazmine Elzey 000007543 Jalen Harrison 00000ac01 | Clark Kent 00000af15 | Peter Parker 0000CD123 | Alice Johnson 0000PD456 Bob Smith 000234561 John Doe 001111222 Dante Grante 548618292 | Johnson Washington 555000001 | John Doe 555000002 Jane Smith 555000201 555000202 555000203 Lebron Smith Kevin Smith Jake Frost 555000205 | Anthony Smith 555000301 | Sarah Browne 555000302 Terry Donaldson 835261882 | Jack Williams 920111221 | Larry Taylor 920111222 Mary Price 920111224 | Norh Lee 920111227 | Alonzo McKee 920111233 | Sarah Sheet 920111255 Kyle Haskett 920111266 Aiden Harbor 920111444 | Miles Brown 920111666 | Jazmine Jenkins 27 rows in set (0.001 sec) ***********************************************/

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
icon
Related questions
Question

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.

Make sure the SQL script file can be run successfully in MySQL and show the outcome of the code on MySQL

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 (iID, name, price, qtyInStock)
Orders Places (OID, ordDate, shippingDate, receivalDate receivalDate, payMethod,
custID)
Contains (oID, 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 oID of relation Contains references table OrdersPlaces, and
• the column iID of relation Contains references table Items,
For your convenience, the SQL statements for creating these tables are available in the file
retailDB.sql. Download it on your computer and run it to build the retailDB database on the
MySQL database server. Write one SQL query statement for each of the following queries
and run them on the MySQL Database Server. The query answers must not contain
duplicates, and you should use the SQL keyword DISTINCT only when
necessary. Execute your queries based on these tables. Please put query (SELECT)
statements into a SQL script file and save it as lab4YourLastName.sql. Then, submit it to
the Assignment Link - Lab 4 Assignment.
Task 1 (Customer Information): Retrieve the ID and name of all customers and display the
results as the following output.
**********
**Output*
***********
custID
Name
000006798 Jazmine Elzey
000007543 | Jalen Harrison
|00000ac01 Clark Kent
Transcribed Image Text: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 (iID, name, price, qtyInStock) Orders Places (OID, ordDate, shippingDate, receivalDate receivalDate, payMethod, custID) Contains (oID, 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 oID of relation Contains references table OrdersPlaces, and • the column iID of relation Contains references table Items, For your convenience, the SQL statements for creating these tables are available in the file retailDB.sql. Download it on your computer and run it to build the retailDB database on the MySQL database server. Write one SQL query statement for each of the following queries and run them on the MySQL Database Server. The query answers must not contain duplicates, and you should use the SQL keyword DISTINCT only when necessary. Execute your queries based on these tables. Please put query (SELECT) statements into a SQL script file and save it as lab4YourLastName.sql. Then, submit it to the Assignment Link - Lab 4 Assignment. Task 1 (Customer Information): Retrieve the ID and name of all customers and display the results as the following output. ********** **Output* *********** custID Name 000006798 Jazmine Elzey 000007543 | Jalen Harrison |00000ac01 Clark Kent
/*************
*Output**
**************
*********
custID
| Name
000006798
Jazmine Elzey
000007543 Jalen Harrison
00000ac01 | Clark Kent
00000af15 | Peter Parker
0000CD123 | Alice Johnson
0000PD456 Bob Smith
000234561
John Doe
001111222 Dante Grante
548618292 | Johnson Washington
555000001 | John Doe
555000002 Jane Smith
555000201
555000202
555000203
Lebron Smith
Kevin Smith
Jake Frost
555000205 | Anthony Smith
555000301 | Sarah Browne
555000302 Terry Donaldson
835261882 | Jack Williams
920111221 | Larry Taylor
920111222 Mary Price
920111224 | Norh Lee
920111227 | Alonzo McKee
920111233 | Sarah Sheet
920111255 Kyle Haskett
920111266 Aiden Harbor
920111444 | Miles Brown
920111666 | Jazmine Jenkins
27 rows in set (0.001 sec)
***********************************************/
Transcribed Image Text:/************* *Output** ************** ********* custID | Name 000006798 Jazmine Elzey 000007543 Jalen Harrison 00000ac01 | Clark Kent 00000af15 | Peter Parker 0000CD123 | Alice Johnson 0000PD456 Bob Smith 000234561 John Doe 001111222 Dante Grante 548618292 | Johnson Washington 555000001 | John Doe 555000002 Jane Smith 555000201 555000202 555000203 Lebron Smith Kevin Smith Jake Frost 555000205 | Anthony Smith 555000301 | Sarah Browne 555000302 Terry Donaldson 835261882 | Jack Williams 920111221 | Larry Taylor 920111222 Mary Price 920111224 | Norh Lee 920111227 | Alonzo McKee 920111233 | Sarah Sheet 920111255 Kyle Haskett 920111266 Aiden Harbor 920111444 | Miles Brown 920111666 | Jazmine Jenkins 27 rows in set (0.001 sec) ***********************************************/
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education