DBMS - Unit 1
DBMS - Unit 1
SYSTEMS
Unit-1: Introduction to DBMS
Introduction to DBMS
● Collection of interrelated data
● Set of programs to access the data
● DBMS contains information about a
particular enterprise
● DBMS provides an environment that is both
convenient and efficient to use.
Database-System Applications
•Enterprise Information
Sales, Accounting, Human Resources, Manufacturing, Online
Retailers
•Universities
Students Information, Course Registration , Grades
•Airlines
Reservation, Flight Schedule
•Telecommunication
Monthly Bills, Customer Information, Pre Paid Call Records,
Recorded calls
DBMS
select customer.customer-name
from customer
where customer.customer-id = ‘192-83-7465’
● E.g. find the balances of all accounts held by the customer
with customer-id 192-83-7465
select account.balance
from depositor, account
where depositor.customer-id = ‘192-83-7465’ and
depositor.account-number = account.account-number
● Application programs generally access databases through one of
● Language extensions to allow embedded SQL
● Application program interface (e.g. ODBC/JDBC) which allow SQL
queries to be sent to a database
Data Models
● A collection of tools for describing
● data
● data relationships
● data semantics
● data constraints
● Entity-Relationship model
● Relational model
● Other models:
● object-oriented model
● semi-structured data models
● Older models: network model and hierarchical model
Entity-Relationship
Model
Example of schema in the entity-relationship model
Entity Relationship Model (Cont.)
● E-R model of real world
● Entities (objects)
● E.g. customers, accounts, bank branch
● Relationships between entities
● E.g. Account A-101 is held by customer Johnson
● Relationship set depositor associates customers with
accounts
● Widely used for database design
● Database design in E-R model usually converted to
design in the relational model (coming up next) which is
used for storage and processing
Relational
Model
● Example of tabular data in the relational model
Attributes
019-28-3746 Smith
North Rye A-215
192-83-7465 Johnson
Alma Palo Alto A-201
321-12-3123 Jones
Main Harrison A-217
019-28-3746 Smith
North Rye A-201
A Sample Relational
Database
Relational Model
• primary data model for commercial data processing applications.
• Simplicity
• Collection of tables
• Hierarchical Model
• Data is arranged using parent-child relationships and a tree-like structure
in the Hierarchical Database Model. Because each record consists of
several children and one parent, it can be used to illustrate one-to-many
relationships in diagrams such as organizational charts. Although
obvious, it might not be as adaptable in complicated partnerships.
Network Model
• Network Model
• The network model and the hierarchical model are quite similar with
an important difference that is related to data relationships. The
network model allows many-to-many relationships whereas
hierarchical models allow one-to-many relationships.
Relational Model
• Relational Model
• The relational model is mainly used for relational
databases, where the data is stored as relations
of the table. This relational model schema is
better for object-oriented programming.
Relational Model
Difference between Logical and Physical
Database Schema
Changes in Physical schema effects the logical Any changes made in logical schema have
schema minimal effect in the physical schema
Physical schema does not include attributes. Logical schema includes attributes.
Physical schema contains the attributes and their Logical schema does not contain any attributes
data types. or data types.
NOT NULL: Prevents NULL values from being entered into the column.
These types of constraints are defined on a single column. By default, Oracle
allows NULL values in any column. A NOT NULL constraint is defined at
the column level; it cannot be defined at the table level.
UNIQUE: Any unique column will not allow duplicate values to be present
in it. However there can be two or more than two NULL in the unique
column (because Null is not equal to Null).
Schema
Diagrams
• A database schema, along with primary key and foreign key
dependencies, can be depicted by schema diagrams.
DEPARTMENT
Course_ID
Faculty_ID Room_No
Course_Name Duration
Faculty_Name
Enrolled Phone_No
by
Gender
STUDENT DoB
Student_ID
Student_Name
THANK
YOU