CREATE DATABASE gestion



CREATE TABLE restaurants (

    id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,

    nom  VARCHAR(50),   

    rue VARCHAR(255),

    cp INT(5),

    ville VARCHAR(50),

    email VARCHAR(50),

    tel VARCHAR(12),

	id_gerant INT(3)

    );

	

CREATE TABLE gerants (

    id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,

    nom VARCHAR(50),

    prenom VARCHAR(50),

    email VARCHAR(50),

    tel VARCHAR(12)

    );

	

INSERT INTO restaurants

    (nom,rue,cp,ville,email,tel)

VALUES (

    "Chez Momo",

    "3 rue des cigales",

    13005,

    "Marseille",

    "chezmomo@sfr.fr",

    "+33401020304");

	

UPDATE 

    restaurants 

SET 

    email = "chezmomo@free.fr" 

WHERE 

    id = 1;



INSERT INTO gerants

    (nom,prenom,email,tel)

VALUES 	

	('DUPONT', 'Jean', 'dupont.jean@sfr.fr', '+33625232521'), 

	('DURAND', 'Pierre', 'pierre.durand@free.fr', '+33685652532');