2. SQL (30 Pts) Based on the following DB: Performers Cname, genre) Nominations
ID: 3738881 • Letter: 2
Question
2. SQL (30 Pts) Based on the following DB: Performers Cname, genre) Nominations (name, category, year, is_winner Performers Grammy_Nominations genre Rock A&B; Rock A&B; Rock name is_winner category New Artist Rock Performance Album of the Year year 2013 2013 2013 2013 2013 2009 2009 2012 2013 Arizona Shakes Arizona Shakes Frank Ocean Frank Ocean Arizona Shakes Frank Ocean The Black Keys Rock Album Album of the Year Rock Performance Rock Performance The Black Keys yes 1) Write a SQL query to find out how many Rock performers. (4 Pts) COUNT(*)Explanation / Answer
Answer: SELECT COUNT(*) FROM Performers WHERE genre="Rock";
The COUNT(col_nmae) function is used to get the count of values of the specified column. But we don't require the specific column's value count. So, we use COUNT(*) which simply gives the count of the records in the DB.
Moreover, for refining the count to only the Rock Performers, we need to add a WHERE clause and include the condition- WHERE genre="Rock".
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.