Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TD_NF17_goupe4
Clinique Veterinaire
Commits
7d6cfc75
Commit
7d6cfc75
authored
Jun 12, 2019
by
Robin Bouvier
Browse files
Update JSON_CREATE.sql
parent
364fd30d
Changes
1
Hide whitespace changes
Inline
Side-by-side
JSON/JSON_CREATE.sql
View file @
7d6cfc75
...
...
@@ -4,5 +4,45 @@ CREATE TABLE Animal VALUES (
dernierPoids
INTEGER
NOT
NULL
,
derniereTaille
INTEGER
NOT
NULL
,
dateNaissance
INTEGER
NOT
NULL
,
traitements
JSON
espece
VARCHAR
(
50
)
NOT
NULL
,
traitements
JSON
,
PRIMARY
KEY
(
id
),
FOREIGN
KEY
(
espece
)
REFERENCES
Especes
(
nom
),
CHECK
(
dernierPoids
>
0
),
CHECK
(
derniereTaille
>
0
)
);
CREATE
TABLE
Classes
(
nom
VARCHAR
(
50
),
PRIMARY
KEY
(
nom
)
);
CREATE
TABLE
Especes
(
nom
VARCHAR
(
50
),
classe
VARCHAR
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
nom
),
FOREIGN
KEY
(
classe
)
REFERENCES
Classes
(
nom
)
);
CREATE
TABLE
Clients
(
id
INTEGER
,
telephone
INTEGER
NOT
NULL
,
nom
VARCHAR
(
50
)
NOT
NULL
,
prenom
VARCHAR
(
50
)
NOT
NULL
,
date_naissance
DATE
NOT
NULL
,
adresse
VARCHAR
(
255
)
NOT
NULL
,
PRIMARY
KEY
(
id
),
CHECK
(
telephone
>
100000000
AND
telephone
<
999999999
)
);
CREATE
TABLE
Proprietaires
(
client
INTEGER
,
animal
INTEGER
,
PRIMARY
KEY
(
client
,
animal
),
FOREIGN
KEY
(
client
)
REFERENCES
Clients
(
id
),
FOREIGN
KEY
(
animal
)
REFERENCES
Animaux
(
id
)
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment