0% found this document useful (0 votes)
22 views22 pages

Lesson 1

The document outlines a course on Database Systems at Wayamba University, detailing recommended readings, assessment criteria, and fundamental concepts such as data, databases, and DBMS. It includes definitions of key terms, advantages of computerized databases, and when not to use a DBMS. Additionally, it covers Entity-Relationship (ER) diagrams, their components, and types of relationships between entities.

Uploaded by

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

Lesson 1

The document outlines a course on Database Systems at Wayamba University, detailing recommended readings, assessment criteria, and fundamental concepts such as data, databases, and DBMS. It includes definitions of key terms, advantages of computerized databases, and when not to use a DBMS. Additionally, it covers Entity-Relationship (ER) diagrams, their components, and types of relationships between entities.

Uploaded by

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

HDSE 123

Mr. W. Chamidu Chanaka Premarathna


Wayamba University of Sri Lanka
Recommended Reading
 Fundamentals of Database Systems – Elmasri, Navathe
 Database Management Systems – Raghuramakrishnan,
Gerke
 ANY books about Database Systems
 Internet

2
Assessment Criteria
 Continuous Assessments (Mid semester exam, Tutorials, Quizzes, Presentations) 30%
 Project Presentation / Viva 20%
 End Semester Theory Examination 50%

3
Course Outline

4
Some Basic Definitions
 Data: Known facts that can be recorded and have an implicit meaning
 Database: A collection of related data
 Database Management System (DBMS): A software package/
system to facilitate the creation and maintenance of a computerized
database
 Database System: The DBMS software together with the data itself.
Sometimes, the applications are also included

5
Database System vs. DBMS
 A DBMS is a collection of programs that enable users to create and
maintain a database
 A general purpose software that,
 Define : specifying the data types, structures and constraints for the data
to be stored
 Construct : storing the data on some storage medium that can be
controlled by DBMS
 Manipulate: querying the database to retrieve specific data, update the
database and generating reports
 The database and its DBMS collectively called as the Database
System

6
Advantages of Using the Computerized
Database Approach
1. Controlling redundancy in data storage and in development and
maintenance efforts.
2. Sharing of data among multiple users.
3. Restricting unauthorized access to data.
4. Providing backup and recovery services.
5. Representing complex relationships among data.

7
When not to use a DBMS
 Main costs of using a DBMS
 High initial investment and possible need for additional hardware.
 Overhead for providing generality, security, concurrency control, recovery, and
integrity functions.
 When DBMS may be unnecessary
 If the database and applications are simple, well defined, and not expected to
change
 If there are stringent real-time requirements that may not be met because of
DBMS overhead
 If access to data by multiple users is not required
 When DBMS may not suffice
 If the database system is not able to handle the complexity of data because of
modeling limitations
 If the database users need special operations not supported by the DBMS.
8
Entity- Relationship (ER) Diagrams
○ An Entity–relationship model (ER model) describes the structure
of a database with the help of a diagram, which is known as Entity
Relationship Diagram (ER Diagram). An ER model is a design or
blueprint of a database that can later be implemented as a
database.

9
Components of a ER Diagram

10
1. Entities
○ Entities:
○ Entities are specific objects or things in the mini-world that are
represented in the database.
○ An entity can be a real-world object, either animate or inanimate, that
can be easily identifiable.
○ An entity is represented as rectangle in an ER diagram.
○ For example, in a school database, students, teachers, classes, and
courses offered can be considered as entities.
○ In the following ER diagram we have two entities Student and College

11
○ Weak Entity:

○ An entity that cannot be uniquely identified by its own attributes


and relies on the relationship with other entity is called weak
entity.
○ The weak entity is represented by a double rectangle.
○ For example – a bank account cannot be uniquely identified
without knowing the bank to which the account belongs, so bank
account is a weak entity.

12
2. Attribute
○ Attributes are properties used to describe an entity.
○ All attributes have values. For example, a student entity may have
name, class, and age as attributes.
○ An attribute is represented as Oval in an ER diagram.
○ There are four types of attributes:
1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute

13
○ Key attribute:
○ A key attribute can uniquely identify an entity from an entity set. For
example, student roll number can uniquely identify a student from a
set of students. Key attribute is represented by oval same as other
attributes however the text of key attribute is underlined.

Key Attribute

Simple Attribute

14
○ Composite attribute:
o Composite attributes are made of more than one simple attribute.
o For example, a student's address may have pin number, state and
country.

15
○ Multivalued attribute: ○ Derived attribute:
o Multi-value attributes may ○ Attributes which has values that can
contain more than one values. be derived from other attributes
○ It is represented with double ○ For example, Age; can be derived
from Birthdate
ovals in an ER Diagram.
○ It is represented by dashed oval in
○ For example, a person can an ER Diagram.
have more than one phone
number, email address, etc.
Derived Attribute

Multivalued Attribute

16
3. Relationship

○ A relationship is represented by diamond shape in ER diagram.


○ It shows the relationship among entities.
○ There are four types of relationships:

1. One to One
2. One to Many
3. Many to One
4. Many to Many

17
○ One to One Relationship:
○ When a single instance of an entity is associated with a single instance
of another entity then it is called one to one relationship.
○ For example, a person has only one passport and a passport is given to
one person.

18
○ One to Many Relationship:
○ When a single instance of an entity is associated with more than
one instances of another entity then it is called one to many
relationship.
○ For example – a customer can place many orders but a order
cannot be placed by many customers.

19
○ Many to One Relationship:
○ When more than one instances of an entity is associated with a
single instance of another entity then it is called many to one
relationship.
○ For example – many students can study in a single college but a
student cannot study in many colleges at the same time.

20
○ Many to Many Relationship:
○ When more than one instances of an entity is associated with more
than one instances of another entity then it is called many to many
relationship.
○ For example, a student can be assigned to many projects and a
project can be assigned to many students.

21
Thanks!
22

You might also like