SQL Flashcards
verifier contraintes
CHECK (condition)
CHECK (condition)
verifier contraintes
CREATE TABLE nom de la table (nom des champs)
Creer table
Creer table
CREATE TABLE nom de la table (nom des champs)
Declarer cle etrangere
FOREIGN KEY (nom de la cle) REFERENCES nomtable (Nomchamp)
FOREIGN KEY (nom de la cle) REFERENCES nomtable (Nomchamp)
Declarer cle etrangere
Declarer cle primaire
PRIMARY KEY (nom du champ)
PRIMARY KEY (nom du champ)
Declarer cle primaire
modifier structure table
ALTER TABLE nomtable typemodif nomduchamp (type, contrainte)
ALTER TABLE nomtable typemodif nomduchamp (type, contrainte)
modifier structure table
ALTER TABLE nomtable ADD COLUMN nomchamp (type, contrainte)
Ajouter une colonne
Ajouter une colonne
ALTER TABLE nomtable ADD COLUMN nomchamp (type, contrainte)
supprimer une colonne
ALTER TABLE nomtable DROP COLUMN nomchamp
ALTER TABLE nomtable DROP COLUMN nomchamp
supprimer une colonne
Ajouter une contrainte
ALTER TABLE nomtable ADD CONSTRAINT NomChamp contrainte
ALTER TABLE nomtable ADD CONSTRAINT NomChamp contrainte
Ajouter une contrainte