0% found this document useful (0 votes)
3 views

Database Notes

The document provides comprehensive notes on database system theory, covering topics such as definitions, manual and computerized file systems, database systems, and their components. It discusses the advantages and disadvantages of database systems, functionality of DBMS, data independence, and client-server architecture. Additionally, it includes information on data flow diagrams, ER diagrams, and EER diagrams, along with common mistakes in DFDs and the database application development process.

Uploaded by

aaima8447
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Database Notes

The document provides comprehensive notes on database system theory, covering topics such as definitions, manual and computerized file systems, database systems, and their components. It discusses the advantages and disadvantages of database systems, functionality of DBMS, data independence, and client-server architecture. Additionally, it includes information on data flow diagrams, ER diagrams, and EER diagrams, along with common mistakes in DFDs and the database application development process.

Uploaded by

aaima8447
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Database System Theory Notes by Muhammad Faisal Kamran

Topic 1: Database Definitions


 A database is a shared collection of logically related data that is stored to meet the
requirements of different users of an organization.
 It is a self-describing collection of integrated records
 It models a particular real-world system in the computer in the form of data
 It is the 4th generation language with NLP being the 5th generation one

Topic 2: Manual File System


 Manual file system is basically the data that we used to store in our ledgers (a book that
stores bookkeeping entries).
 It always required a pen and paper
 Data is stored and retrieved from cabinets
 The main disadvantage of it was that data collection increases from time to time and
keeping track of data becomes much more difficult.

Topic 3: Computerized File Processing System


 A collection of programs that perform services for the end-users(We use this term when
there are infinite number of users. They can be naïve or sophisticated) such as the
production of reports
 Example software includes MS Excel where data is stored in form of rows and columns
 The main disadvantage of it was data redundancy (Duplication of data) ads data could
not be shared and it led to inconsistency as if we delete/update a record from one sheet
we have to do it remove/update it from the other sheets which have that record

Topic 4: Database System


 A database system is a relationship between stored data, a database, users and the
hardware or operating system used for the storage.
 It is a collection of files and programs that allow users to store, access, and modify data
 We use Database Management System (DMBS) to run our database
 Data Administrator (DA) is the one who handles the data
 Database Administrator (DBA)is the one who defines schema, grants access and does
routine maintenance
Topic 5: Some Basic Database Concepts
 The Structure of a database consists of rows and columns that form a table
 Table is called entity in database
 Row is called record or tuple in database
 Column is called field or attribute in database
 Schema is the place where the structure of the database is stored. Can also be called the
database name
 Instanced are the number of entries in the entity. A short way to calculate it is multiplying
the rows and columns of an entity
 Database applications programs which are written for particular tasks and also perform or
process some activity on the data which is stored in the database.
 DBMS is a collection of programs that are used to manage data in the database and the
users of the database. It provides management for the data and users

Topic 6: Advantages and Disadvantages of Database System


 Advantages of Database system include
1. Data is persistence
2. Data can be shared
3. Data is interrelated
4. Controlled Redundancy
5. Better Data Integrity
6. Data consistency
7. Better data security
8. Better data accessibility
9. Improved data standards
10. Better backup, recovery and concurrency controls
 Disadvantages of Database system include
1. Increased cost which includes hardware, hiring DBAs and adoption cost
2. Complexity
3. Greater impact of failure
4. Increased recovery time
Topic 7: Functionality of DBMS
• Data Storage and Retrieval: Efficiently stores, organizes, and retrieves data from the
database.

• Database Access Language: Provides a structured language (e.g., SQL) to interact with
the database.

• Application Programming Interfaces: Allows applications to communicate with the


database using predefined functions.

• Database Communication Interfaces: Enables seamless interaction between databases and


external systems.

• Data Integrity Management: Ensures accuracy, consistency, and reliability of stored data.

• Multi-User Access Control: Manages concurrent access to the database while maintaining
consistency.

• Security Management: Implements authentication, authorization, and encryption to


protect data.

• Backup and Recovery: Ensures data safety by creating backups and restoring lost or
corrupted data.

Topic 8: Levels of Data


 Data is basically facts concerning things, such as people, objects, or events
 It can also be called as a resource (Anything that benefits the company and costs them)
 There are 3 levels of data
1. Real World Entities: Anything that can be touched physically
2. Metadata: Schema
3. Data occurrence: Data itself

Topic 9: Three Level architecture


 Database Architecture refers to a permanent structure or intention of database
 Depicted by three schemas or three models
 These 3 levels are external, conceptual and internal
 External View
1. The way users think about data
2. Each user has a view of the database limited to the appropriate portion of the
user’s perspective of reality.
3. Users may have different views of the same data e.g. date, time etc.
4. This is the highest level and represents the user-specific views of the database.
5. Different users or applications can see different subsets of the data.
6. It ensures data security by restricting access to certain parts of the database.
 Conceptual View
1. This is the middle level of the architecture.
2. It provides a logical view of the entire database and defines relationships,
constraints, and schemas.
3. It hides storage details but ensures data integrity and consistency.
 Internal View
1. This is the lowest level of the architecture.
2. It describes how data is physically stored in the database (e.g., file structures,
indexing, storage allocation).
3. It is managed by the DBMS and is invisible to users.

Topic 10: Data Independence


 Data independence is achieved is a major outcome of three level architecture
 It basically means that changes in the lower levels do not affect the upper levels
 The mapping for three level architecture is ext/con and con/int
 There are 2 types of data independence
1. Logical data independence: Changes made in conceptual view do no effect the
external view. Changes can be
 Adding a new file
 Adding a new field in a file
 Changing type/ size
 Deleting an attribute
2. Physical data independence: Changes made in conceptual view do not effect the
internal view. Changes can be
 Changing file organization
 Index implementation, hash, tree, etc.
 Changing storage medium
Topic 11: Client Server DB Environment
 Centralized architecture were used in databases and had 2 components mainframe and
display terminal
 Nowadays it is replaced by client server which has the following characteristics
1. Networked computing model
2. Processes distributed between clients and servers
3. Client–Workstation (usually a PC) that requests and uses a service
4. Server–Computer (PC/mini/mainframe) that provides a service
5. For DBMS, server is a database server
 Client Server has 3 layers
1. Presentation
2. Processing
3. Storage
 Client server is further divided into 3 architectures
1. File Server Architecture
2. Database Server Architecture
3. Three-tier Architecture
 In file server entire files are transferred from server to client and all work is done by pc.
The problems it includes are sending huge amounts of data and each client should have
full DBMS
 Database Server Architecture also known as 2 tiers. In this client is responsible for I/O
processing and some business rules logic. Server performs all storage and retrieval and
DBMS is only on server. Advantages include reduced traffic and data integrity and stored
procedures (business rules done on server)
 Three-tier DB architecture buries the process or application logic in the middle-tier. Thus,
it acts as a separate entity from the Client/User Interface and the data Interface.
Advantages include technological flexibility, long-term cost reduction, better match of
systems to business needs and improved customer service

Topic 12: Middleware


 Middleware is the glue that holds client/server applications together
 It is accomplished via API
 Types of middleware include
1. Remote Procedure Calls (RPC): Client makes calls to procedures running on
remote computers. It is synchronous and asynchronous
2. Message-Oriented Middleware (MOM): Asynchronous calls between the client
via message queues
3. Publish/Subscribe: push technology  server sends information to client when
available
4. Object Request Broker (ORB): Object-oriented management of communications
between clients and servers
5. SQL-oriented Data Access: Middleware between applications and database
servers
6. ODBC–Open Database Connectivity: Most DB vendors support this
7. JDBC–Java Database Connectivity: Special Java classes that allow Java
applications to connect to databases

Topic 13: Database System Deployment

 Different ways to set up databases in a client/server architecture:


1. All on Same Computer: Both client and server software run on a single machine.
2. Multiple Clients, One Server: A centralized database server serving multiple
clients over a network.
3. Multiple Clients, Multiple Servers: Multiple database servers handling client
requests.

Topic 14: Database System Components

 Structure of a Database Management System (DBMS) including:

1. Query Processor (handles SQL queries)


2. Database Manager (manages data operations)
3. File Manager (handles storage and retrieval)
4. Dictionary Manager (manages metadata)
5. Access Methods (retrieval algorithms)
6. System Buffers (caching mechanism)

Topic 15: Database Application Development Process

 Preliminary Study
 Requirement Analysis
 Database Design (conceptual, logical, physical)
 Implementation
 Testing & Maintenance
Topic 16: Data Flow Diagrams (DFD)

 Used for visualizing data movement in a system.


 Key components:
o Processes (rounded rectangles, transform data)
o Data Stores (repositories like inventory, accounts)
o External Entities (users, other systems)
o Flows (arrows showing data movement)
o Collector (Several data flows combine here)
o Selector (Several data flows split here)
o Ring-sum operator (Shows two possible data flow and one is allowed)
o AND operator (Shows two possible data flow and both are allowed)

Topic 17: Common Mistakes in DFDs

 Blackholes: Inputs exist, but no outputs.


 Miracles: Outputs exist, but no inputs.
 Grey holes: Output data is more than input data.

Topic 18: ER Diagram


 Data modelling is the process of creating a representation of data (Diagram of a data) for
the purpose of communication and planning
 There are 2 main data modelling methods
1. ERD
2. EERD
 ERD stands for Entity Relationship Diagram allows for the creation of an abstract and
conceptual representation of data
 It is divided into 3 parts
1. Entity
2. Attribute
3. Relationship
 Entity is anything that physically exists in the system. Drawn with a rectangle shape. It is
further divided into
1. Person
2. Place
3. Object
4. Event
 Entity types is collection of entities that share common properties or characteristics.
Example People working in university like faculty comes in Person entity
 Attribute is the characteristic/property of an entity. Drawn with a oval shape. Attributes
are further divided into
1. Single: Which is single and cannot be divided. Example Student ID. Diagram
made with single oval
2. Composite: Which can be divided. Example Name and Address. Diagram made
with single oval and dividing into multiple ovals
3. Multiple: Which can have multiple values. Example Occupation. Diagram made
with a double oval
4. Derived: Which is derived from any other attribute. Example Age is derived from
Date of birth. Diagram made with dotted oval
 Key is an attribute or set of attributes that can be used to uniquely identifies entity of
an entity type. Example Student Id
 A composite key is a key that consists of two or more attributes where the removal of
any one attribute would remove the key property. Example Class Time and Class
Venue
 Relationship is a meaningful association between entity types. Drawn with a diamond
shape. Can be drawn left to right or top to bottom. Components of relationship include
1. Degree: Number of entity types participating in the relationship
2. Cardinality: Number of entities that can be in a relationship. It is further divided
into 3 types
 One to one (1:1)
 One to many (1:N)
 Many to many (M:N)
3. Total participation is when all of the entities of an entity type must participate in a
relationship
4. Partial participation is when only some of the entities of an entity type must
participate in a relationship

Topic 19: EER Diagram


 EERD stands for Enhanced Entity Relationship Diagram. It is used when ERD becomes
too complex. All things are similar to ERD just it introduces two new components
1. Superclass/Subclass
2. Category
 Superclass is the entity type which contains one or more subgroupings
 Subclass is the subgrouping of an entity type
 Example a company has consultant, secretary and engineer as employee. Superclass is
employee and its subgroupings are consultant, secretary and engineer
 Circle is used for representing superclass and a u shape symbol before its subgroupings is
used to represent the subclass
 There are 4 main points about superclass/subclass which include
1. Membership: Each member of a subclass is also a member of the superclass
2. Attribute Inheritance: A subclass automatically inherits every attribute of its
superclass
3. Relationship Inheritance: : A subclass automatically inherits every relationship of
its superclass
4. Local Attributes and relationship: A subclass may have distinctive attributes and
relationships that its superclass does not have
 To determine which is superclass and which is subclass we use 2 methods
1. Specialization: Top to bottom process, start with superclass and identify which
subclasses belong to which superclass
2. Generalization: Bottom to top process, start with subclasses and identify which
superclass these subclasses belong to
 The subclasses are considered to be disjoint if an entity of the superclass can only be a
member of one of the subclasses. Draw d inside of circle for representation
 The subclasses are considered to be overlapping if an entity of the superclass can be a
member of more than one subclass. Draw o inside of circle for representation
 Total specialization specifies that every entity in the superclass must be a member of at
least one subclass. Represented with double line
 Partial specialisation specifies that an entity in the superclass can belong to none of the
subclasses. Represented with single line
 A category has superclasses and subclass. The superclasses are different entity types and
the subclass must belong to one of the superclasses
 In superclass/subclass the subclasses have a common superclass but in category
superclasses are different. Draw a U inside the circle to represent category
 There are 3 main points about category which include
1. Attribute Inheritance: If a subclass member is also a member of the superclass, it
will automatically inherits the superclass’s attributes
2. Relationship Inheritance: : : If a subclass member is also a member of the
superclass, it will automatically inherits the superclass’s relationship
3. Local Attributes and relationship: A subclass may have distinctive attributes and
relationships that its superclass does not have
 Total category specifies that every entity in the superclasses must be a member of the
subclass. Represented with double line
 Partial category specifies that an entity in the super classes can belong to no subclass
Represented with single line

You might also like