Question: 1) Create Oracle database tables using SQL Data Definition Language (DDL) for each table listed in the metadata of Project 2. You may need to

1) Create Oracle database tables using SQL Data Definition Language (DDL) for each table listed in the metadata of Project 2. You may need to use a combination of DROP TABLE, CREATE TABLE, and ALTER TABLE SQL statements. 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 and ALTER TABLE statements (if desired) must show integrity constraints, as appropriate, for NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, REFERENCES, and CHECK constraints. Be sure to save your SQL script file used to create these tables with a .sql extension. You should rerun and test your SQL script file until it runs without any errors (this is why you’ll want to include DROP TABLE statements in another script).
2) Populate each of your tables with at least five valid rows of data each and show the SQL INSERT statements as you executed them. Populate other tables in your database, as necessary, to satisfy referential integrity. Save your SQL script file. You should test and rerun your SQL script file until it runs without any errors.
3) Develop an SQL script file to perform the following queries and updates. Use (Oracle's) SQL Developer to create and test the SQL file. You will find an Oracle database and Oracle's SQL Developer in the virtual Lab Broker.
You should test your SQL script file until it runs without any errors.
Retrieve all of your customers' names, account numbers, and addresses (street and zip code only), sorted by account number.
Retrieve all of the videos rented in the last 30 days and sort in chronological rental date order.
Produce a list of your distributors and all their information sorted in order by company name.
Update a customer name to change their maiden name to a married name. 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. You may want to include a ROLLBACK statement to undo your data update.
Delete a customer 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 may want to include a ROLLBACK statement to undo your data deletion.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Creating an entire Oracle database and writing complex SQL scripts with multiple queries and updates is a significant task that requires detailed know... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!