USE IMDB    — ensures correct database is active GO PRINT ‘|—‘ + REPLICATE(‘+—-‘,15) + ‘|’ PRINT ‘Read the questions below and insert your queries where prompted.  When  you are finished, you should be able to run the file as a script to execute all answers sequentially (without errors!)’ + CHAR(10) PRINT ‘Queries should be well-formatted.  SQL is not case-sensitive, but it is good form to capitalize keywords and table names; you should also put each projected column on its own line and use indentation for neatness.  Example: SELECT Name, CustomerID FROM   CUSTOMER WHERE  CustomerID < 106; All SQL statements should end in a semicolon.  Whatever format you choose for your queries, make sure that it is readable and consistent.' + CHAR(10) PRINT 'Be sure to remove the double-dash comment indicator when you insert your code!'; PRINT '|---' + REPLICATE('+----',15) + '|' + CHAR(10) + CHAR(10) GO GO PRINT 'CIS2275, Lab Week 6, Question 1  [3pts possible]: Write the query to display the name and year of birth for all people born after 1980, who have directed at least one show (i.e. those who appear at least once in the title_directors table). Limit results to those who have died (who have a value in the deathYear column). Columns to display:    name_basics.primaryName, name_basics.birthYear Format name_basics.primaryName as 25 characters wide and sort in descending order by birth year. Correct results will have 50 rows and will look like this: Name                      birthYear ------------------------- ----------- Anthony Conti             2000 Amanda Todd               1996 Daniel W. Ridge           1996 ... Nick Louvel               1981 Seth Gimlan               1981 Shane Ballard             1981 ' + CHAR(10) -- -- [Insert your code here] -- GO PRINT 'CIS2275, Lab Week 6, Question 2  [3pts possible]: Show every genre of television show which has had at least one title with 200 episodes. i.e. limit results to the titleType ''tvEpisode'' in the title_basics table, and to titles containing a row in the title_episode table with episodeNumber 200. Columns to display:    title_genre.genre Display only genre name sorted 15 characters wide, and eliminate duplicate values. Correct results will have 26 rows and will look like this: Genre --------------- Action Adult Adventure ... Talk-Show Thriller War ' + CHAR(10) GO -- -- [Insert your code here] -- GO PRINT 'CIS2275, Lab Week 6, Question 3  [3pts possible]: Write a common table expression to identify the WORST shows: join title_basics against title_ratings and limit your results to those with an averageRating value equal to 1.  Project the title, type, and startYear from title_basics; and label your CTE as BADSHOWS. In the main query, show a breakdown of BADSHOWS grouped by type, along with the total number of rows for each (i.e. GROUP BY titleType) Columns to display:    titleType, COUNT(*) Sort results in descending order by COUNT(*). Correct results will have 10 rows and will look like this: titleType    TOTAL_BAD_SHOWS ------------ --------------- tvEpisode    314 video        74 ... tvMiniSeries 7 tvShort      2 videoGame    2 ' + CHAR(10) GO -- -- [Insert your code here] -- GO PRINT 'CIS2275, Lab Week 6, Question 4  [3pts possible]: Identify the least popular professions.  Show each profession value from the name_profession table, along with the total number of matching rows (GROUP BY profession).  Use the HAVING clause to limit your results to professions with less than 1,000 rows. Columns to display:    name_profession.profession, COUNT(*) Correct results will have 3 rows formatted nicely: Profession                     TOTAL_PEOPLE ------------------------------ ------------ electrical_department          1 production_department          1 script_department              1 ' + CHAR(10) -- -- [Insert your code here] -- GO GO PRINT 'CIS2275, Lab Week 6, Question 5  [3pts possible]: Use the query from #4 above to display the names of all people belonging to these ...

Looking for solution of this Assignment?

WHY CHOOSE US?

We deliver quality original papers

Our experts write quality original papers using academic databases.We dont use AI in our work. We refund your money if AI is detected  

Free revisions

We offer our clients multiple free revisions just to ensure you get what you want.

Discounted prices

All our prices are discounted which makes it affordable to you. Use code FIRST15 to get your discount

100% originality

We deliver papers that are written from scratch to deliver 100% originality. Our papers are free from plagiarism and NO similarity.We have ZERO TOLERANCE TO USE OF AI

On-time delivery

We will deliver your paper on time even on short notice or  short deadline, overnight essay or even an urgent essay