0% found this document useful (0 votes)
7 views2 pages

Exercise 9

The document defines tables for genres and songs in a database. Genres like rock, jazz, EDM are defined with descriptions. Songs are then inserted with attributes like name, year, genre and status.

Uploaded by

zcftrccr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Exercise 9

The document defines tables for genres and songs in a database. Genres like rock, jazz, EDM are defined with descriptions. Songs are then inserted with attributes like name, year, genre and status.

Uploaded by

zcftrccr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE DATABASE Exercise9

GO

USE Exercise9
GO

CREATE TABLE Genre (


[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](256) NOT NULL,
[Description] [nvarchar](max) NOT NULL,
PRIMARY KEY ([Id])
)
GO

SET IDENTITY_INSERT Genre ON


GO

INSERT INTO Genre (Id, [Name], [Description])


VALUES
(1, 'Rock', 'Otherwise known as ‘Rock & Roll,’ rock music has been a popular
genre since the early 1950s.'),
(2, 'Jazz', 'Identifiable with blues and swing notes, Jazz has origins in
European and West African culture.'),
(3, 'Electronic Dance Music', 'Typically referred to as EDM, this type of music
is created by DJs who mix a range of beats and tones to create unique music.'),
(4, 'Dubstep', 'Dubstep is an electronic dance music subgenre that originated in
the late 1990s’ in South London.'),
(5, 'Techno', 'Techno is yet another sub-genre of electronic dance music. This
genre became popular in Germany towards the end of the 1980s and was heavily
influenced by house music, funk, synthpop, and futuristic fiction.'),
(6, 'Rhythm and Blues (R&B)', 'R & B is one of the world’s top music genres
combining gospel, blues, and jazz influences.'),
(7, 'Country', 'Country music is another one of the world’s top music genres.
Originating in the 1920s, Country has its roots in western music and American
folk.'),
(8, 'Pop', 'The term ‘Pop’ is derived from the word ‘popular.’ Therefore, Pop
music is a genre that contains music generally favored throughout society.'),
(9, 'Indie Rock', 'In terms of genre, Indie Rock lies somewhere between pop music
and rock and roll.'),
(10, 'Electro', 'Electro blends electronic music and hip hop to create music that
is similar to disco in sound.')
GO

SET IDENTITY_INSERT Genre OFF


GO

CREATE TABLE Song (


Id int NOT NULL IDENTITY (1, 1),
[Name] nvarchar(256) NOT NULL,
[Year] int NULL,
GenreId int NOT NULL,
DeletedAt datetime2(7) NULL,
CONSTRAINT PK_Song
PRIMARY KEY (Id),
CONSTRAINT FK_Song_Genre
FOREIGN KEY(GenreId)
REFERENCES dbo.Genre (Id)
)
SET IDENTITY_INSERT Song ON
GO

INSERT INTO Song (Id, [Name], [Year], GenreId, DeletedAt)


VALUES
(1, 'A-ha - Take On Me', 1985, 8, NULL),
(2, 'Tina Turner - What''s Love Got to Do with It', 1984, 8, NULL),
(3, 'Van Halen - Jump', 1984, 1, NULL),
(4, 'Franz Ferdinand - Take Me Out', 2004, 9, NULL),
(5, 'DJ Snake - Lean On', 2015, 10, NULL),
(6, 'Louis Armstrong - What a Wonderful World', 1967, 2, NULL),
(7, 'Deleted Song', 1967, 2, '2024-04-27 11:41:00')
GO

SET IDENTITY_INSERT Song OFF


GO

You might also like