Relational Database Overview
Relational Database Overview
A relational database is a type of database that stores and provides access to data points
that are related to one another. In a relational database:
Columns (also called attributes) represent the data fields (like name, age, email).
Each table has a primary key, a column or set of columns that uniquely identifies each
row.
Foreign keys are used to link one table to another, creating relationships between data
in different tables.
Example:
You might have two tables:
Customers Table
1 Alice alice@mail.com
2 Bob bob@mail.com
Orders Table
101 1 Laptop
102 2 Headphones
103 1 Mouse
Here, CustomerID in the Orders table is a foreign key that refers to the CustomerID in the
Customers table. This relationship links orders to the customer who made them.
Relational databases use SQL (Structured Query Language) to query and manage data.
1/6
Popular relational database systems include:
MySQL
PostgreSQL
Oracle Database
Let me know if you’d like to see an example SQL query or how to create such tables.
A relational database is a type of database that stores and provides access to data points
that are related to one another. It organizes data into tables, which consist of rows and
columns.
Break down your answer into well-structured paragraphs, each focusing on a specific aspect:
Data Organization:
Data is organized into tables (also called relations), where each table represents a
specific entity.
Each table consists of rows (records) and columns (attributes). Rows represent
individual entries, while columns represent data fields.
Primary Key:
A primary key is a unique identifier for each record in a table, ensuring that each
entry can be uniquely distinguished.
2/6
Foreign Key and Relationships:
A foreign key is a field in one table that uniquely identifies a row of another table,
establishing a relationship between the two tables.
Use of SQL:
Relational databases utilize Structured Query Language (SQL) for querying and
managing data.
Example:
For instance, a 'Customers' table may have a primary key 'CustomerID', and an
'Orders' table may include 'CustomerID' as a foreign key to link each order to a
customer.
Use Examples:
Incorporate relevant examples to illustrate your points, enhancing the clarity and depth
of your answer.
3/6
exceeding the exam time limit.
For a more in-depth understanding of structuring exam answers, you might find this video
helpful:
2/2
for er diagram
To write a 13-mark exam answer for the question "What is an ER Diagram?", follow a
structured approach that covers definition, components, uses, and an example. Here's how
you should write it:
Entities:
These are objects or things in the real world that have an independent existence.
Entities are represented by rectangles.
Example: Student , Course
Attributes:
4/6
Primary Key:
A unique attribute that identifies each entity instance. Represented with underlined
ellipses.
Relationships:
Cardinality:
Describes the number of instances of one entity that can be associated with another
entity. Types include:
One-to-One (1:1)
One-to-Many (1:N)
Many-to-Many (M:N)
Participation:
pgsql
Explain:
A Student can enroll in multiple Courses, and each Course can have multiple Students.
This is a many-to-many relationship.
4. Conclusion (2 marks)
ER diagrams are essential tools in database design. They provide a clear and structured
way to visualize entities, their attributes, and relationships, making it easier to create
5/6
accurate and efficient relational databases.
Let me know if you want me to generate an ER diagram image for your notes or a practice
question!
6/6