{"id":7224,"date":"2021-10-12T16:00:44","date_gmt":"2021-10-12T16:00:44","guid":{"rendered":"https:\/\/assignmenttutors.net\/blog\/using-microsoft-sql-server-management-studio-2012-or-later-or\/"},"modified":"2021-10-12T16:00:44","modified_gmt":"2021-10-12T16:00:44","slug":"using-microsoft-sql-server-management-studio-2012-or-later-or","status":"publish","type":"post","link":"https:\/\/assignmenttutors.net\/blog\/using-microsoft-sql-server-management-studio-2012-or-later-or\/","title":{"rendered":"Using microsoft sql server management studio 2012 (or later) or"},"content":{"rendered":"<div>\n<p>*\/<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;|&#8212;&#8216; + REPLICATE(&#8216;+&#8212;-&#8216;,15) + &#8216;|&#8217;<\/p>\n<p>PRINT &#8216;Read the questions below and insert your queries where prompted. \u00a0When \u00a0you are finished,<\/p>\n<p>you should be able to run the file as a script to execute all answers sequentially (without errors!)&#8217; + CHAR(10)<\/p>\n<p>PRINT &#8216;Queries should be well-formatted. \u00a0SQL is not case-sensitive, but it is good form to<\/p>\n<p>capitalize keywords and to capitalize table names as they appear in the database; you should also put\u00a0<\/p>\n<p>each projected column on its own line and use indentation for neatness. \u00a0Example:<\/p>\n<p>\u00a0\u00a0\u00a0SELECT Name,<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0CustomerID<\/p>\n<p>\u00a0\u00a0\u00a0FROM \u00a0\u00a0CUSTOMER<\/p>\n<p>\u00a0\u00a0\u00a0WHERE \u00a0CustomerID &lt; 106;<\/p>\n<p>All SQL statements should end in a semicolon. \u00a0Whatever format you choose for your queries, make<\/p>\n<p>sure that it is readable and consistent.&#8217; + CHAR(10)<\/p>\n<p>PRINT &#8216;Be sure to remove the double-dash comment indicator when you insert your code!&#8217;;<\/p>\n<p>PRINT &#8216;|&#8212;&#8216; + REPLICATE(&#8216;+&#8212;-&#8216;,15) + &#8216;|&#8217; + CHAR(10) + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 1 \u00a0[3pts possible]:<\/p>\n<p>Popular Genres<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>We will start with the IMDB database.<\/p>\n<p>For each genre, show the total number of shows that are listed in that genre. Format genre as<\/p>\n<p>15 characters wide. Order in descending order of popularity.<\/p>\n<p>Correct results will have 28 rows and will look like this:<\/p>\n<p>Genre \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Count<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Drama \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01183422<\/p>\n<p>Comedy \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01049517<\/p>\n<p>Short \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0670864<\/p>\n<p>Documentary \u00a0\u00a0\u00a0\u00a0499078<\/p>\n<p>Talk-Show \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0452645<\/p>\n<p>Romance \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0398779<\/p>\n<p>Family \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0339665<\/p>\n<p>News \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0338804<\/p>\n<p>Animation \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0255212<\/p>\n<p>Reality-TV \u00a0\u00a0\u00a0\u00a0\u00a0232633<\/p>\n<p>&#8230;<\/p>\n<p>Western \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a025128<\/p>\n<p>War \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a020984<\/p>\n<p>Film-Noir \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0852<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>USE IMDB<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 2 \u00a0[3pts possible]:<\/p>\n<p>M*A*S*H<\/p>\n<p>&#8212;&#8212;-<\/p>\n<p>For each season of M*A*S*H, show the total number of episodes and total number of votes.<\/p>\n<p>Display results ordered by season. Write your query to match the primaryTitle in title_basics<\/p>\n<p>instead of hard-coding a tconst value.<\/p>\n<p>Hint: title_episode.parentTconst is the series, title_episode.tconst is the episode.<\/p>\n<p>Episodes have ratings in title_ratings, where the number of votes for the episode is also contained.<\/p>\n<p>Correct results will look like this:<\/p>\n<p>Season Number Number of Episodes Total Votes by Season<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a024 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a08470<\/p>\n<p>2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a024 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a06724<\/p>\n<p>3 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a024 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a06383<\/p>\n<p>4 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a024 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05859<\/p>\n<p>5 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a024 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05546<\/p>\n<p>6 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a024 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05092<\/p>\n<p>7 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a025 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05362<\/p>\n<p>8 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a025 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05340<\/p>\n<p>9 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a020 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04177<\/p>\n<p>10 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a021 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04049<\/p>\n<p>11 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a016 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05849<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 3 \u00a0[3pts possible]:<\/p>\n<p>Again Popular Genres<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Repeat the query from Question 1, but this time express the popularity as a percentage of the total number\u00a0<\/p>\n<p>of shows. Format the percentage to two decimal places and add a % sign to the end.<\/p>\n<p>Hint: Start by adding the Total column to the SELECT clause. You&#8221;ll need to use a windowed function.<\/p>\n<p>If you use &#8230; OVER () that will window over the entire contents of the table. Once you have that working,<\/p>\n<p>the percent is 100 * the expression that gives you Count \/ the expression that gives you Total. Use STR<\/p>\n<p>to convert that to 6 characters with two digits after the decimal point, then add a % to the end.<\/p>\n<p>Hint 2: Percent is a reserved keyword in SQL, so you&#8221;ll need to quote it if you want to use it as a column name.<\/p>\n<p>Correct results will have 28 rows and look like this:<\/p>\n<p>Genre \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Count \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Total \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Percent<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;-<\/p>\n<p>Drama \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01183422 \u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a016.22%<\/p>\n<p>Comedy \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01049517 \u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a014.38%<\/p>\n<p>Short \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0670864 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a09.19%<\/p>\n<p>Documentary \u00a0\u00a0\u00a0\u00a0499078 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a06.84%<\/p>\n<p>Talk-Show \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0452645 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a06.20%<\/p>\n<p>Romance \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0398779 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a05.46%<\/p>\n<p>Family \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0339665 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.65%<\/p>\n<p>News \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0338804 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.64%<\/p>\n<p>Animation \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0255212 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a03.50%<\/p>\n<p>Reality-TV \u00a0\u00a0\u00a0\u00a0\u00a0232633 \u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a03.19%<\/p>\n<p>&#8230;<\/p>\n<p>Western \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a025128 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.34%<\/p>\n<p>War \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a020984 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.29%<\/p>\n<p>Film-Noir \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0852 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a07297619 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.01%<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 4 [3pts possible]:<\/p>\n<p>Metaphone with the most Variants<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>We&#8221;re going to switch over to the NAMES database for the next few queries.<\/p>\n<p>Produce a report that shows the most popular metaphones for baby names. Include two rows<\/p>\n<p>for each metaphone, one for F babies and one for M babies. For each metaphone, show the<\/p>\n<p>total number of names that match that metaphone, and the total number of babies that were<\/p>\n<p>given those names. Order in descending order by total number of babies, and display the<\/p>\n<p>top 10 results.<\/p>\n<p>Format Metaphone as 10 characters wide.<\/p>\n<p>For practice, do not use the all_data view. Write the correct JOIN instead.<\/p>\n<p>Correct results will look like this:<\/p>\n<p>Gender Metaphone \u00a0Total Names Total Babies<\/p>\n<p>&#8212;&#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>M \u00a0\u00a0\u00a0\u00a0\u00a0JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03565 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05910583<\/p>\n<p>M \u00a0\u00a0\u00a0\u00a0\u00a0JMS \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0403 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04859289<\/p>\n<p>F \u00a0\u00a0\u00a0\u00a0\u00a0MR \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03499 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04835115<\/p>\n<p>M \u00a0\u00a0\u00a0\u00a0\u00a0RBRT \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0410 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04755683<\/p>\n<p>M \u00a0\u00a0\u00a0\u00a0\u00a0MXL \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01520 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04641296<\/p>\n<p>M \u00a0\u00a0\u00a0\u00a0\u00a0WLM \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0604 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03746134<\/p>\n<p>M \u00a0\u00a0\u00a0\u00a0\u00a0TFT \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0606 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03547986<\/p>\n<p>F \u00a0\u00a0\u00a0\u00a0\u00a0TN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010004 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a03276887<\/p>\n<p>F \u00a0\u00a0\u00a0\u00a0\u00a0JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a09945 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03216270<\/p>\n<p>M \u00a0\u00a0\u00a0\u00a0\u00a0RXRT \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0435 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02516670<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>USE NAMES<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 5 \u00a0[3pts possible]:<\/p>\n<p>What about John?<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>For the most popular combination of Metaphone with Gender (JN and M), show a list of the most popular names<\/p>\n<p>that match the metaphone.<\/p>\n<p>Name \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Total Babies<\/p>\n<p>&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>John \u00a0\u00a0\u00a0\u00a0\u00a0\u00a04712974<\/p>\n<p>Juan \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0331865<\/p>\n<p>Johnny \u00a0\u00a0\u00a0\u00a0305889<\/p>\n<p>Jon \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0164821<\/p>\n<p>Gene \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0124121<\/p>\n<p>Johnnie \u00a0\u00a0\u00a093336<\/p>\n<p>Jonah \u00a0\u00a0\u00a0\u00a0\u00a054315<\/p>\n<p>Jean \u00a0\u00a0\u00a0\u00a0\u00a0\u00a022359<\/p>\n<p>Jan \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a021534<\/p>\n<p>Johnie \u00a0\u00a0\u00a0\u00a017265<\/p>\n<p>Gino \u00a0\u00a0\u00a0\u00a0\u00a0\u00a011250<\/p>\n<p>Gianni \u00a0\u00a0\u00a0\u00a08071<\/p>\n<p>Joan \u00a0\u00a0\u00a0\u00a0\u00a0\u00a05594<\/p>\n<p>&#8230;<\/p>\n<p>Giani \u00a0\u00a0\u00a0\u00a0\u00a0227<\/p>\n<p>Jony \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0216<\/p>\n<p>Jauan \u00a0\u00a0\u00a0\u00a0\u00a0190<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 6 \u00a0[3pts possible]:<\/p>\n<p>Year-by-Year Popularity for JN<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>This time, show a breakdown of the popularity of JN names for M babies.<\/p>\n<p>Your results should contain 100 rows that look like this:<\/p>\n<p>Metaphone \u00a0Year \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Total Babies<\/p>\n<p>&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01915 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a050983<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01916 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a053675<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01917 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a055877<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01918 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a061148<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01919 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a058457<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01920 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a062319<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01921 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a063521<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01922 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a062980<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01923 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a063395<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01924 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a065348<\/p>\n<p>&#8230;<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02012 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a021925<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02013 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a021402<\/p>\n<p>JN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02014 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a021125<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 7 \u00a0[3pts possible]:<\/p>\n<p>Corey in the House<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>For all years where the total number of both M and F babies named &#8220;Corey&#8221; was 100 or more,<\/p>\n<p>show the name (formatted as 10 characters wide) along with the year and the total number<\/p>\n<p>of babies with that name. Display results in chronological order.<\/p>\n<p>Correct results will have 62 rows formatted as:<\/p>\n<p>Name \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Year \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Total Babies<\/p>\n<p>&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01952 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0117<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01954 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0161<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01955 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0271<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01956 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0313<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01957 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0285<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01958 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0336<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01959 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0351<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01960 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0347<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01961 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0450<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01962 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0485<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01963 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0484<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01964 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0501<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01965 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0544<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01966 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0513<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01967 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0512<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01968 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01668<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a01969 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a05069<\/p>\n<p>&#8230;<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a02012 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0895<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a02013 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0889<\/p>\n<p>Corey \u00a0\u00a0\u00a0\u00a0\u00a02014 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0818<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 8 \u00a0[3pts possible]:<\/p>\n<p>Popular Genres on TV<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>JOIN the SHOW table to the SCHEDULE table.<\/p>\n<p>For each genre, calculate the total minutes spent airing shows in that genre.<\/p>\n<p>Let&#8221;s switch to the TV database for the last three problems. Then, calculate the total<\/p>\n<p>percent of time dedicated to that genre. Show the genre formatted to 20 characters wide,<\/p>\n<p>the total number of minutes, and the percentage of minutes. Only include rows where<\/p>\n<p>the total number of minutes was 1000 or more. Display in descending order by total minutes.<\/p>\n<p>In the case of ties, order alphabetically by genre.<\/p>\n<p>Hint: Review the hints and your answer to Question 3. Your calculation of the percentage<\/p>\n<p>will be similar here.<\/p>\n<p>Hint 2: Use DATEDIFF(mi, StartTime, EndTime) to get the total number of minutes that a show<\/p>\n<p>was on. Total minutes will be the sum of those values for all the shows in a particular genre.<\/p>\n<p>Correct results will have 88 rows that look like this:<\/p>\n<p>Genre \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Total Minutes Percent<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;-<\/p>\n<p>Special \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01257851 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a014.33%<\/p>\n<p>Sports non-event \u00a0\u00a0\u00a0\u00a0959388 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.93%<\/p>\n<p>Reality \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0680033 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a07.75%<\/p>\n<p>Children \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0412604 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.70%<\/p>\n<p>Sitcom \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0393738 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.49%<\/p>\n<p>Drama \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0377146 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.30%<\/p>\n<p>Shopping \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0375642 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.28%<\/p>\n<p>Sports event \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0362470 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.13%<\/p>\n<p>Comedy \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0282608 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03.22%<\/p>\n<p>Crime drama \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0247615 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.82%<\/p>\n<p>&#8230;<\/p>\n<p>Baseball \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01200 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.01%<\/p>\n<p>Collectibles \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01200 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.01%<\/p>\n<p>Rodeo \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01200 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.01%<\/p>\n<p>Medical \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01100 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.01%<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>USE TV<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 9 \u00a0[3pts possible]:<\/p>\n<p>0.4% of TV is SpongeBob SquarePants<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Do the same thing as in the previous query, except group by SeriesNum instead of Genre. This time, only show<\/p>\n<p>series where the total minutes is 10,000 or more. Display the Title formatted to be 20 characters wide instead<\/p>\n<p>of the genre.<\/p>\n<p>Add another column for the total number of episodes aired.<\/p>\n<p>Correct results will have 98 rows and look like this:<\/p>\n<p>Title \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Total Minutes Total Episodes Percent<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;-<\/p>\n<p>MLB Extra Innings \u00a0\u00a0\u00a0258240 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0658 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.06%<\/p>\n<p>Paid Programming \u00a0\u00a0\u00a0\u00a0218507 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a07292 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a08.51%<\/p>\n<p>NBA League Pass \u00a0\u00a0\u00a0\u00a0\u00a0103200 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0215 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a04.02%<\/p>\n<p>MLS Direct Kick \u00a0\u00a0\u00a0\u00a0\u00a0100620 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0221 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03.92%<\/p>\n<p>College Football \u00a0\u00a0\u00a0\u00a073575 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0421 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.86%<\/p>\n<p>MLB Baseball \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a069510 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0390 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.71%<\/p>\n<p>Programa Pagado \u00a0\u00a0\u00a0\u00a0\u00a054940 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01792 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02.14%<\/p>\n<p>SIGN OFF \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a043025 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0119 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.68%<\/p>\n<p>SportsCenter \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a036580 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0596 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01.42%<\/p>\n<p>Public Affairs Event 24362 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a093 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.95%<\/p>\n<p>To Be Announced \u00a0\u00a0\u00a0\u00a0\u00a023770 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0161 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.93%<\/p>\n<p>2017 U.S. Open Tenni 23520 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a098 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.92%<\/p>\n<p>Law &amp; Order \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a022727 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0379 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.88%<\/p>\n<p>Forensic Files \u00a0\u00a0\u00a0\u00a0\u00a0\u00a022140 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0738 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.86%<\/p>\n<p>&#8230;<\/p>\n<p>SpongeBob SquarePant 10295 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0353 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.40%<\/p>\n<p>Politics and Public \u00a010186 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a060 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.40%<\/p>\n<p>SEC Now \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010080 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0174 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.39%<\/p>\n<p>Keeping Up With the \u00a010080 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0172 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00.39%<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>PRINT &#8216;CIS 275, Lab Week 4, Question 10 \u00a0[3pts possible]:<\/p>\n<p>Everything is Repeats<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>For the entire schedule, calculate the total number of distinct shows aired and the<\/p>\n<p>total number of shows aired. The difference in these two numbers is the total number of<\/p>\n<p>repeats. Show all three values as a single row, along with the percentage of shows that<\/p>\n<p>are repeats.<\/p>\n<p>Note: If you look in the messages pane, you might see a warning like the following:<\/p>\n<p>\tWarning: Null value is eliminated by an aggregate or other SET operation.<\/p>\n<p>Eliminate this warning by only including rows where FK_ShowID isn&#8221;t NULL.<\/p>\n<p>(The results say that 75% of TV is repeats, but it&#8221;s even worse than that, because we&#8221;re\u00a0<\/p>\n<p>counting the first airing of a show in this 2 week period as an original broadcast, even\u00a0<\/p>\n<p>though many of them are repeats from previous weeks).<\/p>\n<p>Correct results should look like this:<\/p>\n<p>Distinct Shows Total Shows Repeats \u00a0\u00a0\u00a0\u00a0Percent of Repeats<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>35183 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0138286 \u00a0\u00a0\u00a0\u00a0\u00a0103103 \u00a0\u00a0\u00a0\u00a0\u00a074.56%<\/p>\n<p>&#8216; + CHAR(10)<\/p>\n<p>GO<\/p>\n<p>&#8212;<\/p>\n<p>&#8212; [Insert your code here]<\/p>\n<p>&#8212;<\/p>\n<p>GO<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>&#8212; This is an anonymous program block. DO NOT CHANGE OR DELETE.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>BEGIN<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0PRINT &#8216;|&#8212;&#8216; + REPLICATE(&#8216;+&#8212;-&#8216;,15) + &#8216;|&#8217;;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0PRINT &#8216; End of CIS275 Lab Week 4&#8217; + REPLICATE(&#8216; &#8216;,50) + CONVERT(CHAR(12),GETDATE(),101);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0PRINT &#8216;|&#8212;&#8216; + REPLICATE(&#8216;+&#8212;-&#8216;,15) + &#8216;|&#8217;;<\/p>\n<p>END;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>*\/ GO PRINT &#8216;|&#8212;&#8216; + REPLICATE(&#8216;+&#8212;-&#8216;,15) + &#8216;|&#8217; PRINT &#8216;Read the questions below and insert your queries where prompted. \u00a0When \u00a0you are finished, you should be able to run the file as a script to execute all answers sequentially (without errors!)&#8217; + CHAR(10) PRINT &#8216;Queries should be well-formatted. \u00a0SQL is not case-sensitive, but it is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-7224","post","type-post","status-publish","format-standard","hentry","category-homework-help"],"_links":{"self":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/7224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/comments?post=7224"}],"version-history":[{"count":0,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/7224\/revisions"}],"wp:attachment":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/media?parent=7224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/categories?post=7224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/tags?post=7224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}