CS3492 DBMS 1
CS3492 DBMS 1
Prepared by:
Dr.K.Manojkumar. ASP/CSE
Govt.College of Engineering
Sengipatti.Thanjavur
Introduction:
•A database-management system (DBMS) is a
collection of interrelated data and a set of programs to
access those data.
•The collection of data, usually referred to as the
database, contains information relevant to an
enterprise.
•The primary goal of a DBMS is to provide a way to
store and retrieve database information that is both
convenient and efficient.
Example of some Database: MySQL, Microsoft Access,
SQL Server,MongoDB,FileMaker,Oracle, RDBMS,
dBASE, Clipper, and FoxPro etc..
Database-System Applications
Some of the applications:
Enterprise Information
Sales: For customer, product, and purchase
information.
Accounting: For payments, receipts, account balances,
assets and other accounting information.
Human resources: For information about employees,
salaries, payroll taxes, and benefits.
Manufacturing: For management of the supply chain
and for tracking production of items in factories,
inventories of items in warehouses and stores
Banking and Finance
Banking: For customer information, accounts, loans,
and banking transactions.
Credit card transactions
Finance:
For storing information about holdings, sales, and
purchases of financial instruments such as stocks and
bonds also for storing real-time market data
Universities:
For student information, course registrations, and
grades
Airlines, Train and Bus ticket reservation system
Telecommunication
Purpose of Database Systems
(Or)
Draw back of File processing System:
•Before database management systems (DBMSs) were
introduced, organizations usually stored information in
File processing System.
•This typical file-processing system is supported by a
conventional operating system. The system stores
permanent records in various files, and it needs
different application programs to extract records from,
and add records to, the appropriate files.
•File-processing system has a number of major
disadvantages:
Data redundancy and inconsistency
•The same information may be duplicated in several
places (files).Redundancy may lead to data
inconsistency; that is, the various copies of the same
data may no longer get matched.
•For example, if a student has a double major (say,
music and mathematics) the address and telephone
number of that student may appear in a file that
consists of student records of students in the Music
department and also student records of students in the
Mathematics department.
Difficulty in accessing data:
•Which makes accessing data very difficult.
Example:
•Suppose our University Vice chancellor wants a data those
who are getting A grade in DBMS overall in tamil nadu, in
this scenario as a developer have to write a new application
program for this purpose,
•several days later same vice chancellor ask the details of
the students those who are getting A grade in Operating
System overall in tamil nadu, as same developer have to
written a another application program for this purpose, It is
so difficult for developer to write a separate programs for
that every request.
Data Isolation:
•Because data are scattered in various files, and files
may be in different formats, writing new application
programs to retrieve the appropriate data is difficult.
Integrity problems:
•The data values stored in the database must satisfy
certain types of consistency constraints.
•In conventional file-processing system constraints
cannot be applied .
•Suppose also that the university requires that the
account balance of a department may never fall below
Rs.1000.
• It can be done in DBMS enforcing these constraints
in the system by adding appropriate code in the
various application programs.
Atomicity problems
• A computer system, like any other device, is subject
to failure. In many applications, it is crucial that, if a
failure occurs, the data be restored to the consistent
state that existed prior to the failure.
• atomic—it must happen in its entirely or not at all.
• It is difficult to ensure atomicity in a conventional
file-processing system.
One of the example of atomic Fund transfer.
Concurrent-access anomalies
•Many systems allow multiple users to update the
data simultaneously.
•In such an environment, interaction of concurrent
updates is possible and may result in inconsistent data.
•Consider department A, with an account balance of
Rs.10,000. If two department clerks debit the account
balance (by say Rs.500 and Rs.100, respectively) of
department A at almost exactly the same time, the
result of the concurrent executions may leave the
balance in an incorrect it may shows the balance of
Rs.9500 or Rs.9900 instead of the correct value of
Rs.9400
Security problems :
•Not every user of the database system should be able
to access all the data.
•For example, in a university, payroll person need to
see only that part of the database that has financial
information.
•They do not need access to information about
academic records.
•Enforcing such security constraints is difficult in File
processing System.
Views of Data
• A major purpose of a database system is to provide
users with an abstract view of the data.
• That is, the system hides certain details of how the
data are stored and maintained.
Data Abstraction:
• Not every database-system users are not computer
trained, developers(Programmer) hide the
complexity from users through several levels of
abstraction
1.Physical Level
2.Logical level
3.View level
Levels of Data abstraction
Example of views of data
Type employee=record
empID:numeric(10)
empName:Char(25)
dept_name:Char(20)
empSalary:numeric(8,2)
end
This code defines a new record type employee with
four fields such as Empid, empname, deptname,
empsalary
Physical level:
•This is the lowest level of Data abstraction.
•At physical level the record employee can be
described as block of Consecutive storage locations.
Many database system hide lowest level of storage
details from the data base programmer.
Logical level:
•This is the next highest level of data abstraction which
describes what data are stored in database and also
describes relationship among the data.
•Type definition of the records is decided at logical
level. The programmer work of the record at this level
and also database admin.
View level:
•This is the highest level of data abstraction that
describe only part of the entire database.
•This view level can provide access to only part of the
database.
•There is a specific view of the record is allowed at the
view level. For that example record customer can view
only the employee name and ID but can not access
employee salary.
Instances and Schemas:
•The overall design of the database is called the
database schema.
CustID CustName CustPhoneno
100001 Aadhi 18
100002 Anbuselvam 19
100003 Aghila 18
Entity Relationship Model:
•The entity-relationship (E-R) data model uses a
collection of basic objects, called entities, and
relationships among these objects.
•An entity is a “thing” or “object” in the real world that
is distinguishable from other objects.
•The entity-relationship model is widely used in
database design
• Object-Based Data Model.
• Object-oriented programming (especially in Java, C++, or C#)
has become the dominant software-development
methodology.
• object-oriented data model that can be seen as extending the
E-R model with notions of encapsulation, methods
(functions), and object identity.
• The object-relational data model combines features of the
object-oriented data model and relational data model.
Semi structured Data Model.
Semi-structured data is a type of data that is not purely structured, but
also not completely unstructured.
The semi structured data model there is no separation between data
and schema.
The Extensible Markup Language (XML) is widely used to
represent semistructured data and JSON –Java Script Object Notation
System Catalog(Data Dictionary)
Data dictionary is a repository of information describing the data
in a database, that is meta data or data about data.
Authorization control module uses the system catalog to check
whether the user has necessary authorization to carry out the
requested operation
System catalog has to store:
* The name of the user authorized to use the DB.
* The name of the data item in the DB.
* The Constraints on each data item.
Data Definition Language (DDL)
Prepared by:
Dr.K.Manojkumar. ASP/CSE
Govt.College of Engineering
Sengipatti.Thanjavur
Database System Architecture
Database Users and Administrators
People who work with a database can be categorized as
database users or database administrators.
Database Users and User Interfaces
•There are four different types of database-system users,.
Different types of user interfaces have been designed for the
different types of users.
•Naive users are unsophisticated users who interact with the
system by invoking one of the application programs that have
been written previously.
•For example, a clerk in the university who needs to add a new
employee to department of CSE invokes a program called new
employee.
• Naive users may also simply read reports generated
from the database.
• Application programmers are computer
professionals who write application programs.
Application programmers can choose from many
tools to develop user interfaces.
• Sophisticated users interact with the system without
writing programs. Instead, they form their requests
either using a database query language or by using
tools such as data analysis software.
• They submit each such query to query processor,
whose function is to break down DML statement into
instruction that the storage manager understands.
Database Administrator
A person who has central control over the system is
called a database administrator (DBA).
The functions of a DBA include:
•Schema definition. The DBA creates the original
database schema by executing a set of data definition
statements in the DDL.
• Schema and physical-organization modification. The
DBA carries out changes to the schema and physical
organization to reflect the changing needs of the
organization.
Granting of authorization for data access.
By granting different types of authorization, the database
administrator can regulate which parts of the database various
users can access.
Routine maintenance.
Examples of the database administrator’s routine
maintenance activities are:
• Periodically backing up the database, either onto
tapes or onto remote servers.
•Ensuring that enough free disk space is available for
normal operations, and upgrading disk space as
required.
•Monitoring jobs running on the database and ensuring
that performance is not degraded by very expensive
tasks submitted by some users.
• Data-manipulation language (DML) is a language that
enables users to access or manipulate data. Nonprocedural
DMLs, which require a user to specify only what data are
needed, without specifying exactly how to get those data, are
widely used today.
• Data-definition language (DDL) is a language for specifying
the database schema and as well as other properties of the
data.
• Entity-relationship (E-R) datamodel is a widely used
datamodel for database design. It provides a convenient
graphical representation to view data, relationships, and
constraints.
Components of DBMS
• A database system is partitioned into modules that
deal with each of the responsibilities of the overall
system.
• The functional components of a database system can
be broadly divided into the storage manager and the
query processor components.
Storage Manager:
• The storage manager is the component of a
database system that provides the interface between
the low-level data stored in the database and the
application programs and queries submitted to the
system.
• The storage manager components include:
• Authorization and integrity manager, which tests for the
satisfaction of integrity constraints and checks the authority
of users to access data.
• Transaction manager, which ensures that the database
remains in a consistent (correct) state despite system failures,
and that concurrent transaction executions proceed without
conflicting.
File manager, which manages the allocation of space on disk
storage and the data structures used to represent
information stored on disk.
• Buffer manager, which is responsible for fetching data from
disk storage into main memory, and deciding what data to
cache in main memory.
The buffer manager is a critical part of the database system,
since it enables the database to handle data sizes that are
much larger than the size of main memory.
• The storage manager implements several data structures as
part of the physical system implementation:
• Data files, which store the database itself.
• Data dictionary, which stores metadata about the structure
of the database, in particular the schema of the database.
• Indices, which can provide fast access to data items. Like the
index in this textbook
Query Processor:
• The query processor components include:
• DDL interpreter, which interprets DDL statements and
records the definitions in the data dictionary.
• DML compiler, which translates DML statements in a query
language into an evaluation plan consisting of low-level
instructions that the query evaluation engine understands.
• Query evaluation engine, which executes low-level
instructions generated by the DML compiler.
Thank you
INTRODUCTION TO RELATIONAL DATABASES
•A relational database is based on the relational model and uses a
collection of tables to represent both data and the relationships
among those data. It also includes a DML and DDL.
•A relational database consists of a collection of tables, each of
which is assigned a unique name. A row in a table represents a
relationship among a set of values.
Relational Model Concepts
Attribute
•Each column in a Table. Attributes are the properties which
define a relation. e.g., Student_Rollno, NAME,etc
•
• Tables – In the Relational model the, relations are saved in the
table format. It is stored along with its entities. A table has two
properties rows and columns. Rows represent records and
columns represent attributes.
• Tuple – It is nothing but a single row of a table, which
contains a single record.
• Relation Schema: A relation schema represents the name of
the relation with its attributes.
• Degree: The total number of attributes which in the relation is
called the degree of the relation.
• Cardinality: Total number of rows present in the Table.
Prepared by:
Dr.K.Manojkumar. ASP/CSE
Govt.College of Engineering
Sengipatti.Thanjavur
Relational Algebra
Relational Algebra :
The relational algebra is a procedural query language. It consists
of a set of operations that take one or two relations as input and
produce a new relation as their result.
Relational algebra operation are divided into two groups:
Set operation include the following operation:
Union(∪)
Intersection(∩)
Set difference(-)
Cartesian product(× )
Second group relational algebraic operation is developed
specially for relational databases. Some of the operations of this
group are:
Select(σ)
Project(π)
Rename(ρ)
Join ( )
Division
Fundamental operation in relational algebra:
Depositor: Borrower:
Customer_name City Customer_Name City
Siva Pune
Tamil mumbai
Williams chennai
UNION(U)
The result of the operation is denoted by depositor ∪
Borrower is the relation that includes all the tuples that
are in either in depositor or borrower or in both.
duplicates are eliminated.
Example: Find the names of all the bank customer who
have an account or loan or both.
The result of the union is :
Depositor ∪ Borrower
Customer_Name City
Hari Pune
John Mumbai
Jaffer Solaphur
Logu Nashik
Siva Pune
Tamil Mumbai
Antony Mumbai
Bala Pune
Jackson Solapur
Williams chennai
Intersection:
The result of the intersection that operation that
includes all tuples that are in both depositor and
borrower.
Depositor ∩ borrower
Example:
Find the name of the customer who have both
account and loan
Depositor ∩ Borrower
Customer_Name City
Hari Pune
Jaffer Solaphur
Siva pune
Setdifference (-)
That gives tuples in one relation but not present in
another relation.
Borrower-Depositor
P0001 Technical
B0001 DBMS
P0002 NV
B0002 C
P0003 pearson
The relation publisher has 2 columns and 3 tuples. The
relation book_info has 2 column and 2 tuples. So the
Cartesian product has 4 columns (2+2) and 6 tuples (3*2)
P0002 NV B0002 C
• R- relation
• Select those tuples of the instructor relation where the
instructor is in the “Physics” department,
• we write:
σ dept_name =“Physics” (instructor )
• we can combine several predicates into a larger predicate by
using the connectives and (∧), or (∨), and not ( ¬ ).
• Thus, to find the instructors in Physics with a salary greater
than $90,000, we write:
• σ dept_name =“Physics”∧ salary > 90000 (instructor )
find all instructors with salary greater than $90,000 by writing:
• σ salary>90000 (instructor)
The Project Operation (π):
• Suppose we want to list all instructors ID, name, and salary,
but do not care about the dept name.
• The project operation allows us to produce this relation.
• The project operation is a unary operation that returns its
argument relation, with certain attributes left out. Since a
relation is a set, any duplicate rows are eliminated. Projection
is denoted by the uppercase Greek letter pi (π).
• π ID, name, salary (instructor )
• π name (σ dept_name =“Physics” (instructor))
• π name,dept_name(σ salary > 89000(Instructor))
Rename operation:
In relation algebra u can rename either the relation or the
attributes or both.
the rename operator, denoted by the lowercase Greek letter rho
(ρ),
Rename operation can take any one of the following forms
1.ρₓ(new attribute name)(R)
2.ρₓ(R)
3. ρ(new attribute name)(R)
• ρ indicate rename operator
• x indicate new relation name
• R indicate original relation
E0005 John
• To display the name of all employees with salary, we need to
combine employee and salary relation using cartesian
product as follows
• ∏emp_name,Salary(employee.emp_Code=
Salary.emp_Code(Employee Χ salary))
The above query is rewritten using natural join as follows:
∏emp_name,Salary(Employee salary)
Emp_name Salary
Aghila 2000
Bala 5000
Charulatha 7000
David 10000
Outer join
The outer join is the extension of join operation to deal with
missing information
The Left Outer Join keeps all tuples from the left relation, adding
NULL values for non-matching tuples from the right relation.
Employee ⟕ Employee_Salary
Emp_Name City Department Salary
Hari Pune CSE 15000
Om Mumbai IT 10000
Smith Nashik Null Null
Jai Solapur IT 9000
Right outer join : ⟖
The Right Outer Join keeps all tuples from the right relation,
adding NULL values for non-matching tuples from the left
relation.
Employee ⟖ Employee_Salary
Emp_Name City Department Salary
Hari Pune CSE 15000
Om Mumbai IT 10000
Bill NULL CSE 12000
Jai Solapur IT 9000
Full outer join : ⟗
The Full Outer Join retains all tuples from both relations, adding
NULL values for missing matches on either side..
Employee ⟗ Employee_Salary
AnnaNagar
Saidhapet
Raja AnnaNagar
John Saidhapet
Arjun KailashNagar
Sona Thuvakudi
John AnnNagar
∏ Branch_Name(σBranch_City=“Chennai”(Branch))
The result of the operation is a relation that contain one
attribute Cust_Name with tuple John
Cust_Name
John
Assignment operation:
•The assignment operation is denoted by ‘←’ .
•It works like assignment in a programming language.
•For relational-algebra queries, assignment must always be
made to a temporary relation variable.
temp1 ← R × S
Ex:
EXEC SQL EXECUTE IMMEDIATE ‘DELETE FROM STUDENT WHERE
STD_ID = 100’;
Prepared by:
Dr.K.Manojkumar. ASP/CSE
Govt.College of Engineering
Sengipatti.Thanjavur
Keys
• Key is an attribute or set of an attribute which helps you to
identify a row(tuple) in a relation(table).
• They allow you to find the relation between two tables.
• Keys help you uniquely identify a row in a table by a
combination of one or more columns in that table.
•In that above table Stud ID, Roll No, and email are candidate keys
which help us to uniquely identify the student record in the table.
What is the Alternate key?
•Candidate key are not chosen as a primary key called an
alternate key.
• However, A table may have single or multiple choices for the
primary key.
•Example: In that above student table.
•StudID, Roll No, Email are qualified to become a primary key.
But since StudID is the primary key, Roll No, Email becomes the
alternate key.
What is the Foreign key?
An attribute or set of attributes within one relation that matches
the candidate key or primary key of some other relation.
A foreign key is a column which is added to create a relationship
with another table.
StudID Roll No First Name LastName Email
1 11 Tom Price [email protected]
2 12 Nick Wright [email protected]
3 13 Dana Natan [email protected]
Helps you to uniquely identify a record in It is a field in the table that is the primary
the table. key of another table.
Primary Key never accept null values. A foreign key may accept multiple null
values.
You can have the single Primary key in a You can have multiple foreign keys in a
table. table.
ENTITY RELATIONSHIP MODEL(ER MODEL)
Weak Entity
•An entity that depends on another entity called a weak entity. The
weak entity doesn't contain any key attribute of its own. The weak
entity is represented by a double rectangle.
Attribute
•The attribute is used to describe the property of an entity.
Eclipse is used to represent an attribute.
•For example, id, age, contact number, name, etc. can be
attributes of a student.
a. Key Attribute
•The key attribute is used to represent the main characteristics
of an entity. It represents a primary key.
• The key attribute is represented by an ellipse with the text
underlined.
b. Composite Attribute
•An attribute that composed of many other attributes is known
as a composite attribute.
•The composite attribute is represented by an ellipse, and those
ellipses are connected with an ellipse.
c. Multivalued Attribute
•An attribute can have more than one value. These attributes are
known as a multivalued attribute.
•The double oval is used to represent multivalued attribute.
•For example, a student can have more than one phone
number.
d. Derived Attribute
•An attribute that can be derived from other attribute is known
as a derived attribute. It can be represented by a dashed(dotted)
ellipse.
•For example, A person's age changes over time and can be
derived from another attribute like Date of birth.
Relationship
A relationship is used to describe the relation between entities.
Diamond Symbol is used to represent the relationship.
a. One-to-One Relationship
When only one instance of an entity is associated with the
relationship, then it is known as one to one relationship.
For example
b. One-to-many relationship
•When only one instance of the entity on the left, and more than
one instance of an entity on the right associates with the
relationship then this is known as a one-to-many relationship.
For example,
•Scientist can invent many inventions, but the invention is done
by the only specific scientist.
c. Many-to-one relationship
•When more than one instance of the entity on the left, and only
one instance of an entity on the right associates with the
relationship then it is known as a many-to-one relationship.
•For example, Student enrolls for only one course, but a course
can have many students.
d.Many-to-many relationship
•When more than one instance of the entity on the left, and
more than one instance of an entity on the right associates with
the relationship then it is known as a many-to-many
relationship.
• For example, Employee can assign by many projects and
project can have many employees.
Notation of ER diagram
•Database can be represented using the notations.
• In ER diagram, many notations are used to express the
cardinality. These notations are as follows:
Mapping Constraints
•A mapping constraint is a data constraint that expresses the
number of entities to which another entity can be related via a
relationship set.
•It is most useful in describing the relationship sets that involve
more than two entity sets.
•For binary relationship set R on an entity set A and B, there are
four possible mapping cardinalities. These are as follows:
– One to one (1:1)
– One to many (1:M)
– Many to one (M:1)
– Many to many (M:M)
• One to One: An entity of entity-set A can be associated with
at most one entity of entity-set B and an entity in entity-set B
can be associated with at most one entity of entity-set A.
• One to Many: An entity of entity-set A can be associated with
any number of entities of entity-set B and an entity in entity-
set B can be associated with at most one entity of entity-set
A.
• Many to One: An entity of entity-set A can be associated with
at most one entity of entity-set B and an entity in entity-set B
can be associated with any number of entities of entity-set A.
• Many to Many: An entity of entity-set A can be associated
with any number of entities of entity-set B and an entity in
entity-set B can be associated with any number of entities of
entity-set A.
• We can have these constraints in place while creating tables
in database.
Generalization
•Generalization is like a bottom-up approach in
which two or more entities of lower level combine to
form a higher level entity if they have some
attributes in common.
•Generalization uses the bottom-up approach.
•In generalization, entities are combined to form
a more generalized entity, i.e., subclasses are
combined to make a superclass.
•For example, Faculty and Student entities can
be generalized and create a higher level entity
Person.
Specialization
•Specialization is a top-down approach, and it is opposite to
Generalization.
•In specialization, one higher level entity can be broken down
into two lower level entities.
•For example: In an Employee management system, EMPLOYEE
entity can be specialized as TESTER or DEVELOPER based on
what role they play in the company.
Aggregation
•In aggregation, the relation between two entities is
treated as a single entity.
•In aggregation, relationship with its corresponding
entities is aggregated into a higher level entity.
For example:
• Center entity offers the Course entity act as a single
entity in the relationship which is in a relationship with
another entity visitor. In the real world, if a visitor visits
a coaching center then he will never enquiry about the
Course only or just about the Center instead he will ask
the enquiry about both.
ER diagram of Banking Application
ER diagram of Doctor patient relationship
ER diagram of Library function
Functional Dependency
Definition
Functional dependency play key role in
differentiating good database designs from bad
database design
A functional dependency is defined as a constraint
between two sets of attributes in a relation from a
database.
Given a relation R, a set of attributes X in R is said to
functionally determine another attribute Y, also in R,
(written X → Y) if and only if each X value is
associated with at most one Y value.
In other words….
X is the determinant set and Y is the dependent
attribute. Thus, given a tuple and the values of
the attributes in X, one can determine the
corresponding value of the Y attribute.
X →Y holds whenever two tuples have the same
value for x, then they must have the same
value for Y.
If t1[x]=t2[x] then t1[y]=t2[y] in any relation
instance of r(R)
Example
Employee
TABLE: COURSE
COURSEID SECTIONID C_NAME
CIS564 072 Database Design
CIS564 073 Database Design
CIS570 072 Oracle Forms
CIS564 074 Database Design
ANOMALIES EXAMPLES
Insertion:
Suppose our university has approved a new
course called CIS563: SQL & PL/SQL.
Bordoloi
Database Normalization
Definition
• Normalization is the process of organizing the data in
the database
• Normalization is used to minimize the redundancy from
a relation or set of relations.
• Normalization divides the larger table into smaller table
and links them using relationship.
• A properly normalized database should have the
following characteristics
– Scalar values in each fields
– Absence of redundancy.
– Minimal use of null values.
– Minimal loss of information.
Levels of Normalization
• Levels of normalization based on the amount
of redundancy in the database.
• Various levels of normalization are:
– First Normal Form (1NF)
– Second Normal Form (2NF)
Redundancy
Number of Tables
– Third Normal Form (3NF)
Complexity
– Boyce-Codd Normal Form (BCNF)
– Fourth Normal Form (4NF)
– Fifth Normal Form (5NF)
– Domain Key Normal Form (DKNF)
Most
Mostdatabases
databasesshould
shouldbe
be3NF
3NFor
orBCNF
BCNFin inorder
orderto
toavoid
avoid
the
thedatabase
databaseanomalies.
anomalies.
Benefits of Normalization
• Less storage space
• Quicker updates
• Less data inconsistency
• Clearer data relationships
• Easier to add data
• Flexible Structure
Levels of Normalization
1NF
2NF
3NF
4NF
5NF
DKNF
Each
Eachhigher
higherlevel
levelisisaasubset
subsetof
ofthe
thelower
lowerlevel
level
First Normal Form (1NF)
A table is considered to be in 1NF if all the fields
contain
only scalar(Atomic) values (as opposed to list of
values).
Example
ISBN (NotAuName
Title 1NF)AuPhone PubName PubPhone Price
Author
Authorand
andAuPhone
AuPhonecolumns
columnsare
arenot
notscalar
scalar
1NF - Decomposition
1. Place all items that appear in the repeating group in a
new table
2. Designate a primary key for each new table produced.
3. All the non key fields are functionally dependent on the
primary key.
Example (1NF)
ISBN AuName AuPhone
0-55-123456-9 Main Street Small House 714-000-0000 $22.95 0-55-123456-9 Jones 123-333-3333
250 Pooja
300 Raja
Boyce-Codd Normal Form (BCNF)
Use
Useyour
yourown
ownjudgment
judgmentwhen
whendecomposing
decomposingschemas
schemas
BCNF - Decomposition
Example 2 (Convert to BCNF)
Old Scheme {MovieTitle, MovieID, PersonName, Role, Payment }
New Scheme {MovieID, PersonName, Role, Payment}
New Scheme {MovieTitle, PersonName}
• Loss of relation {MovieID} {MovieTitle}
New Scheme {MovieID, PersonName, Role, Payment}
New Scheme {MovieID, MovieTitle}
• We got the {MovieID} {MovieTitle} relationship back
• For example, two tuples have to be updated if the roomNo need be changed for staffNo SG5
on the 13-May-02.
Example of BCNF(2)
To transform the ClientInterview relation to BCNF, we must
remove the violating functional dependency by creating two new
relations called Interview and StaffRoom as shown below,
StaffRoom
staffNo interviewDate roomNo
SG5 13-May-02 G101
SG37 13-May-02 G102
SG5 1-Jul-02 G102
2. Each manager can have more than one childMary NULL Adam
Sami Coimbatore
Aranmanai Trichy
4NF - Decomposition
Example 2 (Convert to 4NF) Manager Child Manager Employee
T1 T2
R(A)
W(A)
R(B)
W(B)
R(A)
R(B)
Non-Serial Schedule
•This is a type of Scheduling where the operations of multiple
transactions are interleaved.
•This might lead to a rise in the concurrency problem. The
transactions are executed in a non-serial manner, keeping the
end result correct and same as the serial schedule.
• Unlike the serial schedule where one transaction must wait for
another to complete all its operation, in the non-serial schedule,
the other transaction proceeds without waiting for the previous
transaction to complete.
•It can be of two types namely, Serializable and Non-Serializable
Schedule.