An ER diagram in DBMS (database management systems) is a lot like a storyboard for an animated TV show – it’s a collection of diagrams that show how everything fits together. Where a storyboard demonstrates the flow from one scene to the next, an ER diagram highlights the components of your databases and the relationships they share.
Understanding the ER model in DBMS is the first step to getting to grips with basic database software (like Microsoft Access) and more complex database-centric programming languages, such as SQL. This article explores ER diagrams in detail.
ER Model in DBMS
An ER diagram in DBMS is a tangible representation of the tables in a database, the relationships between each of those tables, and the attributes of each table. These diagrams feature three core components:
- Entities – Represented by rectangles in the diagram, entities are objects or concepts used throughout your database.
- Attributes – These are the properties that each entity possesses. ER diagrams use ellipses to represent attributes, with the attributes themselves tending to be the fields in a table. For example, an entity for students in a school’s internal database may have attributes for student names, birthdays, and unique identification numbers.
- Relationships – No entity in an ER diagram is an island, as each is linked to at least one other. These relationships can take multiple forms, with said relationships dictating the flow of information through the database.
Mapping out your proposed database using the ER model is essential because it gives you a visual representation of how the database works before you start coding or creating. Think of it like the blueprint you’d use to build a house, with that blueprint telling you where you need to lay every brick and fit every door.
Entities in DBMS
An Entity in DBMS tends to represent a real-life thing (like the students mentioned previously) that you can identify with certain types of data. Each entity is distinguishable from the others in your database, meaning you won’t have multiple entities listing student details.
Entities come in two flavors:
- Tangible Entities – These are physical things that exist in the real world, such as a person, vehicle, or building.
- Intangible Entities – If you can see and feel an entity, it’s intangible. Bank accounts are good examples. We know they exist (and have data attributed to them) but we can’t physically touch them.
There are also different entity strengths to consider:
- Strong Entities – A strong entity is represented using a rectangle and will have at least one key attribute attached to it that allows you to identify it uniquely. In the student example we’ve already shared, a student’s ID number could be a unique identifier, creating a key attribute that leads to the “Student” entity being strong.
- Weak Entities – Weak entities have no unique identifiers, meaning you can’t use them alone. Represented using double-outlined rectangles, these entities rely on the existence of strong entities to exist themselves. Think of it like the relationship between parent and child. A child can’t exist without a parent, in the same way that a weak entity can’t exist without a strong entity.
Once you’ve established what your entities are, you’ll gather each specific type of entity into an entity set. This set is like a table that contains the data for each entity in a uniform manner. Returning to the student example, any entity that has a student ID number, name, and birthdate, may be placed into an overarching “Student” entity set. They’re basically containers for specific entity types.
Attributes in DBMS
Every entity you establish has attributes attached to it, as you’ve already seen with the student example used previously. These attributes offer details about various aspects of the entity and come in four types:
- Simple Attributes – A simple attribute is any attribute that you can’t break down into further categories. A student ID number is a good example, as this isn’t something you can expand upon.
- Composite Attributes – Composite attributes are those that may have other attributes attached to them. If “Name” is one of your attributes, its composites could be “First Name,” “Surname,” “Maiden Name,” and “Nickname.”
- Derived Attributes – If you can derive an attribute from another attribute, it falls into this category. For instance, you can use a student’s date of birth to derive their age and grade level. These attributes have dotted ellipses surrounding them.
- Multi-valued Attributes – Represented by dual-ellipses, these attributes cover anything that can have multiple values. Phone numbers are good examples, as people can have several cell phone or landline numbers.
Attributes are important when creating an ER model in DBMS because they show you what types of data you’ll use to populate your entities.
Relationships in DBMS
As your database becomes more complex, you’ll create several entities and entity sets, with each having relationships with others. You represent these relationships using lines, creating a network of entities with line-based descriptions telling you how information flows between them.
There are three types of relationships for an ER diagram in DBMS:
- One-to-One Relationships – You’ll use this relationship when one entity can only have one of another entity. For example, if a school issues ID cards to its students, it’s likely that each student can only have one card. Thus, you have a one-to-one relationship between the student and ID card entities.
- One-to-Many Relationships – This relationship type is for when one entity can have several of another entity, but the relationship doesn’t work in reverse. Bank accounts are a good example, as a customer can have several bank accounts, but each account is only accessible to one customer.
- Many-to-Many Relationships – You use these relationships to denote when two entities can have several of each other. Returning to the student example, a student will have multiple classes, with each class containing several students, creating a many-to-many relationship.
These relationships are further broken down into “relationship sets,” which bring together all of the entities that participate in the same type of relationship. These sets have three varieties:
- Unary – Only one entity participates in the relationship.
- Binary – Two entities are in the relationship, such as the student and course example mentioned earlier.
- n-ary – Multiple entities participate in the relationship, with “n” being the number of entities.
Your ER diagram in DBMS needs relationships to show how each entity set relates to (and interacts with) the others in your diagram.
ER Diagram Notations
You’ll use various forms of notation to denote the entities, attributes, relationships, and the cardinality of those relationships in your ER diagram.
Entity Notations
Entities are denoted using rectangles around a word or phrase, with a solid rectangle meaning a strong entity and a double-outlined rectangle denoting a weak entity.
Attribute Notations
Ellipses are the shapes of choice for attributes, with the following uses for each attribute type:
- Simple and Composite Attribute – Solid line ellipses
- Derived Attribute – Dotted line ellipses
- Multi-Valued Attribute – Double-lined ellipses
Relationship Notations
Relationship notation uses diamonds, with a solid line diamond depicting a relationship between two attributes. You may also find double-lined diamonds, which signify the relationship between a weak entity and the strong entity that owns it.
Cardinality and Modality Notations
These lines show you the maximum times an instance in one entity set can relate to the instances of another set, making them crucial for denoting the relationships inside your database.
The endpoint of the line tells you everything you need to know about cardinality and ordinality. For example, a line that ends with three lines (two going diagonally) signifies a “many” cardinality, while a line that concludes with a small vertical line signifies a “one” cardinality. Modality comes into play if there’s a minimum number of instances for an entity type. For example, a person can have many phone numbers but must have at least one.
Steps to Create an ER Diagram in DBMS
With the various notations for an ER diagram in DBMS explained, you can follow these steps to draw your own diagram:
- Identify Entities – Every tangible and intangible object that relates to your database is an entity that you need to identify and define.
- Identify Attributes – Each entity has a set of attributes (students have names, ID numbers, birthdates, etc.) that you must define.
- Identify Relationships – Ask yourself how each entity set fits together to identify the relationships that exist between them.
- Assign Cardinality and Modality – If you have an instance from Entity A, how many instances does it relate to in Entity B? Is there a minimum to consider? Assign cardinalities and modalities to offer the answers.
- Finalize Your Diagram – Take a final pass over the diagram to ensure all required entities are present, they have the appropriate attributes, and that all relationships are defined.
Examples of ER Diagrams in DBMS
Once you understand the basics of the ER model in DBMS, you’ll see how they can apply to multiple scenarios:
- University Databases – A university database will have entities such as “Student,” “Teacher,” “Course,” and “Class.” Attributes depend on the entity, with the people-based entities having attributes including names, dates of birth, and ID numbers. Relationships vary (i.e., a student may only have one teacher but a single teacher may have several students).
- Hospital Management Databases – Entities for this type of database include people (“Patients,” “Doctors,” and “Nurses”), as well as other tangibles, such as different hospital buildings and inventory. These databases can get very complex, with multiple relationships linking the various people involved to different buildings, treatment areas, and inventory.
- E-Commerce Databases – People play an important role in the entities for e-commerce sites, too, because every site needs a list of customers. Those customers have payment details and order histories, which are potential entities or attributes. Product lists and available inventory are also factors.
Master the ER Model in DBMS
An ER diagram in DBMS can look like a complicated mass of shapes and lines at first, making them feel impenetrable to those new to databases. But once you get to grips with what each type of shape and line represents, they become crucial tools to help you outline your databases before you start developing them.
Application of what you’ve learned is the key to success with ER diagrams (and any other topic), so take what you’ve learned here and start experimenting. Consider real-world scenarios (such as those introduced above) and draw diagrams based on the entities you believe apply to those scenarios. Build up from there to figure out the attributes and relationships between entity sets and you’re well on your way to a good ER diagram.
Related posts
Computer Science is fast becoming one of the most valuable fields of study, with high levels of demand and high-salaried career opportunities for successful graduates. If you’re looking for a flexible and rewarding way to hone your computing skills as part of a supportive global community, the BSc in Computer Science at the Open Institute of Technology (OPIT) could be the perfect next step.
Introducing the OPIT BSc in Computer Science
The OPIT BSc in Computer Science is a bachelor’s degree program that provides students with a comprehensive level of both theoretical and practical knowledge of all core areas of computer science. That includes the likes of programming, databases, cloud computing, software development, and artificial intelligence.
Like other programs at OPIT, the Computer Science BSc is delivered exclusively online, with a mixture of recorded and live content for students to engage with. Participants will enjoy the instruction of world-leading lecturers and professors from various fields, including software engineers at major tech brands and esteemed researchers, and will have many paths open to them upon graduation.
Graduates may, for example, seek to push on with their educational journeys, progressing on to a specialized master’s degree at OPIT, like the MSc in Digital Business and Innovation or the MSc in Responsible Artificial Intelligence. Or they could enter the working world in roles like software engineer, data scientist, web developer, app developer, or cybersecurity consultant.
The bullets below outline the key characteristics of this particular course:
- Duration: Three years in total, spread across six terms.
- Content: Core courses for the first four terms, a student-selected specialization for the fifth term, and a capstone project in the final term.
- Focus: Developing detailed theoretical knowledge and practical skills across all core areas of modern computer science.
- Format: Entirely online, with a mixture of live lessons and asynchronous content you can access 24/7 to learn at your own pace.
- Assessment: Progressive assessments over the course of the program, along with a capstone project and dissertation, but no final exams.
What You’ll Learn
Students enrolled in the BSc in Computer Science course at OPIT will enjoy comprehensive instruction in the increasingly diverse sectors that fall under the umbrella of computer science today. That includes a close look at emerging technologies, like AI and machine learning, as well as introductions to the fundamental skills involved in designing and developing pieces of software.
The first four terms are the same for all students. These will include introductions to software engineering, computer security, and cloud computing infrastructure, as well as courses focusing on the core skills that computer scientists invariably need in their careers, like project management, quality assurance, and technical English.
For the fifth term, students will have a choice. They can select five electives from a pool of 27, or select one field to specialize in from a group of five. You may choose to specialize in all things cybersecurity, for example, and learn about emerging cyber threats. Or you could focus more on specific elements of computer science that appeal to your interests and passions, such as game development.
Who It’s For
The BSc in Computer Science program can suit a whole range of prospective applicants and should appeal to anyone with an interest or passion for computing and a desire to pursue a professional career in this field. Whether you’re seeking to enter the world of software development, user experience design, data science, or another related sector, this is the course to consider.
In addition, thanks to OPIT’s engaging, flexible, and exclusively online teaching and learning systems, this course can appeal to people from all over the globe, of different ages, and from different walks of life. It’s equally suitable for recent high school graduates with dreams of making their own apps to seasoned professionals looking to broaden their knowledge or transition to a different career.
The Value of the BSc in Computer Science Course at OPIT
Plenty of universities and higher education establishments around the world offer degrees in computer science, but OPIT’s program stands out for several distinctive reasons.
Firstly, as previously touched upon, all OPIT courses are delivered online. Students have a schedule of live lessons to attend, but can also access recorded content and digital learning resources as and when they choose. This offers an unparalleled level of freedom and flexibility compared to more conventional educational institutions, putting students in the driving seat and letting them learn at their own pace.
OPIT also aims not merely to impart knowledge through lectures and teaching, but to actually help students gain the practical skills they need to take the next logical steps in their education or career. In other words, studying at OPIT isn’t simply about memorizing facts and paragraphs of text; it’s about learning how to apply the knowledge you gain in real-world settings.
OPIT students also enjoy the unique benefits of a global community of like-minded students and world-leading professors. Here, distance is no barrier, and while students and teachers may come from completely different corners of the globe, all are made to feel welcome and heard. Students can reach out to their lecturers when they feel the need for guidance, answers, and advice.
Other benefits of studying with OPIT include:
- Networking opportunities and events, like career fairs, where you can meet and speak with representatives from some of the world’s biggest tech brands
- Consistent support systems from start to finish of your educational journey in the form of mentorships and more
- Helpful tools to expedite your education, like the OPIT AI Copilot, which provides personalized study support
Entry Requirements and Fees
To enroll in the OPIT BSc in Computer Science and take your next steps towards a thrilling and fulfilling career in this field, you’ll need to meet some simple criteria. Unlike other educational institutions, which can impose strict and seemingly unattainable requirements on their applicants, OPIT aims to make tech education more accessible. As a result, aspiring students will require:
- A higher secondary school leaving certificate at EQF Level 4, or equivalent
- B2-level English proficiency, or higher
Naturally, applicants should also have a passion for computer science and a willingness to study, learn, and make the most of the resources, community, and support systems provided by the institute.
In addition, if you happen to have relevant work experience or educational achievements, you may be able to use these to skip certain modules or even entire terms and obtain your degree sooner. OPIT offers a comprehensive credit transfer program, which you can learn more about during the application process.
Regarding fees, OPIT also stands out from the crowd compared to conventional educational institutions, offering affordable rates to make higher tech education more accessible. There are early bird discounts, scholarship opportunities, and even the option to pay either on a term-by-term basis or a one-off up-front fee.
The Open Institute of Technology (OPIT) provides a curated collection of courses for students at every stage of their learning journey, including those who are just starting. For aspiring tech leaders and those who don’t quite feel ready to dive directly into a bachelor’s degree, there’s the OPIT Foundation Program. It’s the perfect starting point to gain core skills, boost confidence, and build a solid base for success.
Introducing the OPIT Foundation Year Program
As the name implies, OPIT’s Foundation Program is about foundation-level knowledge and skills. It’s the only pre-bachelor program in the OPIT lineup, and successful students on this 60-ECTS credit course will obtain a Pre-Tertiary Certificate in Information Technology upon its completion. From there, they can move on to higher levels of learning, like a Bachelor’s in Digital Business or Modern Computer Science.
In other words, the Foundation Program provides a gentle welcome into the world of higher technological education, while also serving as a springboard to help students achieve their long-term goals. By mixing both guided learning and independent study, it also prepares students for the EQF Level 4 experiences and challenges they’ll face once they enroll in a bachelor’s program in IT or a related field.
Here’s a quick breakdown of what the OPIT Foundation Program course involves:
- Duration: Six months, split into two terms, with each term lasting 13 weeks
- Content: Three courses per term, with each one worth 10 ECTS credits, for a total of 60
- Focus: Core skills, like mathematics, English, and introductory-level computing
- Format: Video lectures, independent learning, live sessions, and digital resources (e-books, etc.)
- Assessment: Two to three assessments over the course of the program
What You’ll Learn
The OPIT Foundation Program doesn’t intensely focus on any one particular topic, nor does it thrust onto you the more advanced, complicated aspects of technological education you would find in a bachelor’s or master’s program. Instead, it largely keeps things simple, focusing on the basic building blocks of knowledge and core skills so that students feel comfortable taking the next steps in their studies.
It includes the following courses, spread out across two terms:
- Academic Skills
- Mathematics Literacy I
- Mathematics Literacy II
- Internet and Digital Technology
- Academic Reading, Writing, and Communication
- Introduction to Computer Hardware and Software
Encompassing foundational-level lessons in digital business, computer science, and computer literacy, the Foundation Program produces graduates with a commanding knowledge of common operating systems. Exploring reading and writing, it also helps students master the art of communicating their ideas and responses in clear, academic English.
Who It’s For
The Foundation Year program is for people who are eager to enter the world of technology and eventually pursue a bachelor’s or higher level of education in this field, but feel they need more preparation. It’s for the people who want to work on their core skills and knowledge before progressing to more advanced topics, so that they don’t feel lost or left behind later on.
It can appeal to anyone with a high school-level education and ambitions of pushing themselves further, and to anyone who wants to work in fields like computer science, digital business, and artificial intelligence (AI). You don’t need extensive experience or qualifications to get started (more on that below); just a passion for tech and the motivation to learn.
The Value of the Foundation Program
With technology playing an increasingly integral role in the world today, millions of students want to develop their tech knowledge and skills. The problem is that technology-oriented degree courses can sometimes feel a little too complex or even inaccessible, especially for those who may not have had the most conventional educational journeys in the past.
While so many colleges and universities around the world simply expect students to show up with the relevant skills and knowledge to dive right into degree programs, OPIT understands that some students need a helping hand. That’s where the Foundation Program comes in – it’s the kind of course you won’t find at a typical university, aimed at bridging the gap between high school and higher education.
By progressing through the Foundation Program, students gain not just knowledge, but confidence. The entire course is aimed at eliminating uncertainty and unease. It imbues students with the skills and understanding they need to push onward, to believe in themselves, and to get more value from wherever their education takes them next.
On its own, this course won’t necessarily provide the qualifications you need to move straight into the job market, but it’s a vital stepping stone towards a degree. It also provides numerous other advantages that are unique to the OPIT community:
- Online Learning: Enjoy the benefits of being able to learn at your own pace, from the comfort of home, without the costs and inconveniences associated with relocation, commuting, and so on.
- Strong Support System: OPIT professors regularly check in with students and are on hand around the clock to answer queries and provide guidance.
- Academic Leaders: The OPIT faculty is made up of some of the world’s sharpest minds, including tech company heads, experienced researchers, and even former education ministers.
Entry Requirements and Fees
Unlike OPIT’s other, more advanced courses, the Foundation Program is aimed at beginners, so it does not have particularly strict or complex entry requirements. It’s designed to be as accessible as possible, so that almost anyone can acquire the skills they need to pursue education and a career in technology. The main thing you’ll need is a desire to learn and improve your skills, but applicants should also possess:
- English proficiency at level B2 or higher
- A Secondary School Leaving Certificate, or equivalent
Regarding the fees, OPIT strives to lower the financial barrier of education that can be such a deterrent in conventional education around the world. The institute’s tuition fees are fairly and competitively priced, all-inclusive (without any hidden charges to worry about), and accessible for those working with different budgets.
Given that all resources and instruction are provided online, you can also save a lot of money on relocation and living costs when you study with OPIT. In addition, applicants have the option to pay either up front, with a 10% discount on the total, or on a per-term basis, allowing you to stretch the cost out over a longer period to ease the financial burden.
Have questions?
Visit our FAQ page or get in touch with us!
Write us at +39 335 576 0263
Get in touch at hello@opit.com
Talk to one of our Study Advisors
We are international
We can speak in: