Anda di halaman 1dari 37

1

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

• "Database Systems: Design,


Implementation, and
Management" by Carlos Coronel,
Steven Morris, 13th edition.

6
Reference books
• Database Systems, A Practical approach
to design, implementation and
management”, 6th Edition, by Thomas
Conolly, Carolyn Begg.

• “Oracle 12c, Complete Reference” by


Oracle Press Release.

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: asmairfan.bukc@bahria.edu.pk

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:

Khi Sales Isb


10 Lhr 20
Marketing 30 finance

12
Information
• Data processed to be useful in decision
making

Deptno Deptname Location

10 Sales Khi

20 Marketing Lhr

30 Production Isb

13
Records
Deptno Deptname Location Deptno Deptname Location Empno Salary

10 Sales Khi 10 Sales Khi 101 10000

20 Marketing Lhr 20 Marketing Lhr 102 15000

30 Production Isb 30 Production Isb 103 20000

DEPT 10 Sales Khi 104 25000

20 Marketing Lhr 105 50000

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

3 Bob 52nd Avenue Bronx NY

4 Lee Hung 52nd Avenue Albany NY

5 Richard 999 Palm Bay Detroit MI

6 Tony 15th Avenue Austin TX


Information –Pie Chart, Bar Graph
Data in Context Table 16
Data Verses Information(cont..)
• Data:
7

• 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

• Historically organizations used manual, paper-and-pencil


systems.
• Papers were organized in file folders and filingcabinets.
• Worked well when data was small and businessreporting
requirements were few.
• When data started to grow and reportingrequirements
became more complex:
o Keeping track of data in manual file system became very
difficult.
o Generating reports became slow and cumbersome.

o It was time to look for computerized systems.

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

Accomplished through a system of file folders and filing cabinets

Computerized File Systems


Data processing (DP) specialist: Created a computer-based system that would track data and
produce required reports

File System Redux: Modern End-User Productivity Tools


Includes spreadsheet programs such as Microsoft Excel

22
Files in File Systems
12

• A collection of related bytes, having meaning only tothe


creator
• Can be structured, indexed or free formed
• An entry in adirectory
• Have attributes like:
o Name – information kept in human readableform
o Type – flat file/text file, excel spreadsheet,…
o Location – pointer to file location ondevice
o Size – current file size
o Protection – control on who can do reading, writingand
execution
o Last update time, date, and useridentification

23
Figure 1.8 - A Simple File System

24
File Structures
13

• None (Unstructured) – Sequence of words,bytes


• Simple recordstructure
o Lines
o Fixed length
o Variable length
• Complex Structures
• Formatted document
• Could be in the form of header and detail rows
• Who interprets thesestructures?
• Answer: Programs written in a FileSystem
25
File Access Methods
14

 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

Rewind Read or write

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

0001 Jave Ali 214567 EEN-102 Fall 2012


d
0002 Asif Khan 222333 SEN-442 Spring 2013

0003 Owai Kazmi 233401 MAT-230 Fall 2012


s
0004 Irfa Ahmed 256123 SEN-220 Spring 2013
n

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

Owai Kazmi MAT-230 Fall 2012


s
Irfa Ahmed SEN-220 Spring 2013
n

 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

• Islands of information: Scattered data locations


– Increases the probability of having different versions of
the same data

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

2. Insertion anomalies (Example: Adding agent with dummycustomer)


3. Deletion anomalies (Example: Deleting customers might deleteagent
information)

33
Types of Data Anomaly

Update Anomalies

• An Update Anomaly exists when one or more instances of duplicated


data is updated, but not all.

Insertion Anomalies

• An insertion anomaly is the inability to add data to the


database due to absence of other data.

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

Anda mungkin juga menyukai