1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| set server server1;
create database CLIENTS;
connect CLIENTS sysadm/sysadm;
CREATE TABLE societe (
num_soc NUMBER,
nom_soc CHAR(50),
adresse_soc CHAR(60),
ville_soc CHAR(20),
cp_soc CHAR(5),
tel_soc CHAR(15),
email_soc CHAR(60),
fax_soc CHAR(15),
PRIMARY KEY (num_soc));
CREATE TABLE contacts (
num_cont NUMBER,
nom_cont CHAR(30),
pre_cont CHAR(20),
mail_cont CHAR(60),
tel_cont CHAR(15),
fax_cont CHAR(15),
num_soc NUMBER,
PRIMARY KEY (num_cont));
ALTER TABLE contacts
FOREIGN num_cont (num_soc)
REFERENCES societe
ON DELETE SET NULL; |
Partager