create table produit(idro char(6) primary key,nom char(30) not null unique,marque…
Jump to turn (13)
- 1create table produit(idro char(6) primary key,nom char(30) not null unique,marqu
- 21 create table produit(idpro char(6) primary key,nom char(30) not null unique,ma
- 3smallint?
- 4constraint checkmarque check (marque <> 'ibm' or qstock < 10)
- 5create table vente(idcli char(4) not null references client,idpro char(6) not nu
- 6SQL> / CONSTRAINT fkventeproduit FOREIGN KEY (idpro) REFERENCES produit ON DELET
- 7QL> / CONSTRAINT fkventeproduit FOREIGN KEY (idpro) REFERENCES produit(idpro) ON
- 8SQL> / idpro CHAR(6) NOT NULL foreign key(idpro)reference produit(idpro) ON DELE
- 9idpro CHAR(6) NOT NULL REFERENCES produit(idpro) ON( DELETE CASCADE ON UPDATE CA
- 10QL> / create table vente(idcli char(10) not null references client,idpro char(6)
- 111 cREATE TABLE vente ( 2 idcli CHAR(10) NOT NULL REFERENCES client, 3 idpro CHAR
- 121 CREATE TABLE vente ( 2 idcli CHAR(10) NOT NULL REFERENCES client, 3 idpro CHAR
- 13SQL> alter table vente add constraint fkvente foreign key(idpro) references prod
- User
create table produit(idro char(6) primary key,nom char(30) not null unique,marque char(30) ,prix dec(6,2),qstock smallint check(qstock between 0 and 100),constraint check_marque check(marque<>'ibm'or qstock<10))) /
- Assistant
The SQL statement provided is creating a table named "produit" with the following columns:
- "idro" as char(6) as the primary key
- "nom" as char(30) as not null and unique
- "marque" as char(30)
- "prix" as dec(6,2)
- "qstock" as smallint with a check constraint that ensures the value is between 0 and 100
- "check_marque" as a check constraint that checks if "marque" is not equal to 'ibm' or "qstock" is less than 10
The statement ends with a semicolon to indicate the end of the SQL statement.
- User