Question: 4-Part Question 1. Write a script that implements the following design in a database named MyWebDB: Users Downloads ? UserlD DownloadID UseriD DownloadDate FileName ProductID

 4-Part Question 1. Write a script that implements the following designin a database named MyWebDB: Users Downloads ? UserlD DownloadID UseriD DownloadDate

4-Part Question 1. Write a script that implements the following design in a database named MyWebDB: Users Downloads ? UserlD DownloadID UseriD DownloadDate FileName ProductID Products ProductiD FirstName LastName In the Downloads table, the UserID and ProductD columns are the foreign keys Include a statement to drop the database if it already exists Include statements to create and select the database Include any indexes that you think are necessary 2. Write a script that adds rows to the database that you created in exercise 1 Add two rows to the Users and Products tables Add three rows to the Downloads table: one row for user 1 and product 2; one for user 2 and product 2 and prod 1; and one for user 2 and product 2. Use the GETDATE function to insert the current date and time into the DownloadDate comUse the GETDATE fnctiapo2: Write a SELECT statement that joins the three tables and retrieves the data from these tables like this email _address johnsmith @gmail.com John janedoe@yahoo.com Jane janedoe@yahoo.com Jane first_name last_name download_date name product_name Smith Doe Doe 2012-04-24 16:15:38 pedals are falling.mp3 Local Music Vol 1 2012-04-24 16:15:38 tum_signal.mp3 2012-04-24 16:15:38 one horse_town mp3 Local Music Vol 2 Local Music Vol 1 Sort the results by the email address in descending order and the product name in ascending order

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!