0% found this document useful (0 votes)
2 views8 pages

CSC232 Introduction to Database System Lect 2

The document provides an overview of relational databases, focusing on the structure of tables, rows, and columns, as well as the Entity Relationship (ER) model. It explains key components of the ER model, including entities, attributes, and relationships, along with their characteristics and examples. Additionally, it discusses converting ER diagrams to relational schemas.

Uploaded by

David Victor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

CSC232 Introduction to Database System Lect 2

The document provides an overview of relational databases, focusing on the structure of tables, rows, and columns, as well as the Entity Relationship (ER) model. It explains key components of the ER model, including entities, attributes, and relationships, along with their characteristics and examples. Additionally, it discusses converting ER diagrams to relational schemas.

Uploaded by

David Victor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Concept of Relational Database

Tables, Rows, and Columns


Introduction to Entity Relationship (ER) Model
ER Diagram
Visualization
Components of ER Model: Entities, Attributes, and Relationships
Creating ER Diagrams
Converting ER Diagrams to Relational Schemas
Concept of Relational Database Contd
Tables, Rows, and Columns
Tables
A table, also known as a relation in relational database terminology, is the
fundamental structure for storing data in a relational database. Each table
represents a specific entity within the database, such as customers,
products, or orders.
Characteristics
- Name: Each table has a unique name within the database that identifies it.
- Schema: The schema of a table defines its structure, including the table
name, column names, data types, and any constraints applied to the
columns.
Example:
Concept of Relational Database Contd
Tables, Rows, and Columns
Rows
A row, also known as a record or tuple, represents a single, implicitly structured data
item in a table.
Characteristics
- Unique Identification: Each row can be uniquely identified within a table by the
primary key. The primary key is one or more columns that contain unique values for
each row.
- Data Entry: Each row contains specific data values for each column, capturing the
state of an entity at a specific point in time.
Example
Continuing with the `Customers` table, a row representing a single customer might
look like this:
Concept of Relational Database Contd
Tables, Rows, and Columns

Columns
Definition
A column, also known as an attribute or field, defines a particular type of data stored in a
table.
Characteristics
- Data Type: Each column has a defined data type (e.g., INTEGER, VARCHAR, DATE) that
dictates the kind of data it can store.
- Constraints: Columns can have constraints applied to them, such as NOT NULL (which
means the column cannot store NULL values), UNIQUE (which ensures all values in the
column are unique), and DEFAULT (which provides a default value if none is specified).
- Column Name: Each column within a table has a unique name that identifies it.
Example
In the `Customers` table, the columns and their characteristics are as follows:
CustomerID, FirstName, LastName, Email, DateOfBirth
Introduction to Entity Relationship (ER)
Model
Definition
The Entity Relationship (ER) model is a conceptual framework used to describe the
data and its relationships within a database. Introduced by Peter Chen in 1976, the ER
model provides a graphical representation of the logical structure of a database,
focusing on entities, their attributes, and the relationships between them.
Key Components of the ER Model
1. Entities
- Definition: An entity is a distinct object or thing in the real world that can be
distinctly identified. Entities represent objects or concepts that have a significant role
in the domain being modeled.
- Example: In a university database, entities might include `Student`, `Course`, and
`Professor`.
Key Components of the ER
Model Contd.
2. Attributes
- Definition: Attributes are the properties or characteristics of an entity. Each attribute
represents a specific piece of information about the entity.
- Types
- Simple Attributes: Indivisible attributes, such as `FirstName` and `LastName`.
- Composite Attributes: Attributes that can be subdivided into smaller parts, such as
`FullName` which can be divided into `FirstName` and `LastName`.
- Derived Attributes: Attributes that can be derived from other attributes, such as `Age`
derived from `DateOfBirth`.
- Multi-valued Attributes: Attributes that can have multiple values, such as `PhoneNumbers`
for a person who has more than one phone number.
- Example: For the `Student` entity, attributes might include `StudentID`, `Name`, `Email`, and
`DateOfBirth`.
Key Components of the ER Model Contd.
3. Relationships
- Definition: Relationships describe how entities are related to one another. They
represent the associations between entities.
- Types:
- One-to-One (1:1): Each instance of one entity is associated with a single
instance of another entity.
- One-to-Many (1:N): An instance of one entity is associated with multiple
instances of another entity.
- Many-to-Many (M:N): Instances of one entity are associated with multiple
instances of another entity, and vice versa.
- Example: A `Student` enrolling in a `Course` represents a relationship. One
student can enroll in many courses, and one course can have many students, making
it a many-to-many relationship.
Key Components of the ER Model Contd.

4. Entity Sets and Relationship Sets


- Entity Set: A collection of similar entities. For instance, the `Student`
entity set consists of all students in the database.
- Relationship Set: A collection of similar relationships. For example,
the `Enrolls` relationship set includes all enrollments of students in
courses.

You might also like