Question
I need to know how to write the sequences for my final database project. Instructions: In this project you are going to create tables and
I need to know how to write the sequences for my final database project.
Instructions:
In this project you are going to create tables and constraints based on an entity relationship diagram. This project will reinforce the learning objectives from Modules 1 - 3. You will use the tables created in the mid term project as part of the final project where you will create a functional database that is appropriate for a small business. You will use the SQL Workshop - SQL Scripts page to create a single script file to complete the assignment.
Save your script to a file named LastName_FirstName_Final.sql (where LastName is your last name and FirstName is your first name). Once you create the script in APEX, you will have the ability to save it and download for submission. Your script should be well-formatted and should contain comments regarding what the particular section of the script is supposed to do. See the file sample_script.PNG for suggested script format.
If you did not complete the mid term project you will not be able to proceed without first creating the following tables and columns using the entity relationship diagram in the file OracleFlix_Project_ERD.pdf. You will need to choose the appropriate data types for each column in your database. You will also need to create primary keys (#) and foreign keys to link the tables using the identified relationships in the ERD. You will need to set the columns identified with an asterisk (*) to NOT NULL.
Complete the following objectives using APEX:
Background Information:
You have been contracted by a small company named OracleFlix to create a database for storing information about their inventory and rentals. Use the entity relationship diagram in the file OracleFlix_Project_ERD.pdfas your guide to building the required tables.
Assignment Deliverable:
Using the tables created for the mid term project
In order to be eligible for full credit, you must complete the following tasks.
- Create a view called TITLE_UNAVAIL to show the movie titles and media_id of the media not returned yet.
- The view should not allow any DML operations.
- Create the following sequences to be used for primary key values:
- Use a sequence to generate PKs for CUSTOMER_ID in CUSTOMERS table
- Begin at 101 and increment by 1
- Use a sequence to generate PKs for TITLE_ID in MOVIES table
- Begin at 1 and increment by 1
- Use a sequence to generate PKs for MEDIA_ID in MEDIA table
- Use a sequence to generate PKs for MEDIA_ID in MEDIA table
- Use a sequence to generate PKs for ACTOR_ID in ACTOR table
- Begin at 1001 and increment by 1
- Use a sequence to generate PKs for CUSTOMER_ID in CUSTOMERS table
- Create records in your tables. You can use the file, OracleFlix_SQL_Project_Tables.pdf
Actions
as a guide to loading data in your tables.- Use www.imdb.com (Links to an external site.) to find at least 6 titles for your movies table.
- Create at least 6 fake records for your customers table.
- You will add data to the rest of the tables based on what is loaded into customers and movies.
- Create an index on the last_name column of the Customers table.
- Create a synonym called TU for the TITLE_UNAVAIL view.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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