Skip to content
Snippets Groups Projects
table.sql 842 B
Newer Older
Create TABLE IF NOT EXISTS genre 
(
    idGen Int not null primary key, 
    nom varchar(20)
);

Create TABLE IF NOT EXISTS film 
(
    tconst varchar(20) not null primary key,
    primaryTitle varchar(100),
    isAdult int,
    startYear int,
    runtimeMinutes int,
    averageRating float,
    numVotes int,
    titleFR varchar(250)
);

Create TABLE IF NOT EXISTS Utilisateur
(
    login varchar(20) not null primary key,
    nom varchar(20) not null,
    prenom varchar(20) not null,
    mdp varchar(30) not null,
    dateNais date not null default (current_date)

);



Create TABLE if not EXISTS FilmVue
(
    login varchar(20) not null,
    tconst varchar(20) not null,
    note int default (3),
    FOREIGN KEY (login) REFERENCES Utilisateur(login),
    FOREIGN KEY (tconst) REFERENCES film(tconst), 
    PRIMARY KEY (login,tconst)
)