-
Notifications
You must be signed in to change notification settings - Fork 0
/
values.sql
178 lines (166 loc) · 8.9 KB
/
values.sql
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS ADHERENT;
DROP TABLE IF EXISTS EMPRUNT;
DROP TABLE IF EXISTS EXEMPLAIRE;
DROP TABLE IF EXISTS OEUVRE;
DROP TABLE IF EXISTS AUTEUR;
CREATE TABLE IF NOT EXISTS ADHERENT(
idAdherent int NOT NULL AUTO_INCREMENT,
nomAdherent varchar(100),
adresse varchar(100),
datePaiement date,
primary key(idAdherent)
)ENGINE=InnoDB DEFAULT CHARSET=UTF8;
CREATE TABLE IF NOT EXISTS AUTEUR(
idAuteur int NOT NULL AUTO_INCREMENT,
nomAuteur varchar(100),
prenomAuteur varchar(100),
primary key(idAuteur)
)ENGINE=InnoDB DEFAULT CHARSET=UTF8;
CREATE TABLE IF NOT EXISTS OEUVRE(
noOeuvre int NOT NULL AUTO_INCREMENT,
idAuteur int,
titre varchar(100),
dateParution date,
primary key(noOeuvre),
CONSTRAINT c41 FOREIGN KEY (idAuteur) REFERENCES AUTEUR(idAuteur)
)ENGINE=InnoDB DEFAULT CHARSET=UTF8;
CREATE TABLE IF NOT EXISTS EXEMPLAIRE(
noExemplaire int NOT NULL AUTO_INCREMENT,
etat varchar(100),
dateAchat date,
prix float(4,2),
noOeuvre int,
primary key(noExemplaire),
CONSTRAINT c31 FOREIGN KEY (noOeuvre) REFERENCES OEUVRE(noOeuvre)
)ENGINE=InnoDB DEFAULT CHARSET=UTF8;
CREATE TABLE IF NOT EXISTS EMPRUNT(
idEmprunt int AUTO_INCREMENT,
idAdherent int,
noExemplaire int,
dateEmprunt date,
dateRendu date ,
CONSTRAINT c21 FOREIGN KEY (idAdherent) REFERENCES ADHERENT(idAdherent),
CONSTRAINT c22 FOREIGN KEY (noExemplaire) REFERENCES EXEMPLAIRE(noExemplaire),
primary key(idEmprunt)
)ENGINE=InnoDB DEFAULT CHARSET=UTF8;
INSERT INTO ADHERENT VALUES("1","millet","Montbeliard","2014-11-03");
INSERT INTO ADHERENT VALUES("2","lauvernay","sevenans","2014-06-13");
INSERT INTO ADHERENT VALUES("3","axelrad","sevenans","2015-01-12");
INSERT INTO ADHERENT VALUES("4","bedez","hericourt","2014-03-17");
INSERT INTO ADHERENT VALUES("5","berger","les glacis","2008-11-03");
INSERT INTO ADHERENT VALUES("6","cambot","sevenans","2013-12-15");
INSERT INTO ADHERENT VALUES("7","bonilla","sochaux","2014-03-17");
INSERT INTO ADHERENT VALUES("8","asproitis","grenoble","2014-12-04");
INSERT INTO ADHERENT VALUES("9","pereira","danjoutin","2013-11-03");
INSERT INTO ADHERENT VALUES("10","dupont","grenoble","2014-03-14");
INSERT INTO ADHERENT VALUES("11","durant","belfort","2013-12-16");
INSERT INTO ADHERENT VALUES("12","piton","belfort","2014-11-03");
INSERT INTO ADHERENT VALUES("13","durant","paris","2014-11-03");
INSERT INTO AUTEUR VALUES("1","Christie","agatha");
INSERT INTO AUTEUR VALUES("2","Chateaubriand","");
INSERT INTO AUTEUR VALUES("3","Flaubert","");
INSERT INTO AUTEUR VALUES("4","Prevert","");
INSERT INTO AUTEUR VALUES("5","De la fontaine","jean");
INSERT INTO AUTEUR VALUES("6","Daudet","");
INSERT INTO AUTEUR VALUES("7","hugo","victor");
INSERT INTO AUTEUR VALUES("8","kessel","");
INSERT INTO AUTEUR VALUES("9","duras","");
INSERT INTO AUTEUR VALUES("10","Proust","marcel");
INSERT INTO AUTEUR VALUES("11","Zola","émile");
INSERT INTO AUTEUR VALUES("12","Highsmith","");
INSERT INTO AUTEUR VALUES("13","Kipling","");
INSERT INTO AUTEUR VALUES("14","Azimov","");
INSERT INTO AUTEUR VALUES("15","Baudelaire","");
INSERT INTO AUTEUR VALUES("16","Moliere","");
INSERT INTO OEUVRE VALUES("1","1","le retour de Poirot","1992-02-12");
INSERT INTO OEUVRE VALUES("2","1","Poirot quitte la scène","1992-05-01");
INSERT INTO OEUVRE VALUES("3","1","dix brèves rencontres","1992-10-01");
INSERT INTO OEUVRE VALUES("4","1","le miroir de la mort","1992-01-01");
INSERT INTO OEUVRE VALUES("5","4","paroles","1992-03-01");
INSERT INTO OEUVRE VALUES("6","12","une créature de rêve","1992-02-01");
INSERT INTO OEUVRE VALUES("7","2","mémoire d'outre-tombe","");
INSERT INTO OEUVRE VALUES("8","3","Madame de Bovary","");
INSERT INTO OEUVRE VALUES("9","9","un amour de de swam","");
INSERT INTO OEUVRE VALUES("10","16","les femmes savantes","");
INSERT INTO OEUVRE VALUES("11","16","le misanthrope","");
INSERT INTO OEUVRE VALUES("12","15","Les fleurs du mal","");
INSERT INTO OEUVRE VALUES("13","15","petits poèmes en prose","");
INSERT INTO OEUVRE VALUES("14","14","les mondes perdus","1980-05-06");
INSERT INTO OEUVRE VALUES("15","14","la guerre des mondes","1970-03-15");
INSERT INTO OEUVRE VALUES("16","4","spectacles","1948-05-12");
INSERT INTO OEUVRE VALUES("17","5","Les fables","");
INSERT INTO OEUVRE VALUES("18","5","Le triomphe de l'amour","1980-05-06");
INSERT INTO OEUVRE VALUES("19","13","le livre de la jungle","");
INSERT INTO OEUVRE VALUES("20","13","kim","1901-07-01");
INSERT INTO OEUVRE VALUES("21","9","le marin de Gibraltar","1952-07-12");
INSERT INTO OEUVRE VALUES("22","11","l’assommoir","");
INSERT INTO OEUVRE VALUES("23","11","j'accuse","");
INSERT INTO OEUVRE VALUES("24","10","la terre","");
INSERT INTO EXEMPLAIRE VALUES("1","BON","2014-08-25","13","1");
INSERT INTO EXEMPLAIRE VALUES("2","MOYEN","2012-09-28","12","1");
INSERT INTO EXEMPLAIRE VALUES("3","MOYEN","2014-05-26","12","1");
INSERT INTO EXEMPLAIRE VALUES("4","BON","2006-01-11","10","1");
INSERT INTO EXEMPLAIRE VALUES("5","MAUVAIS","2013-10-29","13","2");
INSERT INTO EXEMPLAIRE VALUES("6","NEUF","2014-10-29","20","2");
INSERT INTO EXEMPLAIRE VALUES("7","BON","2013-12-27","7","3");
INSERT INTO EXEMPLAIRE VALUES("8","MOYEN","2013-09-25","13","3");
INSERT INTO EXEMPLAIRE VALUES("9","NEUF","2005-12-29","18","4");
INSERT INTO EXEMPLAIRE VALUES("10","NEUF","2005-12-29","21","4");
INSERT INTO EXEMPLAIRE VALUES("11","BON","2008-04-29","26","5");
INSERT INTO EXEMPLAIRE VALUES("12","MAUVAIS","2014-10-27","22","6");
INSERT INTO EXEMPLAIRE VALUES("13","BON","2014-01-24","22","6");
INSERT INTO EXEMPLAIRE VALUES("14","BON","2014-05-01","28","7");
INSERT INTO EXEMPLAIRE VALUES("15","MAUVAIS","2014-01-26","28","7");
INSERT INTO EXEMPLAIRE VALUES("16","BON","2014-01-24","30","8");
INSERT INTO EXEMPLAIRE VALUES("17","BON","2014-01-23","32","9");
INSERT INTO EXEMPLAIRE VALUES("18","MAUVAIS","2006-01-29","17","10");
INSERT INTO EXEMPLAIRE VALUES("19","BON","2013-10-29","18","10");
INSERT INTO EXEMPLAIRE VALUES("20","BON","2013-10-29","18","10");
INSERT INTO EXEMPLAIRE VALUES("21","BON","2013-10-29","19","10");
INSERT INTO EXEMPLAIRE VALUES("22","BON","2014-01-26","20","11");
INSERT INTO EXEMPLAIRE VALUES("23","BON","2014-10-29","21","12");
INSERT INTO EXEMPLAIRE VALUES("24","MAUVAIS","2014-01-24","22","13");
INSERT INTO EXEMPLAIRE VALUES("25","BON","2006-01-28","22","13");
INSERT INTO EXEMPLAIRE VALUES("26","MAUVAIS","2014-01-23","26","14");
INSERT INTO EXEMPLAIRE VALUES("27","MOYEN","2005-12-26","13","14");
INSERT INTO EXEMPLAIRE VALUES("28","BON","2014-02-23","12","15");
INSERT INTO EXEMPLAIRE VALUES("29","BON","2014-10-29","15","15");
INSERT INTO EXEMPLAIRE VALUES("30","MAUVAIS","2014-01-26","32","16");
INSERT INTO EXEMPLAIRE VALUES("31","BON","2014-01-23","19","17");
INSERT INTO EXEMPLAIRE VALUES("32","MAUVAIS","2012-10-29","19","17");
INSERT INTO EXEMPLAIRE VALUES("33","BON","2013-01-23","20","17");
INSERT INTO EXEMPLAIRE VALUES("34","BON","2014-01-25","11","18");
INSERT INTO EXEMPLAIRE VALUES("35","MAUVAIS","2013-10-29","15","18");
INSERT INTO EXEMPLAIRE VALUES("36","NEUF","2014-10-29","18","18");
INSERT INTO EXEMPLAIRE VALUES("37","BON","2014-01-23","8","19");
INSERT INTO EXEMPLAIRE VALUES("38","MAUVAIS","2013-09-28","18","20");
INSERT INTO EXEMPLAIRE VALUES("39","BON","2013-12-26","18","20");
INSERT INTO EXEMPLAIRE VALUES("40","BON","2014-01-23","11","24");
INSERT INTO EMPRUNT VALUES("1","1","11","2014-07-26","2014-08-21");
INSERT INTO EMPRUNT VALUES("2","1","15","2014-09-23","2014-09-26");
INSERT INTO EMPRUNT VALUES("3","1","19","2014-07-26","2014-07-31");
INSERT INTO EMPRUNT VALUES("4","1","34","2014-07-23","2014-08-20");
INSERT INTO EMPRUNT VALUES("5","1","37","2014-08-11","");
INSERT INTO EMPRUNT VALUES("6","2","5","2014-08-23","2014-09-23");
INSERT INTO EMPRUNT VALUES("7","2","5","2014-09-29","");
INSERT INTO EMPRUNT VALUES("8","2","18","2014-09-23","2014-10-28");
INSERT INTO EMPRUNT VALUES("9","2","35","2014-07-13","2014-09-21");
INSERT INTO EMPRUNT VALUES("10","2","40","2014-07-23","2014-08-23");
INSERT INTO EMPRUNT VALUES("11","3","3","2014-09-13","");
INSERT INTO EMPRUNT VALUES("12","3","5","2014-07-26","2014-08-23");
INSERT INTO EMPRUNT VALUES("13","3","5","2014-11-23","2014-12-24");
INSERT INTO EMPRUNT VALUES("14","3","7","2014-06-22","2014-07-29");
INSERT INTO EMPRUNT VALUES("15","3","9","2014-06-25","2014-06-30");
INSERT INTO EMPRUNT VALUES("16","3","40","2014-11-23","2014-12-24");
INSERT INTO EMPRUNT VALUES("17","5","12","2014-07-25","2014-09-23");
INSERT INTO EMPRUNT VALUES("18","5","40","2014-07-25","2014-09-22");
INSERT INTO EMPRUNT VALUES("19","6","2","2014-09-21","2014-09-28");
INSERT INTO EMPRUNT VALUES("20","8","9","2014-07-26","2014-09-22");
INSERT INTO EMPRUNT VALUES("21","8","33","2014-08-30","");
INSERT INTO EMPRUNT VALUES("22","10","6","2014-06-22","2014-07-23");
INSERT INTO EMPRUNT VALUES("23","10","19","2014-09-21","");
INSERT INTO EMPRUNT VALUES("24","12","38","2014-07-26","2014-10-22");
INSERT INTO EMPRUNT VALUES("25","13","6","2014-08-25","");
INSERT INTO EMPRUNT VALUES("26","13","13","2014-09-04","");
INSERT INTO EMPRUNT VALUES("27","13","27","2014-08-22","");