1st Week Database-Systems
1st Week Database-Systems
Lecture - 1
By
Ms. Tanvir Fatima
I NSTRUCTOR
Email: [email protected]
GCR:
2
Database Systems
Relational
The Relational
Algebra and
Model
Calculus
S Q L Data S Q L Data
Manipulation
Definition
Database
Planning and E R Modeling
Design
4
C O N T…
E E R Modeling Normalization
Logical Conceptual
D atabase Database
Design Design
Transaction Query
Management Optimization
What is Database
What comes in our mind?
10
FILE PROCESSING SYSTEMS
11
LIMITATIONS OF FILE-BASED
APPROACH
⚫ Separati on and isolation of data
⚫ Each program maintains its own set of data. Users
• of one program may be unaware of potentially useful data held by other
programs.
⚫ Duplicati on of data
⚫ Same data is held by different programs. Wasted
• space and potentially different values and/or different formats for the same
item.
⚫ Atomicity of updates
⚫ Failure may lead database to an inconsistent state
• with partial updates carried out
⚫ E.g. Transfer of funds from one account to another should either be complete
20
or incomplete, no in- between state
LIMITATIONS OF FILE-BASED APPROACH
Data dependence
⚫ File structure is defined in the program code.
Integrity Problems
⚫ Hard to add new constraint or update existing one
21
LIMITATIONS OF FILE-BASED
APPROACH
Fixed Queries/Proliferation of application
programs
⚫ Programs are written to satisfy particular
functions. Any new requirement needs a new
program.
Redundant data can be present in a file system. In DBMS there is no redundant data.
It doesn’t provide backup and recovery of data if it is It provides backup and recovery of data even if it is
lost. lost.
There is no efficient query processing in file system. Efficient query processing is there in DBMS.
File systems provide less security in comparison to DBMS has more security mechanisms as compared
DBMS. to file system.
It is less expensive than DBMS. It has a comparatively higher cost than a file system.
What is “database” & “database systems”?
What is “database” & “database systems”
• Types of data
• Modeling of Data
• Management of Data
• etc
Difference b/w database and data structure
V/S
Difference b/w database and data structure
Database Data Structure
It is a special format for storing data to serve a
It is an organized collection of data.
particular purpose.
It is used for efficiency and to reduce the complexities
It is used to access the data and manage it easily.
of the program.
27
Concepts of Tables in Database
Table is the fundamental object of the database structure. The basic purpose of a table is to
store data. A table consists of rows and columns.
Row/Record/tuple: Rows are the horizontal part of the table. A single row is known as record or
tuple. Table in this slide has 3 records.
Column/field/attribute: Columns are the vertical part of the table. A single column is known as field
or attribute. Above table has 4 fields or attributes.
Relation: In relation model, data is stored in the form of relations. Relation is another name used for
table.
Concepts of Users in Database
Client
1 Database designers interview clients to
Requirement Collection and understand and document their
Analysis requirements
Functional Requirements
Client
1
Requirement Collection and
Analysis
2
Functional
Requirements
What kind of queries will be applied to the database?
transactional queries or analytical queries?
Conceptual Schema
Client
1
Requirement Collection
and Analysis
3
Conceptual
Database Design
Models all of the information gathered in phase1
Includes detailed descriptions of entities and
relationships
Figure: Conceptual Schema
Conceptual Schema= {entities, attributes, relationships}
Logical Database Schema
Client
1 Constraint
Requirement Collection and Enforces limit to the data that can be
Analysis inserted/updated/deleted from a table (e.g. attribute X
3 cannot have duplicate values; attribute Y cannot have
Conceptual
null values)
Database Design
4 Logical Schema = {entities, attributes, constraints, data
Logical types, relationships}
Database Design
Describes what data will be stored (e.g. what tables are used, what
data types are used, what constraints are applied)
Logical Schema
Physical Database Schema
Client
1
Requirement Collection and
Analysis 2
3 Functional
Conceptual Requirements
Database Design
4
Logical SQL code used to build database describes how data
Database Design will be stored (i.e. define index structures and storage
5 layout)
Physical
Database Design
Physical Database Schema
2. Functional Requirements:
Specific to the gaming application. For instance, the database should support player registration, login, character creation, game
session management, saving and loading game progress, and handling multiplayer interactions.
Highest level of data abstraction. This describes the user interaction with
database system.
At external/view level, user just interact with system with the help of GUI
and enter the details at the screen, they are not aware of how the data is
stored and what data is stored; such details are hidden from them.
Logical / Conceptual Level
Logical level: This is the middle level of 3-level data abstraction architecture.
It describes what data is stored in database.
It describes what will be the entities, what will be their attributes and
relationships between them.
Physical / Internal Level
This is the lowest level of data abstraction. It describes how data is actually
stored in database and what type of data will be stored.