Place your order now for a similar assignment and have exceptional work written by our team of experts, At affordable rates
For This or a Similar Paper Click To Order Now
Write a script one step at a time to generate the DB schema of the movie rental database. Test the partial
results by inspecting the tables in SQLDeveloper. Do not go on to the next step until you have the previous step
1. Define the MOVIE rental database
Use the following database schema to create a script that generates and populates the movie rental database. LOOK AT THE SCREENSHOT.
The movie ids should be a 16-char string with the format
Characters 1-3: represent the country of the producer: e.g., USA
Characters 5-8: represent the year of the movie: e.g., 2003
Characters 10-11: represent an identifier of the movie genre: e.g., HR for Horror
Characters 13-16, 4-digit sequence (when characters from 1-12 are the same as a previous entry, the
sequence increments by one). For example, if USA-2003-HR-0001 is already in the table as a
movie id, the next movie to be input with the country: USA, year: 2003, and genre: HR should have
the code USA-2003-HR-0002.
– Customer and director ids are represented by a 9-digit code. Please choose a proper max length for first
names, last names, and movie titles. Check this movie title as a reference to pick your max length.
– dob represents the date of birth of the customer or director, rented indicates the date a movie was
rented and duedate indicates when the movie should be returned.
– duration is a fixed 5-character string with the format HH:MM, e.g. 02:32, 04:43.
– Any date field in the schema should be stored as a date object, not just as character strings. The genre id
and year (4-digit integer) must be consistent with the definition of the movie id explained above.
Define the primary keys and foreign keys as indicated in the schema above. To help you with that, you could:
a. List the attribute(s) that make up the primary key (if one exists) for each of the relations.
b. List the attribute(s) that make up the foreign key(s) (if any exist) in each of the relations.
Hint: you will have to create DIRECTOR before MOVIE, and MOVIE and CUSTOMER before RENTAL.
Include the following constraints:
– Emails should include the @ character (only the @ should be check in the constraint)
– Not two emails can be equal in the same relation
– The movie place only uses movies released from 1950 and later
– Num_rentals, times a movie has been rented, does not allow null values, the DEFAULT value when
populating should be 0.
To avoid name conflicts during repeated runs, start your script file with DROP TABLE commands for all four
tables (for preventing foreign key violation errors put them in reverse order of the creation of the tables).
Run your script and look at the columns and constraints of each table to verify that they have been created
correctly before continuing your work.
2. Populate the database
– Populate the tables in the proper order to avoid referential errors
1) populate the customer and director tables with at least three entries each (make up the data
2) populate the movie table with at least 4 movies (make up the data, values should meet all
corresponding constraints. Pay attention to the director ids)
3) populate the RENTAL table for at least five movie rentals (make up the data values, the values
should meet all corresponding constraints.)
every movie should’ve been rented at least once.
Every director should be used at least once.
Every customer should have rented at least one movie. Some should have rented at
least two. At least one customer should have a rental yet to be returned.
4) Check your data and verify that all the conditions above have been met.
5) Assume that the movie rental place only has one copy of each movie, so the dates for two
rentals of the same movie should NOT overlap. Do not create constraints for this, just make sure
your data meet this criterion.
3. Displaying the content of your tables
– Display ALL the content of each table by adding SELECT statements at the very end of your script,
followed by a single COMMIT; statement.
– Run the complete script and save the complete contents of the script output window, including the
displayed tables, to a text file. (Clear the script output window first so that only the output of the last
run of your script is displayed and saved.)
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.