0% found this document useful (0 votes)
15 views

5th Lecture (DBMS Model)

The document discusses different database models including the relational, entity-relationship (E-R), and hierarchical models. It provides examples of how data can be represented and related in tables for each model. It also describes key components of the E-R model including entity sets, relationship sets, and how different attribute types are represented. Finally, it categorizes different types of database languages like data definition language (DDL) and data manipulation language (DML) based on their usage.

Uploaded by

MD OHi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

5th Lecture (DBMS Model)

The document discusses different database models including the relational, entity-relationship (E-R), and hierarchical models. It provides examples of how data can be represented and related in tables for each model. It also describes key components of the E-R model including entity sets, relationship sets, and how different attribute types are represented. Finally, it categorizes different types of database languages like data definition language (DDL) and data manipulation language (DML) based on their usage.

Uploaded by

MD OHi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

DBMS Model

Barshan Dev
Lecturer, Dept. of TE, BUFT.

1
Relational model in DBMS

 In relational model, the data and relationships are


represented by collection of inter-related tables. Each
table is a group of column and rows, where column
represents attribute of an entity and rows represents
records.
Sample relationship Model: Student table with 3 columns and four records.

Stu_Id Stu_Name Stu_Age


111 Ashish 23
123 Saurav 22
169 Lester 24
234 Lou 26

2
Course table: Course table

Stu_Id Course_Id Course_Name


111 C01 Science
111 C02 DBMS
169 C22 Java
Computer
169 C39
Networks

Here Stu_Id, Stu_Name & Stu_Age are attributes of table Student


and Stu_Id, Course_Id & Course_Name are attributes of table
Course. The rows with values are the records (commonly known as
tuples).

3
E-R model in DBMS

 An entity–relationship model (ER model) is a


systematic way of describing and defining a business
process. An ER model is typically implemented as a
database. The main components of E-R model are: entity
set and relationship set.
 Here are the geometric shapes and their meaning in an E-
R Diagram –
 Rectangle: Represents Entity sets
 Ellipses: Attributes
 Diamonds: Relationship Set
 Lines: They link attributes to Entity Sets and Entity sets
to Relationship Sets

4
5
E-R diagram with multivalued and derived
attributes:
 Multivalued Attributes: An attribute that can hold multiple
values is known as multivalued attribute. We represent it
with double ellipses in an E-R Diagram. E.g. A person can
have more than one phone numbers so the phone
number attribute is multivalued.

 Derived Attribute: A derived attribute is one whose value


is dynamic and derived from another attribute. It is
represented by dashed ellipses in an E-R Diagram. E.g.
Person age is a derived attribute as it changes over time
and can be derived from another attribute (Date of
birth).

6
E-R diagram with multivalued and derived
attributes:
Double Ellipses: Multivalued Attributes
Dashed Ellipses: Derived Attributes

7
Hierarchical model in DBMS

In hierarchical
model, data is
organized into a tree
like structure with
each record is having
one parent record and
many children. The
main drawback of this
model is that, it can
have only one to many
relationships between
nodes.
Sample Hierarchical Model Diagram:

8
 Example of hierarchical data represented as
relational tables: The above hierarchical model can be
represented as relational tables like this:

Stu_Id Stu_Name Stu_Age


123 Steve 29
367 Chaitanya 27
234 Ajeet 28

Course Table:

Course_Id Course_Name Stu_Id


C01 Cobol 123
C21 Java 367
C22 Perl 367
C33 JQuery 234

9
DBMS languages

 Database languages are used for read, update and store data in a database.
There are several such languages that can be used for this purpose; one of
them is SQL (Structured Query Language).

 Types of DBMS languages:

Data Definition Language (DDL): DDL is used for specifying the database
schema. Let’s take SQL for instance to categorize the statements that comes
under DDL.
 To create the database instance – CREATE
 To alter the structure of database – ALTER
 To drop database instances – DROP
 To delete tables in a database instance – TRUNCATE
 To rename database instances – RENAME
All these commands specify or update the database schema that’s why they
come under Data Definition language.
10
Data Manipulation Language (DML): DML is used for
accessing and manipulating data in a database.
 To read records from table(s) – SELECT
 To insert record(s) into the table(s) – INSERT
 Update the data in table(s) – UPDATE
 Delete all the records from the table – DELETE

11

You might also like