• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 1 pages
Summary

Résumé Fiche des essentiels du SQL2

Document preview thumbnail
Preview 1 out of 1 pages

Fiche des essentiels du SQL2

Content preview

ORDRES DU LANGAGES
CREATE TABLE nomT CREATE TABLE tsclients
( liste attributs , (
Avec domaine [contrainte], id_clients CHAR(6) CONSTRAINT pk_tsclients PRIMARY KEY,
) code_civilite CHAR(2) CONSTRAINT fk_tscivilite REFERENCES tscivilite(id_civil),
CHAR(n) /* Longueur fixe nom VARCHAR(25) NOT NULL,
Construction de la BD

VARCHAR(n) /* Longueur variable date_naiss DATE,
CLOB /* >255 caractères cp CHAR(5) NOT NULL,
NUMERIC(n) /* Pour les entiers ville VARCHAR(25) NOT NULL,
NUMERIC (nbtot, nbapvirg) /* Pour les décimaux email VARCHAR(25) UNIQUE,
DATE note NUMERIC(3,1),
DATE TIME quantite NUMERIC(2),
PRIMARY KEY pk_ reduc NUMERIC(3,2) CONSTRAINT ck_tauxreduc CHECK reduc BETWEEN 0 AND 3
FOREIGN KEY fk_ )

ALTER TABLE nomT
ALTER TABLE tclient
ADD nouvel attribut + domaine [+Ci] /* Ajout attribut
ADD datenaiss DATE
MODIFY attr concerné + modif /* Modif attribut
MODIFY nom VARCHAR(10)
ADD CONSTRAINT nomC + contrainte /* Ajout contrainte
ADD CONSTRAINT ck_controleacces CHECK (codesecu IN (6, 7))
DROP CONSTRAINT nomC /* Suppr une contrainte
DROP COLUMN nomattribut /* Suppr un attribut

DROP TABLE nomT DROP TABLE tbenefice
INSERT INTO nomT INSERT INTO tnotes
Manipulation des




VALUES ( ) VALUES (‘mat01’, 1, 17, NULL, 0.4)
INSERT INTO nom (listattr) INSERT INTO tnotes (idmat, idnote, note, coeff)
données




VALUES ( ) VALUES (‘mat01’, 2, 16, 0.5)
UPDATE nomT UPDATE tproduits
SET nomA1 = valeur ou formule [, autre modification] SET pachat = pachat +1, pvente = pvente +1
[WHERE condition] WHERE origine != ‘France’
DELETE FROM tnotes
DELETE FROM nomT
WHERE idmat = ‘mat01’
[WHERE…]
AND idnote = 2
COMMIT Permet de valider une transaction
√ X Permet d’annuler un ensemble d’ordre SQL en cours
ROLLBACK
Cela permet d’enlever les données en instance d’enregistrement
GRANT SELECT, UPDATE, DELETE, INSERT, ALL
GRANT INSERT
Gestion des




ON nomT
ON tanimal
TO user1, user2, PUBLIC
droits




TO bd111
[WITH GRANT OPTION]

REVOKE S, U, D, I, A REVOKE INSERT
ON nomT ON tanimal
FROM user FROM bd111

Document information

Study
Uploaded on
March 29, 2023
Number of pages
1
Written in
2021/2022
Type
Summary
$3.94

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
14
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions