top of page

ER Diagram Example: University Database

The university database stores details about university students, courses, the semester a student took a particular course (and his mark and grade if he completed it), and what degree program each student is enrolled in. The database is a long way from one that’d be suitable for a large tertiary institution, but it does illustrate relationships that are interesting to query, and it’s easy to relate to when you’re learning SQL. We explain the requirements next and discuss their shortcomings at the end of this section.


Consider the following requirements list:

  • The university offers one or more programs.

  • A program is made up of one or more courses.

  • A student must enroll in a program.

  • A student takes the courses that are part of her program.

  • A program has a name, a program identifier, the total credit points required to graduate, and the year it commenced.

  • A course has a name, a course identifier, a credit point value, and the year it commenced.

  • Students have one or more given names, a surname, a student identifier, a date of birth, and the year they first enrolled. We can treat all given names as a single object—for example, “John Paul.”

  • When a student takes a course, the year and semester he attempted it are recorded. When he finishes the course, a grade (such as A or B) and a mark (such as 60 percent) are recorded.

  • Each course in a program is sequenced into a year (for example, year 1) and a semester (for example, semester 1).


The ER diagram derived from our requirements is shown in Figure . Although it is compact, the diagram uses some advanced features, including relationships that have attributes and two many-to-many relationships.


In our design:

  • Student is a strong entity, with an identifier, student_id, created to be the primary key used to distinguish between students (remember, we could have several students with the same name).

  • Program is a strong entity, with the identifier program_id as the primary key used to distinguish between programs.

  • Each student must be enrolled in a program, so the Student entity participates totally in the many-to-one EnrollsIn relationship with Program. A program can exist without having any enrolled students, so it participates partially in this relationship.

  • A Course has meaning only in the context of a Program, so it’s a weak entity, with course_id as a weak key. This means that a Course is uniquely identified using its course_id and the program_id of its owning program.

  • As a weak entity, Course participates totally in the many-to-one identifying relationship with its owning Program. This relationship has Year and Semester attributes that identify its sequence position.

  • Student and Course are related through the many-to-many Attempts relationships; a course can exist without a student, and a student can be enrolled without attempting any courses, so the participation is not total.

  • When a student attempts a course, there are attributes to capture the Year and Semester, and the Mark and Grade.



Source: oreilly


The Tech Platform





7 comments

7 Comments


Guest
Aug 19

If you’re in need of quality academic writing assistance, Royal Writer is a great option. They offer a wide range of services, from custom essays to detailed research papers, all crafted to meet your specific academic requirements. https://royalwriter.co.uk/ is known for delivering original, well-researched content on time, making them a dependable choice for students. Whether you’re facing a tight deadline or struggling with a complex topic, their team of experienced writers can provide the support you need to achieve your academic goals. Plus, their easy-to-use website and responsive customer service ensure a smooth experience. Visit their site today to explore their services and see how they can help you succeed.

Like

Guest
Apr 23

Essays are more than just academic exercises; they're gateways to deeper understanding. Through essays, we explore ideas, analyze concepts, and articulate arguments. They demand clarity of thought, precision of expression, and depth of insight. From personal reflections to scholarly residency statement analyses, essays provide a platform for engaging with diverse perspectives and communicating complex ideas. By honing our essay-writing skills, we not only sharpen our intellect but also refine our ability to communicate effectively in a world overflowing with information and ideas.

Like

Guest
Nov 29, 2023

Well, I can say that the article turned out to be quite successful and useful. As for the database, yes, it is a small problem now compared to what it was thirty years ago. But I can still use scholarship essay examples, even with all the knowledge that is available now. Because it is simply easier and faster to implement, think about it, even to spend your own time when professionals can do everything for you. So now I'm very actively studying other subjects outside of college, because our database is boring to me.

Like

Guest
Nov 29, 2023

The database is quite a solution in such moments when you need to prepare for an exam. I used to rely on it a lot and was very happy that we had it. But that didn't change the fact that I didn't have time to do my written work. Therefore, I ordered services from an essay writer online who did everything flawlessly and clearly. Thanks to him, I managed to overcome several semesters of study and wrote my master's thesis with his help. Therefore, in combination with the database of our university, I was quite advanced in my studies.

Like

Guest
Nov 29, 2023

It's very cool that someone has a quality database from their university, it's pretty handy. I can say that I've seen this several times, but unfortunately I didn't have it. In order to complete my written assignments efficiently, I had to use cheap essay writing service reviews I read spoke for themselves in terms of the quality of this resource. That's why I could choose this service without any hesitation and be sure that it would do everything with high quality. But time passed and I got to the place where the knowledge base was and therefore made up for my mistakes.

Like
bottom of page