summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile0
-rw-r--r--assignments/1/associative-entity.pngbin10258 -> 13321 bytes
-rw-r--r--assignments/1/course-administration.pngbin0 -> 94102 bytes
-rw-r--r--assignments/1/course-administration.uml97
-rw-r--r--assignments/1/unary-relationship.pngbin5601 -> 7334 bytes
-rw-r--r--assignments/1/weak-entity.pngbin7062 -> 9353 bytes
6 files changed, 97 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Makefile
diff --git a/assignments/1/associative-entity.png b/assignments/1/associative-entity.png
index 6e62f99..d3e37e0 100644
--- a/assignments/1/associative-entity.png
+++ b/assignments/1/associative-entity.png
Binary files differ
diff --git a/assignments/1/course-administration.png b/assignments/1/course-administration.png
new file mode 100644
index 0000000..a694734
--- /dev/null
+++ b/assignments/1/course-administration.png
Binary files differ
diff --git a/assignments/1/course-administration.uml b/assignments/1/course-administration.uml
new file mode 100644
index 0000000..418bddd
--- /dev/null
+++ b/assignments/1/course-administration.uml
@@ -0,0 +1,97 @@
+@startuml
+!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
+!define primary_key(x) <b>x</b>
+!define foreign_key(x) <color:purple>x</color>
+!define unique(x) <color:green>x</color>
+!define not_null(x) <u>x</u>
+hide methods
+hide stereotypes
+
+' entities
+Table(courses, "courses") {
+ primary_key(id) BIGINT
+ unique(course_number) VARCHAR[255]
+ not_null(title) VARCHAR[255]
+}
+' add unique constaint on courses(course_number, title);
+
+Table(terms, "terms") {
+ primary_key(id) BIGINT
+ not_null(start_at) DATETIME
+ not_null(end_at) DATETIME
+}
+
+Table(scheduled_courses, "scheduled_courses") {
+ primary_key(id) BIGINT
+ not_null(capacity) INTEGER
+ foreign_key(term_id) BIGINT
+ foreign_key(instructor_id) BIGINT
+ foreign_key(course_id) BIGINT
+}
+
+Table(course_prerequisites, "course_prerequisites") {
+ foreign_key(course_id) BIGINT
+ foreign_key(prerequisite_id) BIGINT
+}
+
+Table(course_assistants, "course_assistants") {
+ foreign_key(scheduled_course_id) BIGINT
+ foreign_key(student_id) BIGINT
+ type INTEGER [0 teaching, 1 research]
+}
+
+Table(instructors, "instructors") {
+ primary_key(id) BIGINT
+ not_null(title) VARCHAR[255]
+ first_name VARCHAR[255]
+ last_name VARCHAR[255]
+ email_address VARCHAR[255]
+ phone_number VARCHAR[255]
+ fax_number VARCHAR[255]
+}
+
+Table(students, "students") {
+ primary_key(id) BIGINT
+ first_name VARCHAR[255]
+ last_name VARCHAR[255]
+ email_address VARCHAR[255]
+ phone_number VARCHAR[255]
+ postal_code VARCHAR[255]
+ gpa DECIMAL
+ student_type INTEGER
+}
+
+Table(course_enrollments, "course_enrollments") {
+ primary_key(id) BIGINT
+ foreign_key(student_id) BIGINT
+ foreign_key(scheduled_course_id) BIGINT
+ grade DECIMAL
+}
+
+Table(disciplines, "disciplines") {
+ primary_key(id) BIGINT
+ not_null(name) VARCHAR[255]
+ foreign_key(disciplines_id) BIGINT [parent discipline]
+}
+
+Table(course_disciplines, "course_disciplines") {
+ foreign_key(course_id) BIGINT
+ foreign_key(discipline_id) BIGINT
+}
+
+' relationships
+disciplines --> disciplines : "belongs to"
+course_enrollments --> scheduled_courses : "belongs to"
+course_enrollments --> students : "belongs to"
+students --> course_enrollments : "has many"
+course_assistants --> students : "belongs to"
+course_assistants --> scheduled_courses : "belongs to"
+scheduled_courses --> course_assistants : "has many"
+courses --> course_prerequisites : "has many"
+scheduled_courses --> courses : "belongs_to"
+scheduled_courses --> terms : "belongs_to"
+scheduled_courses --> instructors : "belongs to"
+instructors --> scheduled_courses : "has many"
+courses --> course_disciplines : "has many"
+course_disciplines --> disciplines : "belongs to"
+@enduml
diff --git a/assignments/1/unary-relationship.png b/assignments/1/unary-relationship.png
index a2d7ecb..2c711a9 100644
--- a/assignments/1/unary-relationship.png
+++ b/assignments/1/unary-relationship.png
Binary files differ
diff --git a/assignments/1/weak-entity.png b/assignments/1/weak-entity.png
index 14b4168..c03f6b6 100644
--- a/assignments/1/weak-entity.png
+++ b/assignments/1/weak-entity.png
Binary files differ