physical design and implementation using SQL

In this project you will perform the physical design and implementation using SQL Data Definition Language (DDL) and proceed with populating the Mom and Pop Johnson Video Store database via Data Manipulation Language (DML) SQL commands. #1. Project 2 Details: Create Oracle database tables using SQL Data Definition Language (DDL) for each table listed in Project 1. Make sure that entity and referential integrity are enforced by declaring a primary key for each table (these may be composite keys) and declaring all appropriate foreign keys. Your CREATE TABLE statements must show integrity constraints, as appropriate, for NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, REFERENCES, and CHECK constraints. You should test your script to make sure it runs without error. Capture the script output showing that all SQL in your SQL script file worked properly.
For above #1, see following file 
 
#2. Provide two examples of SQL DML (i.e., "INSERT") commands that fail different table integrity constraints you set up in one of your table. Explain why the statements fail. You should include comments in the SQL script describing why the insert statements failed. Capture the script output showing that all SQL in your SQL script file worked properly.


#3.  Populate each of your tables with at least five valid rows of data each and show the SQL you used. Populate other tables in your database, as necessary, to satisfy referential integrity. You should test your script to make sure it runs without error. Capture the script output showing that all SQL in your SQL script file worked properly.


#4. Write SQL to perform the following queries and updates. You should test your script to make sure it runs without error:
A.      Retrieve all of your customers' names, account numbers, and addresses (street and zip code only), sorted by account number.
B.      Retrieve all of the videos rented in the last 30 days and sort in chronological rental date order.
C.      Produce a list of your distributors and all their information sorted in order by company name.
D.      Update a customer name to change their maiden names to married names. You can choose which row to update. Make sure that you use the primary key column in your WHERE clause to affect only a specific row.
E.       Delete customers from the database. You can choose which row to delete. Make sure that you use the primary key column in your WHERE clause to affect only a specific row.
 
You will have to submit two things:
a text file containing all the SQL statements that you created for this project: CREATE TABLE, INSERT, SELECT, UPDATE, DELETE. Include comments in the file to indicate what each section of the file represents. This is the content of your SQL Developer's Worksheet window related to the UMUC Oracle connection
Here is all provided queries in one file:
a text file with the results of running your SQL statements. This is the content of your Script Output panel in SQL Developer. Please use .txt extension for your files, not .sql.
 

Powered by