Music Shop

Слайд 2

Существующие таблицы

create table Albums(album_id int, album_name varchar(20), singer_name varchar(20), primary key(album_id))
create table

Существующие таблицы create table Albums(album_id int, album_name varchar(20), singer_name varchar(20), primary key(album_id))
Singers(singer_id int, singer_name varchar(20), genre varchar(20), primary key(singer_id))
create table Sales(singer_id int, album_id int, primary key(singer_id, album_id), foreign key(album_id) references Albums, foreign key(singer_id) references Singers)
alter table Sales add count_of_sold_albums int
create table Shop(singer_id int, album_id int, available int, primary key(album_id), foreign key(album_id) references Albums)
create table Studios(singer_id int, album_id int, label_name varchar(20), primary key(album_id), foreign key(album_id) references Albums)
create table Singles(singer_id int, album_id int, single_name varchar(20), foreign key(singer_id) references Singers, foreign key(album_id) references Albums)

Слайд 3

Существующие отношения

1:1
1:М
М:М

Существующие отношения 1:1 1:М М:М

Слайд 5

М:М

insert into Albums values(0011, 'Parachutes', 'Coldplay')
insert into Albums values(0018, 'Ghost Stories', 'Coldplay')
insert

М:М insert into Albums values(0011, 'Parachutes', 'Coldplay') insert into Albums values(0018, 'Ghost
into Albums values(0022, 'Songs About Jane', 'Maroon 5')
insert into Albums values(0027, 'Red Pill Blues', 'Maroon 5')
insert into Albums values(0033, 'ANTI', 'Rihanna')
insert into Albums values(0036, 'Loud', 'Rihanna')
insert into Singers values(1100, 'Coldplay', 'Britpop-Rock')
insert into Singers values(2200, 'Maroon 5', 'Pop-Rock')
insert into Singers values(3300, 'Rihanna', 'R 'n’ B')
insert into Sales values(1100, 0011, 100)
insert into Sales values(1100, 0018, 80)
insert into Sales values(2200, 0022, 200)
insert into Sales values(2200, 0027, 180)
insert into Sales values(3300, 0033, 230)
insert into Sales values(3300, 0036, 210)

Слайд 8

1:1

insert into Shop values(1100, 0011, 0)
insert into Shop values(1100, 0018, 1)
insert into

1:1 insert into Shop values(1100, 0011, 0) insert into Shop values(1100, 0018,
Shop values(2200, 0022, 1)
insert into Shop values(2200, 0027, 1)
insert into Shop values(3300, 0033, 0)
insert into Shop values(3300, 0036, 0)
insert into Studios values(1100, 0011, 'Parlaphone')
insert into Studios values(1100, 0018, 'Parlaphone')
insert into Studios values(2200, 0022, 'Rumbo Recorders')
insert into Studios values(2200, 0027, 'Conway Recording')
insert into Studios values(3300, 0033, 'Conway Recording')
insert into Studios values(3300, 0036, 'Parlaphone')

Слайд 11

1:M

insert into Singles values(1100, 0011, 'Yellow')
insert into Singles values(1100, 0011, 'Sparks')
insert into

1:M insert into Singles values(1100, 0011, 'Yellow') insert into Singles values(1100, 0011,
Singles values(2200, 0027, 'Girls Like You')
insert into Singles values(2200, 0027, 'Wait')
insert into Singles values(3300, 0033, 'Kiss it Better')
insert into Singles values(3300, 0033, 'Love on The Brain')
Имя файла: Music-Shop.pptx
Количество просмотров: 39
Количество скачиваний: 0