-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercicio02.txt
56 lines (29 loc) · 1.11 KB
/
exercicio02.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
create database album;
use album;
create table musica(
idMusica int primary key auto_increment,
nome varchar (30),
artista varchar (30),
genero varchar (30)
);
insert into musica value
(null, 'sorrisos', 'l7nnon', 'hip-hop', 01),
(null, 'avareza', 'xamã', 'rap', 02),
(null, 'invicto', 'filipe ret', 'hip-hop/rap', 03),
(null, 'pico loco', 'adz', 'dance', 04);
select * from musica;
create table album (
idAlbum int primary key auto_increment,
nome varchar (30),
gravadora varchar (30)
);
insert into album value
(null, 'podium', 'warner music'),
(null, 'pecado capital', 'baguá records'),
(null, 'revel', 'TUDUBOM RECORDS'),
(null, 'minhas tracks', 'MM Music'),
(null, 'melophobia', 'RCA Records');
select * from album;
alter table musica add column fk_album int;
select * from musica as m, album as a where m.fk_Album = 1 and a.nome = 'podium';
select * from musica as m, album as a where m.fk_Album = idAlbum and a.gravadora = 'warner music';