-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtables.sql
More file actions
37 lines (29 loc) · 981 Bytes
/
tables.sql
File metadata and controls
37 lines (29 loc) · 981 Bytes
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
-- Active: 1676582098331@@35.226.146.116@3306@jbl-4416547-ricardo-morais
### Query que cria a tabela de Bandas
CREATE TABLE IF NOT EXISTS Bands_Name (
id VARCHAR(255) PRIMARY KEY,
name VARCHAR(255) UNIQUE NOT NULL,
music_genre VARCHAR(255) NOT NULL,
responsible VARCHAR(255) UNIQUE NOT NULL
);
### Query que cria a tabela de Shows
CREATE TABLE IF NOT EXISTS Table_Shows (
id CHAR(36) NOT NULL PRIMARY KEY,
week_day VARCHAR(30) NOT NULL,
start_time TIME(0) NOT NULL,
end_time TIME(0) NOT NULL,
band_id CHAR(36) NOT NULL,
FOREIGN KEY(band_id) REFERENCES Bands_Name(id)
);
### Query que cria tabela de usuários
CREATE TABLE IF NOT EXISTS Lama_Users (
id VARCHAR(255) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
role VARCHAR(255) NOT NULL DEFAULT "NORMAL"
);
###
DROP TABLE `Lama_Users`, `Bands_Name`, `Table_Shows`;
###
SELECT * from `Bands_Name`;