Question: Question number 2 1. Write a script that implements the following design: users downloads product product id product name user id email address first name
Question number 2
1. Write a script that implements the following design: users downloads product product id product name user id email address first name last name download id user id download date filename product id Data type of user id, download id and product id must be NUMBER. Data type of first name and last name must be VARCHAR2(10), use data types you think suitable for other attributes, add common column attributes (NOT NULL, UNIQUE, DEFAULT) you think necessary In the Downloads table, the user id and product id columns are the foreign keys Create the sequences for the user id, download id, and product id columns Include any indexes that you think are necessary Write a script that adds rows to the database that you created in exercise 1. Add two rows to the Users and Product tables. 2. Add three rows to the Downloads table: one row for user 1 and product 2; one row for user 2 and product 1; and one row for user 2 and product 2. Use the SYSDATE function to insert the current date into the download date column Use the sequences created in the previous exercise to get the values for the user id, download id, and product id columns. Other values you enter are from the following table (DOWNLOAD DATE will be current date): FIRST NAME LAST NAME DOWNLOAD DATE FILENAME PRODUCT NAME EMAIL_ADDRESS johnsmithegmail.com John janedoe@yahoo.com Jane janedoe@yahoo.com Jane Smith Doe Doe 17-JUN-14 17-JUN-14 17-JUN-14 pedals_are falling.mp3 Local Music Vol 1 turn_signal.mp3 one horse town.mp3 Local Music Vol 1 Local Music Vol 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
