/
Danis_py
/
Advanced_data_sampling
Обзор
Документация
Войти
/
Danis_py
/
Advanced_data_sampling
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Insert1.sql
104 строки
2 KB
Danis_py
upload files
08 дек 2025, 12:15
08 дек 2025, 12:15
f4521d7
Код
Авторство
О чём код?
insert into Genres (genre_id, name) values (1, 'Rock'), (2, 'Rap'), (3, 'Jazz'), (4, 'Pop'), (5, 'Classic'); alter table Artists drop column if exists name; alter table Artists add column first_name varchar(20); alter table Artists add column last_name varchar(20); alter table Artists add column group_name varchar(20); insert into Artists (artist_id, first_name, last_name, group_name) values (1, null, null, 'Linkin park'), (2, 'Billie', 'Holiday', null), (3, 'Snoop', 'Dogg', null), (4, 'Ludwig van', 'Beethoven', null), (5, 'Adriano', 'Celentano', null); update artists set first_name = 'Ludwig' where artist_id = 4; insert into Albums (album_id, name, release_year) values (1, 'Le migliori', 2016), (2, 'Renovation', 2019), (3, 'Neva Left', 2017), (4, 'Stormy Weather', 2001), (5, 'From Zero', 2024); update Albums set name = 'Essential Cello', release_year = 2010 where album_id = 2; update Albums set release_year = 2019 where album_id = 2; insert into Tracks (track_id, album_id, name, duration) values (1, 5, 'Overflow', 221), (2, 5, 'Two Faced', 183), (3, 4, 'My Man', 160), (4, 4, 'Always', 239), (5, 3, 'Neva Left', 307), (6, 3, '420', 265), (7, 2, 'Oblivion', 224), (8, 2, 'Conversa', 223), (9, 1, 'E’ l’amore', 219), (10, 1, 'A un passo da te', 271) -- Добавление треков по доработке insert into Tracks (track_id, album_id, name, duration) values (11, 2, 'myself', 250), (12, 2, 'by myself', 266), (13, 3, 'bemy self', 222), (14, 3, 'myself by', 240), (15, 4, 'by myself by', 288), (16, 4, 'beemy', 236), (17, 5, 'premyne', 278); insert into Collection (collection_id, name, release_year) values (1, 'Sun', 2005), (2, 'Dark', 2017), (3, 'Moon', 2021), (4, 'Ballu', 2025); insert into collection (collection_id, name, release_year) values (5, 'Razer', 2019); insert into Collection_track (coll_tr_id, collection_id, track_id) values (1, 1, 10), (2, 1, 1), (3, 1, 5), (4, 1, 7), (5, 2, 3), (6, 2, 1), (7, 2, 8), (8, 2, 9), (9, 3, 2), (10, 3, 4), (11, 3, 6), (12, 3, 2), (13, 4, 10), (14, 4, 5), (15, 4, 3), (16, 4, 7), (17, 5, 5), (18, 5, 2), (19, 5, 4), (20, 5, 3); insert into Artist_genre (artist_genre_id, artist_id, genre_id) values (1, 1, 1), (2, 2, 3), (3, 3, 2), (4, 3, 4), (5, 4, 5), (6, 5, 1), (7, 5, 3), (8, 5, 4); insert into Artist_album (artist_album_id, artist_id, album_id) values (1, 1, 5), (2, 2, 4), (3, 3, 3), (4, 4, 2), (5, 5, 1);