Vous êtes sur la page 1sur 3

SQL> alter table etudiant add( email varchar(20) unique);

Table modifiée.

SQL> desc etudiant;


Nom NULL ? Type
----------------------------------------- -------- ------------------
----------
N_ETUDIANT NOT NULL VARCHAR2(20)
NOM NOT NULL VARCHAR2(20)
PRENOM NOT NULL VARCHAR2(20)
VILLE VARCHAR2(20)
FILIERE VARCHAR2(10)
EMAIL VARCHAR2(20)

SQL> alter table etudiant modify(prenom varchar(30));

Table modifiée.

SQL> desc etudiant;


Nom NULL ? Type
----------------------------------------- -------- ------------------
----------
N_ETUDIANT NOT NULL VARCHAR2(20)
NOM NOT NULL VARCHAR2(20)
PRENOM NOT NULL VARCHAR2(30)
VILLE VARCHAR2(20)
FILIERE VARCHAR2(10)
EMAIL VARCHAR2(20)

SQL> alter table evaluer add constraint note_check ( note between 0


and 20 );
alter table evaluer add constraint note_check ( note between 0 and 20
)
*
ERREUR à la ligne 1 :
ORA-00904: : identificateur non valide

SQL> alter table evaluer add constraint note_check ( note_check


between 0 and 20 );
alter table evaluer add constraint note_check ( note_check between 0
and 20 )
*
ERREUR à la ligne 1 :
ORA-00904: : identificateur non valide

SQL> alter table evaluer add constraint note_check check ( note


between 0 and 20 );

Table modifiée.

SQL> alter table matiere rename column coeffmat to coefficient;

Table modifiée.
SQL> desc matiere;
Nom NULL ? Type
----------------------------------------- -------- ------------------
----------
CODEMAT NOT NULL VARCHAR2(10)
LIBELLEMAT VARCHAR2(10)
COEFFICIENT NUMBER(1)

SQL> alter table etudiant drop date_eva;


alter table etudiant drop date_eva
*
ERREUR à la ligne 1 :
ORA-00905: mot-clé absent

SQL> alter table evaluer drop column date_eva;

Table modifiée.

SQL> alter table etudiant drop column filiere ;

Table modifiée.

SQL> desc etudiant;


Nom NULL ? Type
----------------------------------------- -------- ------------------
----------
N_ETUDIANT NOT NULL VARCHAR2(20)
NOM NOT NULL VARCHAR2(20)
PRENOM NOT NULL VARCHAR2(30)
VILLE VARCHAR2(20)
EMAIL VARCHAR2(20)

SQL> create table etudiant2 as select n_etudiant , ville from etudiant


;

Table créée.

SQL> desc etudiant2


Nom NULL ? Type
----------------------------------------- -------- ------------------
----------
N_ETUDIANT VARCHAR2(20)
VILLE VARCHAR2(20)

SQL> alter table rename etudiant2 to student ;


alter table rename etudiant2 to student
*
ERREUR à la ligne 1 :
ORA-00903: nom de table non valide

SQL> rename etudiant2 to student ;

Table renommée.
SQL> drop table student;

Table supprimée.

SQL> desc student;


ERROR:
ORA-04043: objet student inexistant

SQL> spool off ;

Vous aimerez peut-être aussi