diff --git a/P2/.$conceptual.drawio.bkp b/P2/.$conceptual.drawio.bkp new file mode 100644 index 0000000..47f0dd5 --- /dev/null +++ b/P2/.$conceptual.drawio.bkp @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/P2/.$conceptual.svg.bkp b/P2/.$conceptual.svg.bkp new file mode 100644 index 0000000..2b62843 --- /dev/null +++ b/P2/.$conceptual.svg.bkp @@ -0,0 +1,4 @@ + + + +
Artist
Artist
Piece
Piece
id
id
name
name
birth_date
birth_date
birth_place
birth_place
id
id
name
name
creation_place
creation_place
N
N
N
N
author
author
Location
Location
id
id
city
city
street_name
street_name
street_number
street_number
Move
Move
N
N
N
N
location
location
1
1
1
1
piece
piece
year
year
day
day
Collection
Collection
piece
piece
N
N
1
1
Museum
Museum
N
N
0-1
0-1
museum
museum
location
location
N
N
1
1
Exhibition
Exhibition
location
location
1
1
1
1
piece
piece
1
1
N
N
id
id
name
name
opening_hours
opening_hours
id
id
name
name
StorageSite
StorageSite
storage_site
storage_site
0-1
0-1
1
1
size
size
Text is not SVG - cannot display
\ No newline at end of file diff --git a/P2/conceptual.drawio b/P2/conceptual.drawio new file mode 100644 index 0000000..5a699a9 --- /dev/null +++ b/P2/conceptual.drawio @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/P2/conceptual.png b/P2/conceptual.png new file mode 100644 index 0000000..5edaf3e Binary files /dev/null and b/P2/conceptual.png differ diff --git a/P2/conceptual.svg b/P2/conceptual.svg new file mode 100644 index 0000000..b730799 --- /dev/null +++ b/P2/conceptual.svg @@ -0,0 +1,4 @@ + + + +
Artist
Piece
id
name
birth_date
birth_place
id
name
creation_place
N
N
author
Location
id
city
street_name
street_number
Move
N
N
location
1
1
piece
year
day
Collection
piece
N
1
Museum
N
0-1
museum
location
N
1
Exhibition
location
1
1
piece
1
N
id
name
opening_hours
id
name
StorageSite
storage_site
0-1
1
size
\ No newline at end of file diff --git a/P2/database.sqlite b/P2/database.sqlite new file mode 100644 index 0000000..b33a068 Binary files /dev/null and b/P2/database.sqlite differ diff --git a/P2/exo3/create.sql b/P2/exo3/create.sql new file mode 100644 index 0000000..1368375 --- /dev/null +++ b/P2/exo3/create.sql @@ -0,0 +1,3 @@ +CREATE TABLE IF NOT EXISTS Vehicle ( + num +); diff --git a/P2/exo3/dbml-error.log b/P2/exo3/dbml-error.log new file mode 100644 index 0000000..e69de29 diff --git a/P2/exo3/exo3.db b/P2/exo3/exo3.db new file mode 100644 index 0000000..e69de29 diff --git a/P2/exo3/exo3.dbml b/P2/exo3/exo3.dbml new file mode 100644 index 0000000..44479d3 --- /dev/null +++ b/P2/exo3/exo3.dbml @@ -0,0 +1,50 @@ +Table Customer { + cid integer [primary key, not null] + firstname varchar [primary key, not null] + lastname varchar [primary key, not null] + preference_vcid integer [Ref: > VehicleClass.vcid, not null] + preference_vcname varchar [Ref: > VehicleClass.vcname, not null] +} + +Table VehicleClass { + vcid integer [primary key, not null] + vcname varchar [primary key, not null] + length integer [not null] + width integer [not null] + height integer [not null] +} + +Table Vehicle { + vid integer [primary key, not null] + vcid integer [primary key, ref: > VehicleClass.vcid, not null] + vcname varchar [primary key, ref: > VehicleClass.vcname, not null] + last_check_date datetime [not null] + plate_num integer [null] + street varchar [primary key, not null, ref: > Station.street] + postcode varchar [primary key, not null, ref: > Station.postcode] + city varchar [primary key, not null, ref: > Station.city] + name varchar [primary key, not null, ref: > Station.name] +} + +Table Station { + street varchar [primary key, not null] + postcode varchar [primary key, not null] + city varchar [primary key, not null] + name varchar [primary key, not null] +} + +Table Reservation { + startDateTime datetime [primary key, not null] + endDateTime datetime [not null] + frid integer [null, ref: > FinishedReservation.frid] + cid integer [primary key, not null, ref: > Customer.cid] + cname varchar [primary key, not null, ref: > Customer.firstname] + vid integer [primary key, not null, ref: > Vehicle.vid] +} + +Table FinishedReservation { + frid integer [primary key, not null] + distance integer [not null] + cost integer [not null] +} + diff --git a/P2/exo3/exo3.sql b/P2/exo3/exo3.sql new file mode 100644 index 0000000..e837bb8 --- /dev/null +++ b/P2/exo3/exo3.sql @@ -0,0 +1,66 @@ +CREATE TABLE "Customer" ( + "cid" integer NOT NULL, + "firstname" varchar NOT NULL, + "lastname" varchar NOT NULL, + "preference_vcid" integer NOT NULL, + "preference_vcname" varchar NOT NULL, + PRIMARY KEY ("cid", "firstname", "lastname") + FOREIGN KEY ("preference_vcid") REFERENCES "VehicleClass" ("vcid"); + FOREIGN KEY ("preference_vcname") REFERENCES "VehicleClass" ("vcname"); +); + +CREATE TABLE "VehicleClass" ( + "vcid" integer NOT NULL, + "vcname" varchar NOT NULL, + "length" integer NOT NULL, + "width" integer NOT NULL, + "height" integer NOT NULL, + PRIMARY KEY ("vcid", "vcname") +); + +CREATE TABLE "Vehicle" ( + "vid" integer NOT NULL, + "vcid" integer NOT NULL, + "vcname" varchar NOT NULL, + "last_check_date" datetime NOT NULL, + "plate_num" integer, + "street" varchar NOT NULL, + "postcode" varchar NOT NULL, + "city" varchar NOT NULL, + "name" varchar NOT NULL, + PRIMARY KEY ("vid", "vcid", "vcname", "street", "postcode", "city", "name") + FOREIGN KEY ("vcid") REFERENCES "VehicleClass" ("vcid"); + FOREIGN KEY ("vcname") REFERENCES "VehicleClass" ("vcname"); + FOREIGN KEY ("street") REFERENCES "Station" ("street"); + FOREIGN KEY ("postcode") REFERENCES "Station" ("postcode"); + FOREIGN KEY ("city") REFERENCES "Station" ("city"); + FOREIGN KEY ("name") REFERENCES "Station" ("name"); +); + +CREATE TABLE "Station" ( + "street" varchar NOT NULL, + "postcode" varchar NOT NULL, + "city" varchar NOT NULL, + "name" varchar NOT NULL, + PRIMARY KEY ("street", "postcode", "city", "name") +); + +CREATE TABLE "Reservation" ( + "startDateTime" datetime NOT NULL, + "endDateTime" datetime NOT NULL, + "frid" integer, + "cid" integer NOT NULL, + "cname" varchar NOT NULL, + "vid" integer NOT NULL, + PRIMARY KEY ("startDateTime", "cid", "cname", "vid") + FOREIGN KEY ("frid") REFERENCES "FinishedReservation" ("frid"); + FOREIGN KEY ("cid") REFERENCES "Customer" ("cid"); + FOREIGN KEY ("cname") REFERENCES "Customer" ("firstname"); + FOREIGN KEY ("vid") REFERENCES "Vehicle" ("vid"); +); + +CREATE TABLE "FinishedReservation" ( + "frid" integer PRIMARY KEY NOT NULL, + "distance" integer NOT NULL, + "cost" integer NOT NULL +); diff --git a/P2/part1.txt b/P2/part1.txt new file mode 100644 index 0000000..05c3434 --- /dev/null +++ b/P2/part1.txt @@ -0,0 +1,12 @@ +artists(id, name, birth_date, birth_place) +pieces(id, type, creation_date) +pieces_data(piece_id, key, value) +piece_artist(piece_id, artist_id) +moves(piece_id, location_id, year, day) +collections(id, name, NULLABLE museum) +piece_collection(piece_id, collection_id) +exhibitions(id, begin, end, location_id) +piece_exhibition(piece_id, exhibition_id) +locations(id, city, street_name, street_number) +museums(id, location_id, name, opening_hours) +storages(id, location_id, size) diff --git a/P2/reviews/UML2.pdf b/P2/reviews/UML2.pdf new file mode 100644 index 0000000..dca5cf3 Binary files /dev/null and b/P2/reviews/UML2.pdf differ diff --git a/P2/reviews/er_chen.pdf b/P2/reviews/er_chen.pdf new file mode 100644 index 0000000..8dad1c2 Binary files /dev/null and b/P2/reviews/er_chen.pdf differ diff --git a/P2/reviews/review-2.md b/P2/reviews/review-2.md new file mode 100644 index 0000000..e291c61 --- /dev/null +++ b/P2/reviews/review-2.md @@ -0,0 +1,78 @@ +## Aspect 1 + +Grade 6/6 + +Museums should probably use an ID rather than the name as Key. + +## Aspect 2 + +Grade: 6/6 + +## Aspect 3 + +Grade: 3/6 + +Wrong use of week entities between Museum/Storage and Location, PiecesOfArt and Sculptures/Paintings/Others as they Are 1-to-1 relationships. + +## Aspect 4 + +Grade 0/6 + +N Arts should be a be able to move M times to 1 location. + +Current implementation allow multiples moves on one day. + +## Aspect 5 + +Grade: 6/6 + +Arity is well chosen. + +## Aspect 6 + +Grade: 6/6 + +Entities are well chosen. + +## Aspect 7 + +Grade: 5/6 + +Street number in storage sites should not be there as it belong to the location, and the size attribute is missing + +## Aspect 8 + +Grade: 6/6 + +All relationships are well chosen. + +## Aspect 9 + +Grade: 6/6 + +- Other types of art are available with "Other", but only a type can be specified, and no other information. +- One piece of art belong to only one collection. + +It was pretty easy to understand those design choices as the diagram is well designed. + +## Aspect 10 + +Grade: 6/6 + +## Aspect 11 + +Grade: 5/6 + +The same small mistakes have been made in the UML diagram than in the ER diagram, but the global design is still very good. + +## Aspect 12 + +Grade: 6/6 + +The diagrams are consistent. + +## Aspect 13 + +Grade: 1/6 (as requested by the teacher) + +The UML diagram is easier to understand than the ER diagram because it has way less forms, and lines represents only relationships between entities and not attributes. diff --git a/P2/text.pdf b/P2/text.pdf new file mode 100644 index 0000000..c2f0f6b Binary files /dev/null and b/P2/text.pdf differ