<< Back to Database Engineering Portfolio

Assignment 1

    write a SQL query to list the names of all songs in the database.

  1. SELECT name FROM songs;
  2. write a SQL query to list the names of all songs in increasing order of tempo.

  3. SELECT name FROM songs ORDER BY tempo ASC;
  4. write a SQL query to list the names of the top 5 longest songs, in descending order of length.

  5. SELECT name FROM songs ORDER BY duration_ms DESC LIMIT 5;
  6. write a SQL query that lists the names of any songs that have danceability, energy, and valence greater than 0.75.

  7. SELECT name FROM songs WHERE valence > 0.75 AND danceability > 0.75 AND energy > 0.75;
  8. write a SQL query that returns the average energy of all the songs

  9. SELECT AVG(energy) AS average_energy FROM songs;
  10. write a SQL query that lists the names of the songs that feature other artists.

  11. SELECT name FROM songs WHERE name LIKE '%feat%';