DBMS Lecture 1 File System
DBMS Lecture 1 File System
Course Objectives
The main objective of this course is to provide students
with the background to design, implement, and use
database management systems. After the completion of
this course students will be able to:
• Model and design Database
• Write Structured Queries and optimize them
• Implement Constraints and Triggers
• Use and develop semi structured databases
2
Course Learning Outcomes
Upon completion of the course, Students will be able to:
• have a broad understanding of database concepts and
database management system software
• have a high-level understanding of major DBMS components
and their function
• be able to model an application’s data requirements using
conceptual modeling tools like ER diagrams and design
database schemas based on the conceptual model.
• be able to write SQL commands to create tables and indexes,
insert/update/delete data, and query data in a relational
DBMS.
• be able to program a data-intensive application using DBMS
APIs.
3
About Theory Course
Course Code: CSC-220
Course Title: Database Management System
Credit Hours: 3
Abbreviation: DBMS
Prerequisite: System Analysis and Design (SEN-
213)
Type of Course: Core Course
Course Description:
Basic database concepts, Database architecture, DB Design Life Cycle, Schema
Architecture, Conceptual, Logical and Physical Database Modelling and design,
Entity Relationship diagram (ERD), Enhanced ERD, Relational data model,
Mapping ERD to relational model, Functional dependencies and
Normalization, Relational Algebra, Structured Query Language (SQL),
Transaction Processing, Concurrency Control and Recovery Techniques, Query
Optimization Techniques.
4
Course Assessment
Quizzes 10% (4 quizzes)
Assignments (Theoretical) (4) 20% (4 assignments)
Midterm Examination 20%
Final Examination 50%
Total 100%
Quizzes
10%
Scoring
Asgns
20%
Final
50%
Midterm
20%
5
Text Book
6
Reference books
• Database Systems, A Practical approach
to design, implementation and
management”, 6th Edition, by Thomas
Conolly, Carolyn Begg.
7
Books In Library
• “Fundamentals of Database
Systems", 7th Ed, by Ramez
Elmasri and Shamkant B. Navathe.
2017
• “Database System: A Practical
Approach to design,
Implementation and
Management” , 4th Ed, by Thomas
Connolly and Carolyn Begg
8
Asma Irfan
Assistant Professor
Department of Computer Science
Site:https://sites.google.com/site/asmairfanbukc
Email: [email protected]
9
Introduction to Databases
Chapter 1
Book: "Database Systems: Design,
Implementation, and Management" by Carlos
Coronel, Steven Morris, 13th edition.
10
Outline
• Why Databases?
• Data Vs. Information
• Manual File Systems
• Computerized File Systems
• File Structures
• File Accessing Methods
• Problems with File System Data Processing
11
Data
• Meaningful fact, text, number, graphics,
images, sound, video segments
• Example:
12
Information
• Data processed to be useful in decision
making
10 Sales Khi
20 Marketing Lhr
30 Production Isb
13
Records
Deptno Deptname Location Deptno Deptname Location Empno Salary
EMP
14
Why Database?
6
• Businesses cannot run without knowing theirdata: customers,
products, prices, employees, wages,etc.?
• Properly maintained data is important indecision making and
hence in the success of abusiness.
• The amount of data utilized in a business can growfast.
Examples:
o Phone companies keep data on trillions of phone calls,adding
70,000 calls per second.
o Google is estimated to perform 91 million searches per day acrossa data
that is several terabytes insize.
• How do these businesses maintain this data? and dosearches on this
data to finddesired information?
• Answer: By usingDatabases
15
Data versus Information
Data Information
• Raw facts • Produced by processing raw data to
– Have not yet been processed to reveal reveal its meaning
their meaning to the end user • Requires context
– e.g. numbers, characters, graphics, – e.g. Total sale for month June, Total
images, audio, video students at Bahria Karachi campus
• Building blocks of information • Bedrock of knowledge
• Data management • Should be accurate, relevant, and
– Generation, storage, and retrieval of timely to enable good decision making
data • Information is what you retrieve from
• Data is what you store in database. a database.
ID Name Address City State
th
1 Andrew SW 16 Ave Orlando FL
rd
2 Robert 23 Terrace Boston MA
• Example:
25612, 22233, SEN-220, SEN-442, Irfan Ahmed, Asif Khan
• Information:
• Example:
Irfan Ahmed with registration Id 25612, is registered for SEN-
320 Asif Khan with registration Id 22233, is registered for
SEN-442
• Raw Data must be properly formatted for storage,processing
and presentation.
17
Data Verses Information(cont..)
8
18
Data Verses Information(cont..)
9
19
Manual File Systems
10
20
Computerized File Systems
11
A computer-based system that would track data stored incomputer
files and produce required reports.
Term Definition
Data “Raw” facts, such as a telephone number, a birth date, a customer name, and a
year-to-date (YTD) sales value. Data have little meaning unless they have been
organized in somelogicalmanner.
Field A character or group of characters (alphabetic or numeric) that has a specific
meaning. A field is used to define and store data.
Record A logically connected set of one or more fields that describes a person, place, or
thing. For example, the fields that constitute a record for a customer might consist
of the customer’s name, address, phone number, date of birth, credit limit, and
unpaid balance.
File A collection of related records. For example, a file might contain data about the
students currently enrolled at a University.
21
Evolution of File System Data Processing
Manual File Systems
22
Files in File Systems
12
23
Figure 1.8 - A Simple File System
24
File Structures
13
Sequential Access
Data is accessed one record right after thelast
Reads cause a pointer to move ahead by one (read next)
Writes allocate spacefor the record and move the pointer to the
new End of File (EOF)mark.
A method widely used with tapeprocessing
current position
beginning end
26
15
File Access Methods(cont..)
Direct Access
File is viewed as a numbered sequence of records or blocks
No restrictions on which record is read/written inwhat order
Programs can say “read n”instead of “read next”, where n is the
position of record
A method used for disks
27
File Access Methods(cont..)
16
Indexed Access
Build on top of Direct Accessmethod
An index is an Identifier for and a pointer to a completerecord
Index Record
222333 Jave Ali EEN-102 Fall 2012
d
256123
Asif Khan SEN-442 Spring 2013
Programs are coded to read and write data to the files based on the
value of index for the record
28
Problems with File System Data
17
Processing
Data Dependency
Must tell program what to do and how to do based on data
(lengthy development times)
Change in file’s data characteristics requires modificationof data
accessprograms
Makes file systems cumbersome from programming anddata
management views
Structural Dependency
Change in file structure requires modification ofrelated
programs
Makes ad hoc queries impossible
29
Problems with File System Data
18
Data Redundancy
Multiple versions of samedata
Results of uncontrolled dataredundancy
Poor Data Security
Multiple copies of data might get accessed byunauthorized
users
Data inconsistency
Conflicting versions of same data appear in different places
Lack of dataintegrity
30
Data Redundancy Example
31
Problems with File System Data(cont..)
19
Data anomalies
1. Update anomalies (Example: Changing agent’s name)
32
Problems with File System Data (cont..)
20
33
Types of Data Anomaly
Update Anomalies
Insertion Anomalies
Deletion Anomalies
• A Delete Anomaly exists when certain attributes are lost because of the
deletion of other attributes.
34
Conclusion
21
• Databases are needed to maintain, analyze and toperform reporting on
data.
• Data are Raw Facts that are not yet been processed toreveal their
meaning.
• Information is the result of processing raw data to reveal its meaning.
• Historical usage of manually filing information createdproblems for large
amount ofdata.
• Asa result, computer based file systems were used.
• File can be structured, unstructured (free formed) orindexed.
• Depending on the structure, data can be accessed fromfiles using
Sequential, Direct or Indexed accessmethods.
• Files systems came with a set of problems.
35
36
37