Conceptual ConceptualLogical LogicalPhysical PhysicalSQL SQLMerise MeriseUML UMLExport
User
id_usernameVarcharemailVarcharcampusVarchar
Ride
id_rideoriginVarchardestinationVarchardate_timeDateTime
#id_vehicle IntegerVehicle
id_vehicleseatsInteger
Review
id_reviewratingInteger
BooksUses0,n0..*0,n1,n1..*1,n1,111,10,n0..*0,nbooking#id_user#id_ride
Rule appliedMany on both sides: Books becomes a join table.
Rule appliedOne side is (1,1): Uses becomes a required foreign key in ride.
Checks A primary key on every table Complete associations Normal forms: no sign of a problem? "campus" is free text: a Campus entity? DownloadPNGSVGJPGCreate a schemCovoit'Campus data modelKeep linked to the modelCreate schem Docs · Requirementslinked schem · v1v2
Schem created and linkedPostgreSQLPostgreSQLMySQLMySQLOracleOracleSQL ServerSQL ServerSQLiteSQLiteMongoDBMongoDB
CopyCopiedCREATE TABLE app_user (
id_user integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
name varchar(60) NOT NULL,
email varchar(120) NOT NULL,
campus varchar(60)
);
CREATE TABLE booking (
id_user integer NOT NULL,
id_ride integer NOT NULL,
PRIMARY KEY (id_user, id_ride)
);
ALTER TABLE booking
ADD FOREIGN KEY (id_user) REFERENCES app_user;
db.createCollection("user", {
validator: { $jsonSchema: {
required: ["name", "email"],
properties: {
name: { bsonType: "string", maxLength: 60 },
email: { bsonType: "string", maxLength: 120 },
campus: { bsonType: "string" }
}
} }
});
db.ride.createIndex({ vehicle: 1 });
db.user.updateOne(
{ _id: id }, { $addToSet: { bookings: ride } }
);