Microsoft Windows [version 10.0.22000.
978]
(c) Microsoft Corporation. Tous droits réservés.
C:\Users\KREME>sqlplus
SQL*Plus: Release [Link].0 - Production on Ven. Sept. 30 [Link] 2022
Version [Link].0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Entrez le nom utilisateur : system/l2miageb
Heure de la derniÞre connexion rÚussie : Mer. Mai 18 2022 [Link] +00:00
ConnectÚ Ó :
Oracle Database 21c Express Edition Release [Link].0 - Production
Version [Link].0
SQL> show database
SP2-0158: option SHOW inconnue "database"
SQL> create user c##vente identified by l2miageb;
Utilisateur crÚÚ.
SQL> gant dba to c##vente;
SP2-0734: commande inconnue au dÚbut de "gant dba t..." - le reste de la ligne est
ignorÚ.
SQL> grant dba to c##vente;
Autorisation de privilÞges (GRANT) acceptÚe.
SQL> disconect
SP2-0042: commande inconnue "disconect" - reste de la ligne ignorÚ.
SQL> disconnect
DÚconnectÚ de Oracle Database 21c Express Edition Release [Link].0 - Production
Version [Link].0
SQL> connect
Entrez le nom utilisateur : c##vente
Entrez le mot de passe :
ConnectÚ.
SQL> select uer name from dual
2 ;
select uer name from dual
*
ERREUR Ó la ligne 1 :
ORA-00904: "UER" : identificateur non valide
SQL> c##vente/l2miageb@xe
1* vente/l2miageb@xeselect uer name from dual
SQL> c##vente/l2miageb@xe;
1* vente/l2miageb@xevente/l2miageb@xeselect uer name from dual
SQL> select user name from dual
2 ;
NAME
--------------------------------------------------------------------------------
C##VENTE
SQL> @c:\[Link]
SP2-0310: impossible d'ouvrir le fichier "c:\
[Link]"
SQL> @ c:\[Link]
SP2-0310: impossible d'ouvrir le fichier "c:\
[Link]"
SQL> @ c:\[Link]
SQL> -- Script Oracle SQL*plus de creation du schema VentesPleinDeFoin
SQL> -- Version sans accents
SQL>
SQL> -- Creation des tables
SQL> SET ECHO ON
SQL> CREATE TABLE Client
2 (noClient INTEGER NOT NULL,
3 nomClient VARCHAR(20) NOT NULL,
4 noTelephone VARCHAR(15) NOT NULL,
5 PRIMARY KEY (noClient)
6 )
7 /
Table crÚÚe.
SQL> CREATE TABLE Article
2 (noArticle INTEGER NOT NULL,
3 description VARCHAR(20),
4 prixUnitaire DECIMAL(10,2) NOT NULL,
5 quantiteEnStock INTEGER DEFAULT 0 NOT NULL
6 CHECK (quantiteEnStock >= 0),
7 PRIMARY KEY (noArticle))
8 /
Table crÚÚe.
SQL> CREATE TABLE Commande
2 (noCommande INTEGER NOT NULL,
3 dateCommande DATE NOT NULL,
4 noClient INTEGER NOT NULL,
5 PRIMARY KEY (noCommande),
6 FOREIGN KEY (noClient) REFERENCES Client
7 )
8 /
Table crÚÚe.
SQL> CREATE TABLE LigneCommande
2 (noCommande INTEGER NOT NULL,
3 noArticle INTEGER NOT NULL,
4 quantite INTEGER NOT NULL
5 CHECK (quantite > 0),
6 PRIMARY KEY (noCommande, noArticle),
7 FOREIGN KEY (noCommande) REFERENCES Commande,
8 FOREIGN KEY (noArticle) REFERENCES Article
9 )
10 /
Table crÚÚe.
SQL> CREATE TABLE Livraison
2 (noLivraison INTEGER NOT NULL,
3 dateLivraison DATE NOT NULL,
4 PRIMARY KEY (noLivraison)
5 )
6 /
Table crÚÚe.
SQL> CREATE TABLE DetailLivraison
2 (noLivraison INTEGER NOT NULL,
3 noCommande INTEGER NOT NULL,
4 noArticle INTEGER NOT NULL,
5 quantiteLivree INTEGER NOT NULL
6 CHECK (quantiteLivree > 0),
7 PRIMARY KEY (noLivraison, noCommande, noArticle),
8 FOREIGN KEY (noLivraison) REFERENCES Livraison,
9 FOREIGN KEY (noCommande, noArticle) REFERENCES LigneCommande
10 )
11 /
Table crÚÚe.
SQL> INSERT INTO Client
2 VALUES(10,'Luc Sansom','(999)999-9999')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Client
2 VALUES(20,'Dollard Tremblay','(888)888-8888')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Client
2 VALUES(30,'Lin Bo','(777)777-7777')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Client
2 VALUES(40,'Jean Leconte','(666)666-6666')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Client
2 VALUES(50,'Hafed Alaoui','(555)555-5555')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Client
2 VALUES(60,'Marie Leconte','(666)666-6666')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Client
2 VALUES(70,'Simon Lecoq','(444)444-4419')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Client
2 VALUES(80,'Dollard Tremblay','(333)333-3333')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(10,'Cedre en boule',10.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(20,'Sapin',12.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(40,'Epinette bleue',25.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(50,'Chene',22.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(60,'Erable argente',15.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(70,'Herbe Ó puce',10.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(80,'Poirier',26.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(81,'Catalpa',25.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(90,'Pommier',25.99,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Article
2 VALUES(95,'Genevrier',15.99,10)
3 /
1 ligne crÚÚe.
SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY'
2 /
Session modifiÚe.
SQL> INSERT INTO Commande
2 VALUES(1,'01/06/2000',10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Commande
2 VALUES(2,'02/06/2000',20)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Commande
2 VALUES(3,'02/06/2000',10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Commande
2 VALUES(4,'05/07/2000',10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Commande
2 VALUES(5,'09/07/2000',30)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Commande
2 VALUES(6,'09/07/2000',20)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Commande
2 VALUES(7,'15/07/2000',40)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Commande
2 VALUES(8,'15/07/2000',40)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(1,10,10)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(1,70,5)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(1,90,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(2,40,2)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(2,95,3)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(3,20,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(4,40,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(4,50,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(5,70,3)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(5,10,5)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(5,20,5)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(6,10,5)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(6,40,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(7,50,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO LigneCommande
2 VALUES(8,20,3)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Livraison
2 VALUES(100,'03/06/2000')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Livraison
2 VALUES(101,'04/06/2000')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Livraison
2 VALUES(102,'04/06/2000')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Livraison
2 VALUES(103,'05/06/2000')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Livraison
2 VALUES(104,'07/07/2000')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO Livraison
2 VALUES(105,'08/07/2000')
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(100,1,10,7)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(100,1,70,5)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(101,1,10,3)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(102,2,40,2)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(102,2,95,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(100,3,20,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(103,1,90,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(104,4,40,1)
3 /
1 ligne crÚÚe.
SQL> INSERT INTO DetailLivraison
2 VALUES(105,5,70,2)
3 /
1 ligne crÚÚe.
SQL> COMMIT
2 /
Validation effectuÚe.
SQL> select * from tab;
TNAME
--------------------------------------------------------------------------------
TABTYPE CLUSTERID
------------- ----------
CLIENT
TABLE
ARTICLE
TABLE
COMMANDE
TABLE
TNAME
--------------------------------------------------------------------------------
TABTYPE CLUSTERID
------------- ----------
LIGNECOMMANDE
TABLE
LIVRAISON
TABLE
DETAILLIVRAISON
TABLE
6 lignes sÚlectionnÚes.
SQL> desc client
Nom NULL ? Type
----------------------------------------- -------- ----------------------------
NOCLIENT NOT NULL NUMBER(38)
NOMCLIENT NOT NULL VARCHAR2(20)
NOTELEPHONE NOT NULL VARCHAR2(15)
SQL> desc commande
Nom NULL ? Type
----------------------------------------- -------- ----------------------------
NOCOMMANDE NOT NULL NUMBER(38)
DATECOMMANDE NOT NULL DATE
NOCLIENT NOT NULL NUMBER(38)
SQL> desc lignecommande
Nom NULL ? Type
----------------------------------------- -------- ----------------------------
NOCOMMANDE NOT NULL NUMBER(38)
NOARTICLE NOT NULL NUMBER(38)
QUANTITE NOT NULL NUMBER(38)
SQL>