You need to create the Store Sales database using the scripts under the Course Resources. Using the Store Sales database, create a mailing list from the CUSTOMERS table. The mailing list should display the name, address, city, stat and zip code for each customer. Look at the attached sample output and match your results. Name Location Zip John Brown 123 Main Street Charlotte, NC 28226 Cynthia Green 345 Salem Drive Waxhaw, NC 28173 Steve White 6006 Bollar Court Charlotte, NC 28277 Gail Black 4000 Woodfox Road Monroe, NC 28110 28226 80119 Doreen Blue 5677 Seth Drive Charlotte, NC Sean Egen 1290 Zenby Drive Denver, co 6 rowa selected

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
### Creating a Mailing List from the Store Sales Database

To create a mailing list using the Store Sales database, follow these steps:

1. **Database Setup:** Begin by creating the Store Sales database using the scripts provided in the Course Resources.
2. **Accessing the Data:** Focus on the CUSTOMERS table to retrieve the necessary information.
3. **Query Requirements:** Your goal is to display each customer's name, address, city, state, and zip code.

#### Sample Output

Here’s an example of the expected output after running the appropriate query:

| Name         | Location                             | Zip   |
|--------------|--------------------------------------|-------|
| John Brown   | 123 Main Street Charlotte, NC        | 28226 |
| Cynthia Green| 345 Salem Drive Waxhaw, NC           | 28173 |
| Steve White  | 6006 Bollar Court Charlotte, NC      | 28277 |
| Gail Black   | 4000 Woodfox Road Monroe, NC         | 28110 |
| Doreen Blue  | 5677 Seth Drive Charlotte, NC        | 28226 |
| Sean Egen    | 1290 Zenby Drive Denver, CO          | 80119 |

*Note: 6 rows have been selected for the sample mailing list.*

#### Constructing the Query
Your query should effectively extract the data to match the format of this sample output, focusing on the specified columns from the database.

Each row in the output includes:
- **Name:** The customer's full name.
- **Location:** A concatenation of the street address, city, and state.
- **Zip:** The postal code corresponding to the customer's address.

By accurately constructing your query, you can ensure that your results align with the provided sample, thus verifying the successful setup and access of the Store Sales database.
Transcribed Image Text:### Creating a Mailing List from the Store Sales Database To create a mailing list using the Store Sales database, follow these steps: 1. **Database Setup:** Begin by creating the Store Sales database using the scripts provided in the Course Resources. 2. **Accessing the Data:** Focus on the CUSTOMERS table to retrieve the necessary information. 3. **Query Requirements:** Your goal is to display each customer's name, address, city, state, and zip code. #### Sample Output Here’s an example of the expected output after running the appropriate query: | Name | Location | Zip | |--------------|--------------------------------------|-------| | John Brown | 123 Main Street Charlotte, NC | 28226 | | Cynthia Green| 345 Salem Drive Waxhaw, NC | 28173 | | Steve White | 6006 Bollar Court Charlotte, NC | 28277 | | Gail Black | 4000 Woodfox Road Monroe, NC | 28110 | | Doreen Blue | 5677 Seth Drive Charlotte, NC | 28226 | | Sean Egen | 1290 Zenby Drive Denver, CO | 80119 | *Note: 6 rows have been selected for the sample mailing list.* #### Constructing the Query Your query should effectively extract the data to match the format of this sample output, focusing on the specified columns from the database. Each row in the output includes: - **Name:** The customer's full name. - **Location:** A concatenation of the street address, city, and state. - **Zip:** The postal code corresponding to the customer's address. By accurately constructing your query, you can ensure that your results align with the provided sample, thus verifying the successful setup and access of the Store Sales database.
Expert Solution
Step 1
Solution:
 
SQL Query to create  Customer Table
 
CREATE TABLE  "CUSTOMER" 
   ( "NAME" VARCHAR2(100), 
 "ADDRESS" VARCHAR2(100), 
 "CITY" VARCHAR2(100), 
 "STATE" VARCHAR2(100), 
 "ZIP_CODE" NUMBER 
   )
SQL Query to insert values into customer tabler:
insert into customer values ('John Brown','123 main street','charlotte', 'NC',28226);
insert into customer values ('Cynthia Green','345 salem drive', 'Waxhaw','NC',28173);
insert into customer values ('Steve White','6006 Bollar Court','Charlotte', 'NC', 28277);
insert into customer values ('Gail Black','4000 WOodfox Road','Monroe', 'NC', 28110);
insert into customer values ('Doreen Blue','5677 Seth Drive','Charlotte','NC',28226);
insert into customer values ('Sean Egen','1290 Zenby Drive','Denver','CO',80119);
 
Query to create mailing list of a customers and display as per the output shown:
SELECT
 Name ,CONCAT(CONCAT( CONCAT( address,  city ), ' ,' ), state) As Location ,Zip_code as Zip
FROM
  CUSTOMER;
 
//In the above  Query we use Contact  function that adds to string together therefore the  it adds address ,city ,state and we use alias  to get the temporary name of the column . Therefore  Address,city ,state are aliased as location.
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
SQL Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
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