Re: Dividing a count by another count
I can't hard copy "Show Create Table" results but i can show you how i write my table "loan" and my table "customer",
CREATE TABLE EMPRUNT(
code_emprunt int PRIMARY KEY,
date_empunt date NOT NULL,
date_retour date NOT NULL,
code_matricule int NOT NULL,
code_localisation int NOT NULL,
CONSTRAINT ABONNE_EMPRUNT_FK FOREIGN KEY (code_matricule) REFERENCES ABONNE (code_matricule)
CONSTRAINT EXEMPLAIRE_EMPRUNT_FK FOREIGN KEY (code_localisation) REFERENCES EXEMPLAIRE (code_localisation)
;
CREATE TABLE ABONNE(
code_matricule int PRIMARY KEY,
nom varchar (50) NOT NULL,
prenom varchar (50) NOT NULL,
adresse varchar (100) NOT NULL,
num_tel varchar (13) NOT NULL,
date_adhesion date NOT NULL,
date_naissance date NOT NULL,
cat_pro varchar (50) NOT NULL
);