Skip to content

aastraa/Data-Visualization-Ass1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 Assignment 1 β€” Spotify Database

πŸ“Œ Project Description

This project imports and analyzes Spotify data using PostgreSQL and Python.
Five CSV files are imported into the database:

  • spotify_artists
  • spotify_albums
  • spotify_tracks
  • spotify_features
  • spotify_data
Screenshot 2025-09-21 at 14 13 16

The data is then analyzed using basic and analytical SQL queries.


πŸ›  Tools Used

  • PostgreSQL β€” Database management system for data storage.
  • Python (psycopg2, pandas) β€” For importing CSV files into the database and executing SQL queries.
  • SQL β€” For data analysis (LIMIT, WHERE + ORDER BY, GROUP BY, JOIN, aggregations).
  • (Optional) Apache Superset β€” For visualization (not required in this project).

πŸš€ How to Run

1️⃣ Install dependencies

# πŸ“¦ Install dependencies
pip install pandas psycopg2

# ▢️ Run the script
python dv.py

# βœ… This will:
- Import CSV data into PostgreSQL
- Execute 4 basic queries
- Execute 10 analytical queries

# πŸ” Queries Implemented

🟒 Basic Queries
- LIMIT β†’ First 10 albums
- WHERE + ORDER BY β†’ Top 20 tracks by popularity
- GROUP BY β†’ Average track popularity by album
- JOIN β†’ Number of tracks per album

πŸ”΅ Analytical Queries
- Top 10 artists by number of followers
- Top albums by total track popularity
- Most energetic tracks
- Top albums by danceability
- Distribution of track duration (0–10 minutes)
- Fast and popular tracks (tempo + popularity)
- Artists ranked by number of tracks
- Top explicit tracks by popularity
- Number of tracks by release year
- Average energy by release year

πŸ“‚ Project Structure
πŸ“¦ Assignment 1 - Spotify Database  
β”œβ”€β”€ dv.py            # Main Python script (import + queries)  
β”œβ”€β”€ queries.sql      # Collection of SQL queries  
β”œβ”€β”€ Assignment1.pdf  # Assignment description  
└── *.csv            # Spotify dataset files  
✨ Done β€” ready to explore Spotify with SQL!  

About

postav'te 100% pls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages