Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Contents

1. Introduction 1.1—1.14
1.1 Introduction to DBMS 1.1
1.1.1 Structure of DBMS 1.1
1.1.2 Applications of Database 1.2
1.1.3 Classification of Database Management System 1.2
1.2 File Processing System 1.3
1.2.1 Drawbacks of Conventional File Processing System 1.3
1.3 Advantages of Database 1.5
1.4 Disadvantages of Database 1.7
1.5 Views of Data 1.8
1.5.1 Data Abstraction 1.8
1.5.2 Data Independence 1.9
1.5.3 Instances and Schemas 1.9
1.6 Database System Structure 1.9
1.6.1 Database Users and Administrators 1.11
1.6.1.1 Database Users 1.11
1.6.1.2 Database Administrators 1.12
1.6.2 Application Architectures 1.13
Copyright © 2016. Alpha Science International. All rights reserved.

1.6.2.1 Two-tier Architecture 1.13


1.6.2.2 Three-tier Architecture 1.13
Review Questions 1.13

2. Data Models 2.1—2.26


2.1 Data Models 2.1
2.2 Hierarchical Model 2.1
2.3 Network Model 2.2
2.4 Object-Oriented Model 2.3
2.5 Object Relational Model 2.3
2.6 Relational Model 2.4
2.6.1 Characteristics of Relational Model 2.4

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
x Contents

2.6.2 E. F. Codd’s Laws for a Fully Functional Relational Database


Management System 2.4
2.6.3 Principle Components of Relational Model 2.5
2.7 Comparison Between the Various Database Models 2.7
2.8 Entity Relationship Model 2.8
2.8.1 Basic Concepts 2.8
2.8.1.1 Entity 2.8
2.8.1.2 Attributes 2.8
2.8.1.3 Relationships and Relationships Sets 2.9
2.8.2 Constraints 2.10
2.8.2.1 Mapping Cardinalities 2.10
2.8.2.2 Participation Constraint 2.12
2.8.3 Keys 2.12
2.8.4 Entity-Relationship Diagram 2.12
2.8.5 Dependency 2.14
2.8.6 Sample E-R Diagram 2.15
2.8.7 E-R Diagram 2.16
2.8.8 Extended E-R Features 2.19
2.8.8.1 Specialization 2.20
2.8.8.2 Generalization 2.20
2.8.8.3 Aggregation 2.21
2.8.9 Reduction of an E-R Schema to Tables 2.22
2.8.9.1 Tabular Representation of Strong Entity Sets 2.22
2.8.9.2 Tabular Representation of Relationship Sets 2.23
2.8.9.3 Tabular Representation of Weak Entity Sets 2.23
2.8.9.4 Redundancy of Tables 2.24
2.8.9.5 Tabular Representation of Generalization 2.24
2.8.9.6 Tabular Representation of Aggregation 2.25
Review Questions 2.25
Copyright © 2016. Alpha Science International. All rights reserved.

3. The Relational Algebra 3.1—3.21


3.1 Basic operations 3.1
3.2 Additional Operations 3.8
3.3 Extended Relational-Algebra Operations 3.13
3.4 Modification of the Database 3.16
3.5 Relational Calculus 3.17
3.5.1 Tuple Relational Calculus 3.17
3.5.2 Domain Relational Calculus 3.19
Review Questions 3.20

4. SQL-Fundamentals 4.1—4.57
4.1 Introduction 4.1
4.2 Advantages of SQL 4.1

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
Contents xi

4.3 Parts of SQL 4.2


4.4 Domain Types in SQL 4.2
4.5 Terminology 4.3
4.6 Data Definition Language (DDL) 4.3
4.6.1 DDL Commands 4.4
4.7 Data Manipulation Language (DML) 4.7
4.8 Basic Structure of SQL Expression 4.13
4.8.1 General Form of SQL Query 4.13
4.8.2 Selecting all Columns from a Relation 4.13
4.8.3 Selecting Specific Columns 4.14
4.8.4 Usage of DISTINCT Keyword in SELECT Statement 4.14
4.8.5 Usage of ALL Keyword in SELECT Statement 4.15
4.9 Column Alias Name 4.16
4.10 String Operation 4.17
4.11 Concatenation Operation 4.18
4.12 Ordering the Display of Tuples 4.19
4.13 Set Operations 4.20
4.13.1 Union 4.21
4.13.2 Union All 4.22
4.13.3 Intersect 4.22
4.13.4 Minus or Except 4.23
4.14 Where Clause 4.24
4.14.1 Operators in the WHERE Clause 4.25
4.15 Operators 4.27
4.15.1 Arithmetic Operators 4.27
4.15.2 SQL Comparison Operators 4.28
4.15.3 SQL Logical Operators 4.28
4.16 Aggregate Function 4.29
4.16.1 AVG 4.29
Copyright © 2016. Alpha Science International. All rights reserved.

4.16.2 SUM 4.29


4.16.3 MAX 4.30
4.16.4 MIN 4.30
4.16.5 COUNT 4.31
4.16.6 COUNT* 4.31
4.17 Group by Clause 4.32
4.18 Having Clause 4.33
4.19 Nested Subqueries 4.33
4.19.1 Subqueries with the SELECT Statement 4.34
4.19.2 Subqueries with the INSERT Statement 4.34
4.19.3 Subqueries with the UPDATE Statement 4.35
4.19.4 Subqueries with the DELETE Statement 4.36

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
xii Contents

4.20 Null values 4.37


4.21 Database Objects 4.37
4.21.1 Tables 4.37
4.21.2 Views 4.38
4.21.2.1 Advantages of View 4.39
4.21.2.2 Creating Views 4.39
4.21.2.3 The WITH CHECK OPTION 4.40
4.21.2.4 Updating a View 4.40
4.21.2.5 Inserting Rows into a View 4.41
4.21.2.6 Deleting Rows into a View 4.41
4.21.2.7 Dropping Views 4.42
4.21.3 Sequences 4.42
4.21.3.1 Creating a Sequence 4.42
4.21.3.2 Dropping a Sequence 4.43
4.21.3.3 Using a Sequence 4.43
4.21.4 Triggers 4.44
4.21.4.1 Benefits of Triggers 4.44
4.21.4.2 Creating Triggers 4.44
4.21.4.3 Types of Triggers 4.45
4.21.4.4 Trigger Execution Hierarchy 4.45
4.21.4.5 Triggering a Trigger 4.46
4.21.4.6 Disabling Triggers 4.47
4.21.4.7 Enabling Trigger 4.47
4.21.4.8 Dropping triggers 4.47
4.21.5 Indexes 4.47
4.21.5.1 The CREATE INDEX Command 4.48
4.21.5.2 The DROP INDEX Command 4.48
4.21.5.3 When should indexes be avoided? 4.49
4.22 DCL (Data Control Language) 4.49
Copyright © 2016. Alpha Science International. All rights reserved.

4.22.1 GRANT Command 4.49


4.22.2 REVOKE Command 4.50
4.22.3 Privileges and Roles 4.50
4.22.4 Creating Roles 4.51
4.23 TCL (Transaction Control Language) 4.52
4.23.1 The COMMIT Command 4.52
4.23.2 The ROLLBACK Command 4.53
4.23.3 The SAVEPOINT Command 4.54
4.23.4 The RELEASE SAVEPOINT Command 4.55
4.23.5 The SET TRANSACTION Command 4.55
Review Questions 4.55

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
Contents xiii

5. Joins, Constraints and Advanced SQL 5.1—5.33


5.1 Joins 5.1
5.1.1 Joins Types 5.2
5.1.1.1 Inner Join 5.3
5.1.1.2 Left Join 5.3
5.1.1.3 Right Join 5.4
5.1.1.4 Full Join 5.5
5.1.1.5 Self Join 5.6
5.1.1.6 Cartesian Join 5.6
5.2 Constraints 5.7
5.2.1 Types of Constraints 5.8
5.2.1.1 DOMAIN Integrity Constraints 5.8
5.2.1.2 Entity Integrity Constraints 5.10
5.2.1.3 Referential Integrity Constraints 5.12
5.2.1.4 Index Constraint 5.13
5.2.1.5 Default Constraint 5.14
5.2.1.6 Assertion 5.15
5.3 Security 5.15
5.3.1 Authorization 5.16
5.3.2 Roles 5.17
5.3.3 Authorization and Views 5.17
5.3.4 Granting of Privileges 5.18
5.3.4.1 Authorization Grant Graph 5.18
5.3.5 Audit Trails 5.19
5.3.6 Limitations of SQL Authorization 5.19
5.3.7 Encryption 5.19
5.3.8 Authentication (Challenge Response System) 5.20
5.3.9 Digital Certificates 5.20
Copyright © 2016. Alpha Science International. All rights reserved.

5.4 Embedded SQL 5.21


5.4.1 Host Variables 5.21
5.4.2 Indicator Variables 5.23
5.4.3 SQL Communications Area (SQLCA) 5.23
5.4.4 Cursors 5.24
5.4.5 Transaction Control 5.24
5.5 Dynamic SQL 5.25
5.6 Distributed Databases 5.26
5.6.1 Features of Distributed Databases 5.27
5.6.2 Types of Distributed Databases 5.27
5.6.3 Components of a Distributed Databases 5.28
5.6.4 Distributed Data Storage 5.28

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
xiv Contents

5.6.4.1 Data Replication 5.29


5.6.4.2 Data Fragmentation 5.29
5.6.4.3 Transparency 5.29
5.6.5 Advantages of Distributed System 5.30
5.6.6 Disadvantages of Distributed System 5.30
5.7 Client/Server Databases 5.30
5.7.1 Two-tier Architecture 5.31
5.7.2 Three-tier Architecture 5.31
5.7.3 Merits of Client/Server Computing 5.32
Review Questions 5.33

6. Relational Database Design 6.1—6.24


6.1 Introduction 6.1
6.2 Anomalies in Databases 6.1
6.3 Redundant Information 6.2
6.4 Functional Dependency 6.2
6.4.1 Notation of Functional Dependency 6.2
6.4.2 Compound Determinants 6.3
6.4.3 Types of Functional Dependency 6.3
6.4.4 Uses of Functional Dependency 6.4
6.5 Closure of a Set of Functional Dependencies 6.4
6.5.1 Armstrong’s Axioms 6.4
6.5.2 Additional Rules 6.4
6.5.3 Closure of Attribute Sets 6.5
6.6 Canonical Cover 6.6
6.6.1 Extraneous Attributes 6.7
6.6.2 Computing a Canonical Cover 6.8
6.7 Normalization 6.8
6.7.1 Purpose of Normalization 6.9
Copyright © 2016. Alpha Science International. All rights reserved.

6.7.2 Normalization Forms 6.9


6.7.3 First Normal Form (1NF) 6.9
6.7.4 Second Normal Form (2NF) 6.11
6.7.5 Third Normal Form (3NF) 6.14
6.7.5.1 Summary of Normal Forms 6.15
6.8 Loss Less Decomposition 6.15
6.9 Dependency Preservation 6.16
6.10 Boyce Codd Normal Form (BCNF) 6.16
6.10.1 Testing Decomposition of BCNF 6.19
6.11 Multi Valued Dependencies & Fourth Normal Form (4NF) 6.19
6.11.1 Multi Valued Dependencies (MVD) 6.19
6.11.2 Fourth Normal Form 6.20

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
Contents xv

6.12 Join Dependencies & Fifth Normal Form (5NF) 6.22


6.12.1 Join Dependencies 6.22
6.12.2 Fifth Normal Form (5NF) 6.22
Review Questions 6.24

7. Transaction Processing 7.1—7.12


7.1 Introduction 7.1
7.1.1 Transaction Concepts 7.1
7.2 Reasons for Transaction Failures 7.4
7.3 Transaction and System Concepts 7.4
7.3.1 Transaction States and Additional Operations 7.5
7.3.2 State Transition of a State Transition Diagram 7.5
7.4 The System Log 7.6
7.5 Acid Properties or Transaction Properties 7.7
7.6 Serializability 7.8
7.6.1 Schedules and Serializability 7.9
7.6.2 Conflict Serializability 7.9
7.6.3 View Serializability 7.11
7.6.4 Testing for Serializability 7.12
Review Questions 7.12

8. Concurrency Control 8.1—8.19


8.1 Introduction 8.1
8.2 Three Concurrency Problems 8.1
8.2.1 The Lost Update Problem 8.1
8.2.2 The Uncommitted Dependency Problem 8.2
8.2.3 The Inconsistent Analysis Problem 8.3
8.2.4 Primary Operations Leading to Concurrency Problems 8.4
8.3 Locking 8.5
8.3.1 Locking Protocol or Data Access Protocol 8.5
Copyright © 2016. Alpha Science International. All rights reserved.

8.4 Strict Two Phase Locking Protocol 8.6


8.4.1 Last Update Problem 8.6
8.4.2 The Uncommitted Dependency Problem 8.7
8.4.3 The Inconsistent Analysis Problem 8.7
8.5 Deadlock 8.8
8.5.1 Deadlock Detection 8.9
8.5.2 Deadlock Avoidance 8.10
8.5.2.1 Other Technique that can be used to Prevent the Deadlock Situation 8.11
8.5.3 Deadlock Recovery 8.12
8.5.3.1 Choice of Deadlock Victim 8.12
8.5.3.2 Detection Versus Prevention 8.13

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
xvi Contents

8.6 Isolation Level 8.13


8.6.1 Phantoms 8.14
8.7 Intent Locking 8.14
8.8 Dropping Acid 8.15
8.8.1 Immediate Check for Constraint 8.16
8.9 SQL Facilities 8.18
Review Questions 8.19

9. Database Recovery Techniques 9.1—9.14


9.1 Introduction 9.1
9.2 Different Types of Database Failures 9.1
9.2.1 Recovery Facilities 9.2
9.2.2 Main Recovery Techniques 9.3
9.3 Transaction Recovery 9.3
9.4 System Recovery 9.4
9.4.1 System Failure and Recovery 9.5
9.5 Media Recovery 9.6
9.6 Crash Recovery 9.6
9.7 Recovery Manager 9.6
9.8 Aries Algorithm 9.7
9.8.1 Terminologies Used in Aries 9.7
9.8.2 Elements of Aries 9.9
9.9 Two Phase Commit 9.11
9.9.1 Working 9.11
9.10 Savepoints 9.12
9.11 SQL Facilities for Recovery 9.12
Review Questions 9.14

10. Record Storage 10.1—10.17


10.1 Introduction 10.1
Copyright © 2016. Alpha Science International. All rights reserved.

10.2 Physical Storage Media Overview 10.3


10.2.1 Storage Device Hierarchy 10.4
10.3 Magnetic Disk 10.5
10.3.1 Physical Characteristics 10.5
10.3.2 Disk Controller 10.6
10.3.3 Disk Performance Measurement 10.6
10.3.4 Optimization of Disk-Block Access 10.7
10.4 Raid 10.8
10.4.1 Data Striping 10.9
10.4.2 Redundancy 10.9
10.4.3 Raid Levels 10.10
10.4.4 Choice of Raid Level 10.15

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
Contents xvii

10.4.5 Hardware Issues 10.15


10.5 Tertiary Storage 10.16
10.5.1 Optical Disks 10.16
10.5.2 Magnetic Tapes 10.17
Review Questions 10.17

11. Physical Database Design 11.1—11.13


11.1 Introduction 11.1
11.2 Physical Design Steps 11.1
11.3 Operations in Files 11.2
11.4 File Organization 11.3
11.4.1 Fixed-Length Records 11.4
11.4.2 Variable-Length Records 11.7
11.4.2.1 Byte-String Representation 11.7
11.4.2.2 Fixed-Length Representation 11.8
11.5 Organization of Records in Files 11.10
11.5.1 Sequential File Organization 11.10
11.5.2 Clustering File Organization 11.12
Review Questions 11.13

12. Indexing and Hashing 12.1—12.16


12.1 Introduction 12.1
12.2 Ordered Indices 12.2
12.2.1 Primary Index 12.2
12.2.2 Secondary Indices 12.3
12.2.3 Multilevel Indices 12.4
12.3 B+ Tree 12.5
12.3.1 Structure of B+ Tree 12.5
12.3.2 Queries on B+ Trees 12.6
12.4 Hashing Techniques 12.7
Copyright © 2016. Alpha Science International. All rights reserved.

12.4.1 Hash Functions 12.7


12.4.2 Handling of Bucket Overflows 12.7
12.4.3 Hash Indices 12.9
12.4.4 Dynamic Hashing 12.10
12.4.5 Extendable Hashing 12.10
12.4.6 Queries and Updates 12.11
12.4.7 Comparison with Other Schemes 12.16
Review Questions 12.16

13. Query Processing 13.1—13.18


13.1 Introduction 13.1
13.2 Steps in Query Processing 13.1

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
xviii Contents

13.3 Measures of Query Cost 13.3


13.4 Selection Operation 13.4
13.4.1 Basic Algorithms 13.4
13.4.2 Selections Using Indices 13.4
13.4.3 Selections Involving Comparisons 13.5
13.4.4 Implementation of Complex Selections 13.5
13.5 Sorting 13.6
13.5.1 External Sort Merge Algorithm 13.7
13.6 Join Operation 13.8
13.6.1 Nested-Loop Join 13.9
13.6.2 Block Nested-Loop Join 13.9
13.6.3 Indexed Nested-Loop Join 13.10
13.6.4 Merge Join or Sort-merge Join 13.11
13.6.5 Hash Join 13.12
13.7 Database Tuning 13.14
13.7.1 Types of Database Tuning 13.15
13.8 Evaluation of Expressions 13.16
13.8.1 Materialization 13.16
13.8.2 Pipelining 13.17
13.8.3 Implementation of Pipelining 13.17
Review Questions 13.18

14. PL/SQL 14.1—14.71


14.1 Introduction 14.1
14.1.1 Structure if PL/SQL 14.2
14.2 PL/SQL Language Elements 14.3
14.3 PL/SQL Scalar Data Types 14.5
14.4 Variable Declaration in PL/SQL 14.9
14.4.1 Initializing Variables in PL/SQL 14.10
Copyright © 2016. Alpha Science International. All rights reserved.

14.4.2 Variable Scope in PL/SQL 14.11


14.4.3 Assigning SQL Query Results to PL/SQL Variables 14.12
14.4.4 Declaring a Constant 14.15
14.5 PL/SQL Operator 14.17
14.5.1 Arithmetic Operators 14.17
14.5.2 Relational Operators 14.17
14.5.3 Comparison Operators 14.18
14.5.4 Logical Operators 14.18
14.5.5 PL/SQL Operator Precedence 14.18
14.6 PL/SQL Control Structure 14.19
14.6.1 Conditional Control 14.19
14.6.2 Iterative Control 14.27

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
Contents xix

14.6.2.1 Labeling a PL/SQL Loop 14.35


14.6.2.2 The Loop Control Statements 14.36
14.7 PL/SQL Strings 14.41
14.7.1 Declaring String Variables 14.42
14.7.2 PL/SQL String Functions and Operators 14.43
14.8 PL/SQL Arrays 14.47
14.8.1 Creating a VARRAY Type 14.47
14.9 PL/SQL Subprogram 14.49
14.9.1 Parts of a PL/SQL Subprogram 14.50
14.9.1.1 PL/SQL Procedure 14.50
14.9.1.2 Creating a Procedure 14.51
14.9.1.3 Deleting a Standalone Procedure 14.53
14.9.1.4 Parameter Modes in PL/SQL Subprograms 14.53
14.9.2 PL/SQL Functions 14.54
14.9.2.1 PL/SQL Recursive Functions 14.58
14.9.2.2 Parameters 14.59
14.10 PL/SQL Cursors 14.60
14.10.1 Implicit Cursors 14.60
14.10.2 Explicit Cursors 14.62
14.11 PL/SQL Packages 14.64
14.11.1 Creating a Package 14.65
14.11.2 Referencing Package Subprograms 14.66
14.11.3 Removing a Package 14.66
14.11.4 Parts of Package 14.66
14.12 PL/SQL Exception 14.68
14.12.1 Raising Exceptions 14.69
14.12.2 User-defined Exceptions 14.70
14.12.3 Pre-defined Exceptions 14.70
Review Questions 14.71
Copyright © 2016. Alpha Science International. All rights reserved.

15. Data Mining & Data Warehousing 15.1—15.33


15.1 Introduction 15.1
15.1.1 What is Data Mining? 15.1
15.1.2 Essential Step in the Process of Knowledge Discovery in Databases 15.1
15.1.3 Architecture of a Typical Data Mining System 15.2
15.2 Data in Data Mining 15.3
15.2.1 Advanced Database Systems and Advanced Database Applications 15.4
15.3 Data Mining Functionalities 15.5
15.4 Classification of Data Mining Systems 15.7
15.5 Primitives for Specifying a Data Mining Task 15.8
15.6 Integration of a Data Mining System with a Data Warehouse 15.8

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.
xx Contents

15.7 Issues in Data Mining 15.10


15.8 Data Preprocessing 15.11
15.8.1 Data Cleaning 15.12
15.8.1.1 Missing Values 15.13
15.8.1.2 Noisy Data 15.13
15.8.1.3 Data Cleaning as a Process 15.14
15.8.1.4 Disadvantages in data cleaning process 15.15
15.8.2 Data Integration 15.15
15.8.2.1 Handling Redundant Data in Data Integration 15.16
15.8.3 Data Transformation 15.16
15.8.3.1 Normalization 15.16
15.8.4 Data Reduction Techniques 15.17
15.8.4.1 Data Cube Aggregation 15.17
15.8.4.2 Attribute Sub Selection 15.18
15.8.4.3 Dimensionality Reduction 15.19
15.8.4.4 Numerosity Reduction 15.21
15.8.5 Data Discretization and Concept Hierarchies 15.23
15.8.5.1 Concept Hierarchy Generation for Category Data 15.23
15.9 Data Warehouse Introduction 15.24
15.10 Terminology 15.25
15.11 Benefits of Data Warehousing 15.25
15.12 Data Warehouse Characteristics 15.26
15.13 Data Warehouse Architecture and its Seven Components 15.26
15.14 Classification of Data Warehouse Design 15.29
15.14.1 Logical Design 15.29
15.14.2 Physical Design 15.31
Review Questions 15.33

Index I.1—I.8
Copyright © 2016. Alpha Science International. All rights reserved.

Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). Database management systems. Alpha Science International.
Created from charismau-ebooks on 2024-03-31 02:42:18.

You might also like