Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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
Step: 1
Creating an entire Oracle database and writing complex SQL scripts with multiple queries and updates is a significant task that requires detailed know...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started