This SQL script sets up a database for managing music-related data. It includes tables for listeners, content creators, songs, reviewers, and reviews. It also creates several views and stored procedures to interact with the data.
-
Database Creation
- Drops existing
MusicDataBase
if it exists and creates a new one.
- Drops existing
-
Table Definitions
- Listener: Stores user information for listeners.
- contentCreator: Stores details of music content creators.
- Song: Stores song details including title, type, and release date.
- Reviewer: Stores reviewer details.
- Review: Stores reviews for songs including review content and score.
-
Data Insertion
- Inserts sample data into each table.
-
Views
listenerView
: Shows listener names and details.contentCreatorView
: Shows content creator details.reviewAndReviewer
: Joins review data with reviewer and song information.
-
Stored Procedures
findArtist
: Finds an artist by stage name.findPositiveReviewsToMakeMeFeelBetter
: Finds positive reviews for a specific song.