Download presentation
Presentation is loading. Please wait.
1
CSCS 213 DATABASE SYSTEMS
2
System ?
3
System is a collection of integrated parts which work together to achieve some objective
? ? ? ?
4
System System Working together Objective
Collection of integrated parts Working together Objective
5
System INTEGRATED PARTS ?
6
INTEGRATED PARTS System Parts necessary for the survival of each other
7
? EXAMPLE INTEGRATED PARTS System Parts
necessary for the survival of each other ? EXAMPLE
8
System WHY WORK TOGETHER ?
9
If they do not, system will CRASH.
WHY WORK TOGETHER If they do not, system will CRASH.
10
? EXAMPLE
11
? EXAMPLE POLICE system
12
? ANY OTHER EXAMPLE
13
The desired destination
OHBJECTIVE ? The desired destination
14
Database
15
Database Data
16
1 Data Material General Raw Unordered Unorganized Meaningless
17
Collection of facts and figures
2 Data Raw Material Mostly used Collection of facts and figures
18
Any thing that is acceptable
Data Fact Any thing that is acceptable
19
Data Examples: Facts Education: MBA Aslam Color: Red Green 20
20
Any thing that is countable
Data Figure Any thing that is countable
21
Data Examples: Figures Age(Yrs): 25 Salary(Rs): 50,000/-
22
Artificial Intelligence
Data Example Class Roster Course: CS Semester: Fall Developments in IT Section: A Name ID Major GPA Asad 993124 Databases 3.5 Aslam 992134 Data Communications 3.4 Waheed 992314 Software Engg. 3.2 Babur 992112 Kaleem 991111 Artificial Intelligence
23
Data Summary Raw Material with no useful meaning Unorganized Material
Collection of facts and (or) figures Material to be processed Telephone Conversation: Electrical signals in wires Word processor letter: stored on floppy disk 123, A+, 71, Aslam, 20/4/2000.
24
DATA Why do we need data?
25
Data is the key to success for organizations to run businesses.
Required for the survival of the organizations Required for competitive initiatives: Improving customer satisfaction Facilitating teamwork Developing new products & markets Providing faster response Assuring quality …….
26
Data must be secured and protected from destruction and misuse.
Limitations Data can be an asset only if: It is accurate It is available when needed Organization must store, organize & manage its data Data must be secured and protected from destruction and misuse.
27
DATA Limitations No redundant data No inconsistent data
One copy of each data item Almost no duplication No inconsistent data No contradiction of data Inconsistent Performance by Pakistan Cricket Team Age Age 25 25 Saeed =145 Saeed =03
28
DATA Limitations Less maintenance Shared access to data
29
Data Types of Data Numeric Non-Numeric
30
Data 234 2.64 Integer Float Numeric Data Digits
Numbers Integer Float 0, 1, 2, 3, 4, ……, 8, 9 234 2.64
31
Data Non-Numeric Data Alphabetic Data Alpha-Numeric Data
32
Characters (Alphabets)
Data Alphabetic Data Characters (Alphabets) Strings a, b, c, d, ……, y, z Aslam, BS(CS)
33
Data Combination of Alphabetic and Numeric data
Alpha-Numeric Data Combination of Alphabetic and Numeric data 23-E-III, Gulberg-III, Lahore.
34
Data ? Information
35
Information Items of knowledge Anything having meaning to people
Organized material Processed data A list of names, addresses etc. Contents of a letter Telephone Conversation Words of a song A map, graph
36
Information Information is used for performance measurement and decision making. Data and Information are conceptual resources of an organization.
37
Information Example
38
Information Example
39
Comparision of Cricket Scores on screen
Information Example Comparision of Cricket Scores on screen
40
DATA PROCESSING CYCLE Sequence of operations for
data collection, input, process, output
41
DATA PROCESSING CYCLE Data collection Input (Select) Process(Action)
Output(Result) Data collection Output Input Process
42
DATA PROCESSING TYPES Manual Data Processing
Electronic Data Processing
43
Manual Data Processing (Manual Information System)
Customer file Order file Sales Dept. Sales order Orders Dept. Accounting Dept. Product file Work order Work order file Packing slip Customer Invoice Invoice File Manufacturing & Store
44
Manual Data Processing (Manual Information System)
All record keeping done with the help of registers. Communication manually (or telephonically). Each department having its own record system to support its operations. Data files are decentralized. Each department works with a subset of the organization’s data.
45
Manual Data Processing (Manual Information System)
Drawbacks A constant stream of intra-company paperwork (memos, reports etc.) and telephone calls is required to communicate changes and keep the files synchronized. No answers to complex operational questions. Summary information required for decision making is not easily available to the managers. Data redundancy and inconsistency.
46
Typical User Questions
Department File Typical Question Sales Customer What is customer XYZ’s address and credit limit? Orders Product How many chairs (product no. 157) do we have in stock? Accounting Invoice How much customer XYZ owe us on invoice no. 253? Sample Complex Question: How many units of product 123 were sold on 26/04/2001 and at what rate?
47
Electronic Data Processing
Computer is involved
48
Computer HARDWARE SOFTWARE
49
All the physical components
HARDWARE All the physical components
50
All the programs and data
SOFTWARE All the programs and data
51
PROGRAM A set of instructions
52
Electronic Data Processing
File Processing System Database System
53
FILE PROCESSING SYSTEM
54
File Processing Systems
A traditional approach Each department having its own data processing system. A separate program to meet the user requests.
55
File Processing Systems
Drawbacks Data redundancy Duplication of data in different files Data inconsistency Difficulty in accessing data Data isolation — multiple files Limited Data Sharing No concurrent access by multiple users Inflexibility Security problems Excessive maintenance Database systems offer solutions to all the above problems
56
DATABASE SYSTEM
57
Database ? Collection of Tables(files)
58
Database ? Table Collection of records
59
Database Table Name ID Major GPA Asad 993124 Marketing 3.5 Aslam
992134 Finance 3.4 Waheed 992314 Management 3.2 Babur 992112 IT Kaleem 991111 Saleem 992104 3.1 Record Example
60
Database What is a record? Where do we collect records?
61
Database Record Collection of field values
62
Database Field An attribute of an entity
63
Database Attribute Property of an entity
64
Any thing about which data is stored.
Database Entity Any thing about which data is stored.
65
Database Entity Examples: Specific person, company, event
66
Database Entity Example:
An entity is represented by a set of attributes. Example: customer = (cust-id, name, street-no, city)
67
Attributes Example STUDENT Attributes Entity STUDENT NO NAME ADDRESS
PHONE NO STUDENT Attributes Entity
68
Attribute Example Attributes EMPLOYEE:
EMPLOYEE NO, NAME, ADDRESS, SKILL Attributes
69
Attribute Types Simple and composite attributes.
Single-valued and multi-valued attributes Derived attributes Can be computed from other attributes E.g. age, from date of birth
70
Derived E.g. age, from date of birth
Attribute Types Examples Simple Composite Single-valued Multi-valued Derived E.g. age, from date of birth GPA=3.5
71
Composite and Component Attributes
Name Composite Attribute First Name Middle Name Last Name Component Attributes
72
Domain The set (range) of permitted values for each attribute
Attribute does not accept value out of the given domain. The special value null is a member of every domain.
73
Domain for Grade attribute here is
Example Domain Roll No Grade 1 A 2 B 3 F 4 C Domain for Grade attribute here is { A, B, C, D, F }
74
ENTITY Examples Person: Place: Event: Concept:
Employee, Student, Patient Place: State, Region, Country Event: Sale, Registration, Renewal Concept: Account, Course, Work Center
75
Database Value Data
76
Database Summary Value Field Record Table Database
77
Database Summary Value Field Field Field Record Record Table Table
Name ID Major GPA Asad 993124 Marketing 3.5 Aslam 992134 Finance 3.4 Waheed 992314 Management 3.2 Record Record Table Table Database
78
Database Data is generally unorganized
Database provides a way to store data in an organized way
79
Database How to organize data ?
80
By categorizing, data is organized
Database By categorizing, data is organized
81
Data Non-categorized 123, Aslam, 71, A+, Lahore
82
Data is categorized into tables.
Data Categorized ID Name Marks Grade City 123 Aslam 71 A+ Lahore Data is categorized into tables.
83
A place where data is stored.
Database Collection of organized data. A database consists of multiple tables. A place where data is stored.
84
Database Applications
Banking: All transactions Airlines: Reservations Schedules Universities: Registration Grades Sales: Customers Products Purchases Manufacturing: Production Inventory Orders Supply chain Human resources: Employee records Salaries Tax deductions Databases touch all aspects of our lives
85
Database System Computerized record keeping system,
to maintain information and to make information available on demand.
86
Database Systems = Computerized Record-keeping System
87
Shared corporate database
Marketing Management Corporate Database Materials Accounting Manufacturing
88
Types of Databases Centralized Databases Distributed Databases
89
Centralized Databases
All the data are located at a single site. Users at remote sites access the database using data communication facilities. Provides greater control over accessing and updating data than distributed databases. More chances to failure since the availability of the resources at the central site. Applications: Airline Reservation Systems Financial Institutions ISP’s
90
Centralized Databases
Central Computer
91
Centralized Databases
Client: A software application that requests the services from one or more servers. Server: (The server is the DBMS itself) A software application that provides the services to requesting clients. Database processing is performed on the database server
92
Distributed Databases
Multi-national organizations Geographically dispersed A distributed database is a single logical database that is spread physically across computers in multiple locations connected by a data communication network. A user requesting data need not know the location of the data. Any request to retrieve or update data at a non-local site is automatically forwarded by the system to the requested site. The user is unaware of the distribution of data, and all data in the network appear as a single logical database.
93
Distributed Database Architecture
Location B Location A Database Database Computer Computer Database Computer Location C
94
Database Management System
A software system that is used to create, maintain and provide controlled access to user databases. DBMS provides an environment that is both convenient and efficient to use.
95
Architecture of Database System
DBMS Users Application Programs Database DBA Users Client Database Server
96
Data to Information Lahore $150 Aslam xyz 5% INVOICE DATABASE DBMS
Processing INVOICE Name: Aslam City: Lahore Date: Nov. 15, 2003 Books $15 Others $20 Discount $5 Total $30 Information
97
Keys in DBMS Every entity must have an attribute that uniquely identifies each record and clearly distinguishes that record from other records of the same entity. Key An attribute used to identify a record uniquely is called key.
98
Types of Keys in DBMS Candidate Key
All columns capable to become the Key. Some entities may have more than one candidate key.
99
Example Two candidate keys
RNo RegNo Name PhNo 992132 1245 Smith 991231 1456 Miller 991253 1324 Scott 991251 1233 King
100
Types of Keys in DBMS Primary Key
If there are more than one candidate keys, the designer must choose one of the candidate keys as the identifier for the entity. This selected candidate key is called primary key. It always contains unique values for each record. It is not NULL at all. Only one Primary Key in a table.
101
Types of Keys in DBMS Alternative Key
Out of candidate keys, one attribute would be selected for the primary key, remaining candidates keys will become alternative keys. Alternative keys are alternatives to primary key.
102
Primary key STUDENT Primary key STUDENT NO NAME ADDRESS
PHONE NO STUDENT Primary key
103
Example Two candidate keys
Primary Key Alternate Key RNo RegNo Name PhNo 992132 1245 Smith 991231 1456 Miller 991253 1324 Scott 991251 1233 King
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.