BCIS 2420 - Introduction to Data Processing

advertisement
BCIS 2420 – Database I
SQL Assignment 1
Name: ______________________________
From the attached table, create a SQL query and give the resulting table (with complete
data) for the following scenarios: NOTE: The pre-formatted table may or may not be
the size of the actual result table.
1.
(Already done for you) Who is the Contact for Customer 110?
SQL Query:
SELECT Contact
FROM Customer
WHERE ID = 110
Results:
Contact
Ron Wayne
2.
What are the names and state of all customers in Utah, Arizona, or California?
SQL Query:
Results:
3.
List the customer ID, the name, and sales for all customers who have been
customers since before 1990 (1990 inclusive).
SQL Query:
Results:
4.
List all information for customers who have under $75,000 in sales.
SQL Query:
Results: (Skip for this one)
5.
List all information for all customers in the West region.
SQL Query:
Results: (Skip for this one)
6.
List all information for customers in the West region who had sales between
$75,000 and $150,000 (inclusive)?
SQL Query:
Results: (Skip for this one)
7.
What is the name of all customers who are not in the West region?
SQL Query:
Results:
8.
What is the customer ID of Kitten Kaboodle?
SQL Query:
Results:
9.
List the name, sales, and the "customer since" of all customers who have been
customers since before 1985 or have sales in excess of $100,000.
SQL Query:
Results:
10.
List all information for all customers who live in Colorado (CO).
SQL Query:
Results:
Customer
ID
Name
Contact
Address
City
State
Zip
Macom
Mesa
Rio Piedras
Los Angeles
Provo
Everett
Huntsville
GA
AZ
PR
CA
UT
WA
AL
31201
85204
00929
90001
84604
98201
35750
South
West
South
West
West
West
South
$105,243
$84,948
$264,876
$57,372
$67,943
$97,267
$115,945
Customer
Since
1985
2004
1980
1996
2003
1989
1999
IL
60601
North
$45,645
2005
Milwaukee
New York
WI
NY
53201
10001
North
East
$87,640
$15,345
1986
2005
101
102
103
104
105
106
107
Snyder Retail, Inc.
Arizona Product
Carribbean Cruisers
City Distribution
Kitten Kaboodle
John's Plumbing
Rubens Office Supply
Jim Snyder
Sarah James
Carlos Mendez
Li Wang
Carol Jensen
John Jacobs
Kate Ruben
108
Great Lakes
Computer
Dreamwave Gadgets
Ron Wayne, Inc.
Jean S. Mardt
104 Peachtree Dr.
702 East Main
1534 Calle del Sol
9422 Lamas Blvd
101 West University Ave
902 Colby Avenue
94 North Jewkes Suite
40
10345 Jackson Blvd
Walter Smitty
Ron Wayne
85612 Snowman Rd.
5214 American Ave
109
110
Chicago
Region
Sales
Download