Skip to content

Commit c8fec69

Browse files
committed
Update - Syntax Style on Songs
1 parent 82a466c commit c8fec69

File tree

8 files changed

+24
-10
lines changed

8 files changed

+24
-10
lines changed

Week 7 - SQL/Lab7/Songs/1.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Write a SQL query to list the names of all songs in the database.
33
Your query should output a table with a single column for the name of each song.
44
*/
55

6-
SELECT name FROM songs;
6+
SELECT name
7+
FROM songs;

Week 7 - SQL/Lab7/Songs/2.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ Write a SQL query to list the names of all songs in increasing order of tempo.
33
Your query should output a table with a single column for the name of each song.
44
*/
55

6-
SELECT name FROM songs
6+
SELECT name
7+
FROM songs
78
ORDER BY tempo;

Week 7 - SQL/Lab7/Songs/3.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Write a SQL query to list the names of the top 5 longest songs, in descending or
33
Your query should output a table with a single column for the name of each song.
44
*/
55

6-
SELECT name FROM songs
6+
SELECT name
7+
FROM songs
78
ORDER BY duration_ms DESC
89
LIMIT 5;

Week 7 - SQL/Lab7/Songs/4.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ Write a SQL query that lists the names of any songs that have danceability, ener
33
Your query should output a table with a single column for the name of each song.
44
*/
55

6-
SELECT name FROM songs
6+
SELECT name
7+
FROM songs
78
WHERE (danceability > 0.75 AND energy > 0.75 AND valence > 0.75);

Week 7 - SQL/Lab7/Songs/5.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Write a SQL query that returns the average energy of all the songs.
33
Your query should output a table with a single column and a single row containing the average energy.
44
*/
55

6-
SELECT AVG(energy) FROM songs;
6+
SELECT AVG(energy)
7+
FROM songs;

Week 7 - SQL/Lab7/Songs/6.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ Your query should output a table with a single column for the name of each song.
44
You should not make any assumptions about what Post Malone’s artist_id is.
55
*/
66

7-
SELECT name FROM songs
8-
WHERE artist_id = (SELECT id FROM artists WHERE name = "Post Malone");
7+
SELECT name
8+
FROM songs
9+
WHERE artist_id = (
10+
SELECT id
11+
FROM artists
12+
WHERE name = "Post Malone");

Week 7 - SQL/Lab7/Songs/7.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ Your query should output a table with a single column and a single row containin
44
You should not make any assumptions about what Drake’s artist_id is.
55
*/
66

7-
SELECT AVG(energy) FROM songs
8-
WHERE artist_id = (SELECT id FROM artists WHERE name = "Drake");
7+
SELECT AVG(energy)
8+
FROM songs
9+
WHERE artist_id = (
10+
SELECT id
11+
FROM artists
12+
WHERE name = "Drake");

Week 7 - SQL/Lab7/Songs/8.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ Songs that feature other artists will include “feat.” in the name of the son
44
Your query should output a table with a single column for the name of each song.
55
*/
66

7-
SELECT name FROM songs
7+
SELECT name
8+
FROM songs
89
WHERE name LIKE "%feat.%";

0 commit comments

Comments
 (0)