Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1a) Write one or more scripts to set up the following tables with data as shown below, then run them using SQLplus. As you can

1a) Write one or more scripts to set up the following tables with data as shown below, then run them using SQLplus.

image text in transcribed

As you can guess, ArtPop means the popularity of a particular Artist, perhaps estimated by a poll or record (CD, MP3, download, etc) sales. RecPopu means the popularity of an individual Recording. For the Artist whose ArtistID is 99, please just make up a name yourself and use it in your script(s) when you insert that row. Also make up that artists ArtPopu score.

1b) Use Select * (twice) to show your two tables. They should be like the above. Paste your results (using SQLplus) here:

Note: For everything you paste in from your SQLplus results, please make sure that it is legible. A screen shot of the whole screen will not be readable. You should either Copy the SQLplus text (e.g., the results of a Select) to the clipboard, or perhaps take screenshot of just the relevant small rectangular portion of the window containing the SQLplus output using the Snip tool or whatever.

1c) Paste your script(s) for part (1a) here. Be sure they have enough comments to show what they are doing. You might choose to have just one big script to create and populate the tables. Or you might do Create in one script and then do the Inserts in another script. Whatever works for you

1d) Write a query to show the name and ArtPopu of all artists with ArtPopu scores between 25 and 75 (inclusive). Show the query and the results here:

1e) Write a query to show just the name and popularity of the Artists, with the most popular artists listed first, and omitting any artists with a popularity less than 25. Show the query and results here:

1f) Write a query to show, for every Recording ,the following fields: ArtName,RecName,RecPopu,ArtPopu,ArtID,RecArtID. There will be one line in the output for each recording. The output should be sorted alphabetically by artist name.

1g) What do you notice about the data values in the last two columns in part 1f? Why does this happen?

1h) In the two tables above (Artists and Recordings), which field (column and table) is really acting as a Foreign Key pointing to the other table? (Even though we didn formally impose a Foreign Key Constraint.)

Table: Artists ArtistID ArtName Elvis Ham Kool Kardash Make up a name heremake up popu Joe Nothingburger ArtPopu 62 200 0 Table: Recordings RecordingID RecPopu RecName You Hound Dog, You You Named Me Be my Valentine I am so Kool RecArtlD 30 82.3 39 13

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions