Download Oracle Demo Database Sample Queries

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Entity–attribute–value model wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Database wikipedia , lookup

Relational algebra wikipedia , lookup

Oracle Database wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Clusterpoint wikipedia , lookup

SQL wikipedia , lookup

Database model wikipedia , lookup

PL/SQL wikipedia , lookup

Relational model wikipedia , lookup

Transcript
Homework Seven
CS325 Database Management Systems
Spring 2007
Date Assigned: 03-19-2007
Date Due: 3-26-2007
Problem One:
Using TOAD and the database you created in class:
- Write the SQL
- Execute the SQL
- Show the results of the SQL execution
For the following queries:
a)
List products in order of orders generated.
b) List products in order of orders generated, but include the description of the product.
c)
What is the most popular product (including description) and how many orders were generated?
d) List products in order by revenue generated:
e)
List products in order by revenue, and include a description of the product:
f)
What product (including description) generated the most revenue and what was that revenue?
g) What is the total number of orders, and average size of an order for each customer ranked by average
size of an order?
h) What is the name of the customer who buys the most product?
i)
What is the name of the customer who buys the least product?
j)
Rank the sales people by revenue generated.
Problem Two (Team Problem):
Construct a Relational Model for your Final Project.
For each relation, specify syntactically correct SQL DDL.
Prove this DDL is correct by executing it to create an ORACLE database.
The names of your tables and attributes should be unambiguous and meaningful.
Have one member of your group hand in the following:
- A copy of the Relational Model,
- SQL DDL to create your database
- Output from DESCRIBE <TABLE> command executed in ORACLE for each of your tables.