KEMBAR78
DBMS Module 2 | PDF | Relational Model | Inheritance (Object Oriented Programming)
0% found this document useful (0 votes)
5 views122 pages

DBMS Module 2

DBMS Module 2

Uploaded by

1by22ai023
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views122 pages

DBMS Module 2

DBMS Module 2

Uploaded by

1by22ai023
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 122

Database Management System

Module 2
Relational Model Concepts
Domain: A (usually named) set/universe of atomic values, where by "atomic" we mean simply that,
from the point of view of the database, each value in the domain is indivisible (i.e., cannot be broken
down into component parts).

Examples of domains

- USA_phone_number: string of digits of length ten


- Name: string of characters beginning with an upper case letter
- GPA: a real number between 0.0 and 4.0

These are all logical descriptions of domains. For implementation purposes, it is necessary to provide
descriptions of domains in terms of concrete data types (or formats) that are provided by the DBMS
(such as String , int , boolean ), in a manner analogous to how programming languages have intrinsic
data types.
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Attribute: the name of the role played by some value (coming from some domain) in the context of a
relational schema. The domain of attribute A is denoted dom(A) .
Tuple: A tuple is a mapping from attributes to values drawn from the respective domains of those
attributes. A tuple is intended to describe some entity (or relationship between entities) in the miniworld.
As an example, a tuple for a PERSON entity might be
{ Name --> "Rumpelstiltskin", Sex --> Male, IQ --> 143 }
Relation: A (named) set of tuples all of the same form (i.e., having the same set of attributes). The term
table is a loose synonym. (Some database purists would argue that a table is "only" a physical
manifestation of a relation.)
Relational Schema: used for describing (the structure of) a relation. E.g., R(A 1 , A 2 , ..., A n ) says
that R is a relation with attributes A 1 , ... A n . The degree of a relation is the number of attributes it has,
here n.
Example: STUDENT(Name, SSN, Address)

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


One would think that a "complete" relational schema would also specify the domain of
each attribute.

Relational Database: A collection of relations, each one consistent with its specified
relational schema.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Example of a STUDENT relation, which corresponds to the STUDENT schema. Each
tuple in the relation represents a particular student. NULL values represent attributes
whose values are unknown or do not exist for some individual STUDENT tuple.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Characteristics of Relations
1. Ordering of Tuples in a Relation.
A relation is defined as a set of tuples. Elements of a set have no order among them;
hence, tuples in a relation do not have any particular order.
The definition of a relation does not specify any order: There is no preference for one
ordering over another. Hence, the relation displayed in (Previous Slide) Figure is
considered identical to the one shown in the below Figure.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


2. Ordering of Values within a Tuple and an Alternative Definition of a Relation

● The order of attributes and their values is not that important as long as the correspondence
between attributes and values is maintained.
● An alternative definition of a relation can be given, making the ordering of values in a
tuple unnecessary. In this definition, a relation schema R = {A1, A2, ..., An} is a set of
attributes and a relation state r(R) is a finite set of mapping r = {t1, t2, ..., tm}, where each
tuple ti is a mapping from R to D, and D is the union (denoted by ∪) of the attribute
domains; that is, D = dom(A1) ∪dom(A2) ∪... dom(An). In this definition, t[Ai] must
be in dom(Ai) for 1 ≤i ≤n for each mapping t in r. Each mapping ti is called a tuple.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


● According to this definition of tuple as a mapping, a tuple can be considered as a set
of (<attribute>, <value>) pairs. The ordering of attributes is not important, because
the attribute name appears with its value. By this definition, the two tuples shown in
Figure are identical.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


3. Values and NULLs in the Tuples.
● Each value in a tuple is an atomic value; that is, it is not divisible. Hence, composite
and multivalued attributes are not allowed.
● The multivalued attributes must be represented by separate relations, and composite
attributes are represented only by their simple component attributes in the basic
relational model.
● An important concept is that of NULL values, which are used to represent the values
of attributes that may be unknown or may not apply to a tuple.
● Example: STUDENT tuples have NULL for their office phones because they do not
have an office (Does not apply).
● Another student has a NULL for home phone, presumably because either he does not
have a home phone or he has one but we do not know it (value is unknown).

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


● In general, we can have several meanings for NULL values, such as value unknown,
value exists but is not available, or attribute does not apply to this tuple. An
example of the last type of NULL will occur if we add an attribute Visa_status to the
STUDENT relation that applies only to tuples representing foreign students.
● During database design, it is best to avoid NULL values as much as possible

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


4. Interpretation (Meaning) of a Relation.
● Each tuple in the relation can be interpreted as a fact or a particular instance of the assertion.
For example, a STUDENT relation whose Name is Benjamin Bayer, Ssn is 305-61-2435,
Age is 19, and so on.
● Relations may represent facts about entities, whereas other relations may represent facts
about relationships.
● Each relation can be viewed as a predicate and each tuple in that relation can be viewed as
an assertion for which that predicate is satisfied (i.e., has value true) for the combination of
values in it.
● For example, a relation schema MAJORS(Student_ssn, Department_code) asserts that
students major in academic disciplines. A tuple in this relation relates a student to his or her
major discipline. Hence, the relational model represents facts about both entities and
relationships uniformly as relations.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Relational Model Constraints
There are generally many restrictions or constraints on the actual values in a database state. These
constraints are derived from the rules in the mini world that the database represents. Constraints on
databases can generally be divided into three main categories:
1. Inherent model-based constraints or implicit constraints.
Are the constraints that are inherent in the data model. The characteristics of relations are the
inherent constraints of the relational model.
For example, the constraint that a relation cannot have duplicate tuples is an inherent
constraint

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


2. Application-based or semantic constraints or business rules.
● Are the constraints that cannot be directly expressed in the schemas of the data
model, and hence must be expressed and enforced by the application programs.
● Examples of such constraints are the salary of an employee should not exceed the
salary of the employee’s supervisor and the maximum number of hours an employee
can work on all projects per week is 56.
● Such constraints can be specified and enforced within the application programs that
update the database, or by using a general-purpose constraint specification language.
Mechanisms called triggers and assertions can be used. In SQL, CREATE
ASSERTION and CREATE TRIGGER statements can be used for this purpose.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


3. Schema-based constraints or explicit constraints

● Are the constraints that can be directly expressed in schemas of the data model,
typically by specifying them in the DDL (data definition language).
● The schema-based constraints include domain constraints, key constraints, constraints
on NULLs, entity integrity constraints, and referential integrity constraints.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Domain Constraints

Domain constraints specify that within each tuple, the value of each attribute A must be an
atomic value from the domain dom(A).The data types associated with domains typically
include standard numeric data types for integers, Characters, Booleans, fixed-length
strings, variable-length strings, date, time and timestamp.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Key Constraints and Constraints on NULL Values

● In the formal relational model, a relation is defined as a set of tuples. By definition,


all elements of a set are distinct. This means that no two tuples can have the same
combination of values for all their attributes.
● The subsets of attributes of a relation schema R with the property that no two tuples
in any relation state r of R should have the same combination of values for these
attributes i.e for any two distinct tuples t1 and t2 in a relation state r of R, we have the
constraint that: t1[SK]≠t2[SK] any such set of attributes SK is called a super key of
the relation schema R.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


● A super key can have redundant attributes, however, so a more useful
concept is that of a key, which has no redundancy.
● A key K of a relation schema R is a super key of R with the additional
property that removing any attribute A from K leaves a set of attributes K
that is not a super key of R anymore. Hence, a key satisfies two properties:
- Two distinct tuples in any state of the relation cannot have identical values
for (all) the attributes in the key. This first property also applies to a super
key.
- It is a minimal super key—that is, a super key from which we cannot
remove any attributes and still have the uniqueness constraint in condition
1 hold. This property is not required by a super key.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


The first property applies to both keys and super keys, the second property is required only
for keys. Hence, a key is also a super key but not vice versa.

Consider the STUDENT relation. The attribute set {Usn} is a key of STUDENT because
no two student tuples can have the same value for Usn.

Any set of attributes that includes Ssn for example, {Ssn, Name, Age}—is a super key.
However, the superkey {Ssn, Name, Age} is not a key of STUDENT because removing
Name or Age or both from the set still leaves us with a super key.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


● In general, a relation schema may have more than one key. In this case, each of the
keys is called a candidate key. For example, the CAR relation in Figure has two
candidate keys: License_number and Engine_serial_number. It is common to
designate one of the candidate keys as the primary key of the relation. This is the
candidate key whose values are used to identify tuples in the relation. The other
candidate keys are designated as unique keys, and are not underlined.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Example: Consider the following relation : Book (BookId, BookName,
Author)
● Super Keys: A Super Key is a set of one or more attributes that are taken
collectively and can identify all other attributes uniquely.
For Example, (BookId)
(BookId,BookName)
(BookId, BookName, Author)
(BookId, Author)
(BookName, Author)

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Candidate Keys Candidate keys are a super key which are not having any redundant attributes. In other
words candidate keys are minimal super keys.
For Example,
(BookId)
(BookName,Author)

These two keys can be candidate keys, as remaining keys are having redundant attributes. Means in
super key (BookId, BookName) record can be uniquely identify by just BookId and therefore
BookName is redundant attribute.
Primary Key: A key which is used to uniquely identify each record is known as primary key. From
above Candidate keys anyone can be the primary key.
Another constraint on attributes specifies whether NULL values are or are not permitted. For example,
if every STUDENT tuple must have a valid, non- NULL value for the Name attribute, then Name of
STUDENT is constrained to be NOT NULL .

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Relational Databases and Relational Database Schemas

● A relational database schema S is a set of relation schemas S = {R1, R2, ..., R m } and a
set of integrity constraints IC.
● A relational database state DB of S is a set of relation states DB = {r1, r2, ..., r m } such
that each ri is a state of Ri and such that their relation states satisfy the integrity constraints
specified in IC.
● Figure 3.5 shows a relational database schema that we call COMPANY = {EMPLOYEE,
DEPARTMENT,DEPT_LOCATIONS,PROJECT, WORKS_ON, DEPENDENT}. The
underlined attributes represent primary keys. A database state that does not obey all the
integrity constraints is called an invalid state, and a state that satisfies all the constraints in
the defined set of integrity constraints IC is called a valid state.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Integrity, Referential Integrity, and Foreign Keys

The entity integrity constraint states that no primary key value can be NULL. This is
because the primary key value is used to identify individual tuples in a relation. Having
NULL values for the primary key implies that we cannot identify some tuples.

For example, if two or more tuples had NULL for their primary keys, we may not be able
to distinguish them if we try to reference them from other relations. Key constraints and
entity integrity constraints are specified on individual relations.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


The referential integrity constraint is specified between two relations and is used to
maintain the consistency among tuples in the two relations. Informally, the referential
integrity constraint states that a tuple in one relation that refers to another relation must
refer to an existing tuple in that relation.

For example, The attribute Dno of EMPLOYEE gives the department number for which
each employee works; hence, its value in every EMPLOYEE tuple must match the
Dnumber value of some tuple in the DEPARTMENT relation.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


The formal definition of referential integrity is, Consider a set of attributes FK in relation
schema R1 is a foreign key of R1 that references relation R2 if it satisfies the following
rules:
1. The attributes in FK have the same domain(s) as the primary key attributes PK of R2;
the attributes FK are said to reference or refer to the relation R2.
2. A value of FK in a tuple t1 of the current state r1(R1) either occurs as a value of PK
for some tuple t2 in the current state r2(R2) or is NULL. According to previous case,
t1[FK] = t2[PK]. The tuple t1 references or refers to the tuple t2.
In this definition, R1 is called the referencing relation and R2 is the referenced relation.
If these two conditions hold, a referential integrity constraint from R1 to R2 is said to
hold. In a database of many relations, there are usually many referential integrity
constraints.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
For example, In the EMPLOYEE relation, the attribute Dno refers to the department for
which an employee works; hence, we designate Dno to be a foreign key of EMPLOYEE
referencing the DEPARTMENT relation. This means that a value of Dno in any tuple t1 of
the EMPLOYEE relation must match a value of the primary key of DEPARTMENT.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Update Operations, Transactions & Dealing with Constraint Violations

There are three basic operations that can change the states of relations in the database:
Insert, Delete, and Update.

● Insert is used to insert one or more new tuples in a relation,


● Delete is used to delete tuples, and
● Update is used to change the values of some attributes in existing tuples

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


The Insert Operation
The Insert operation provides a list of attribute values for a new tuple t that is to be inserted into a relation
R.
Insert can violate any of the four types of constraints.
1. Domain constraints can be violated if an attribute value is given that does not appear in the
corresponding domain or is not of the appropriate data type.
2. Key constraints can be violated if a key value in the new tuple t already exists in another tuple in the
relation r(R).
3. Entity integrity can be violated if any part of the primary key of the new tuple t is NULL.
4. Referential integrity can be violated if the value of any foreign key in t refers to a tuple that does not
exist in the referenced relation.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
The Delete Operation

The Delete operation can violate only referential integrity. This occurs if the tuple being deleted
is referenced by foreign keys from other tuples in the database. To specify deletion, a condition
on the attributes of the relation selects the tuple (or tuples) to be deleted.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Several options are available if a deletion operation causes a violation. The first option,
called restrict, is to reject the deletion.

The second option, called cascade, is to attempt to cascade (or propagate) the deletion by
deleting tuples that reference the tuple that is being deleted.

A third option, called set null or set default, is to modify the referencing attribute values
that cause the violation; each such value is either set to NULL or changed to reference
another default valid tuple.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


The Update Operation
The Update (or Modify) operation is used to change the values of one
or more attributes in a tuple (or tuples) of some relation R. It is
necessary to specify a condition on the attributes of the relation to
select the tuple (or tuples) to be modified.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
The Transaction Concept

● A transaction is an executing program that includes some database operations, such as


reading from the database, or applying insertions, deletions, or updates to the database.
At the end of the transaction, it must leave the database in a valid or consistent state that
satisfies all the constraints specified on the database schema.
● For example, a transaction to apply a bank withdrawal will typically read the user
account record, check if there is a sufficient balance, and then update the record by the
withdrawal amount. A large number of commercial applications running against
relational databases in online transaction processing (OLTP) systems are executing
transactions at rates that reach several hundred per second.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Specialization
and
Generalization
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
● Represents a specialization diagrammatically in an EER diagram. The subclasses that define a
specialization are attached by lines to a circle that represents the specialization, which is
connected in turn to the superclass. The subset symbol on each line connecting a subclass to the
circle indicates the direction of the superclass/subclass relationship.

● Attributes that apply only to entities of a particular subclass such as Typing Speed of
SECRETARY are attached to the rectangle representing that subclass. These are called specific
attributes of the subclass.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Shows entity
instances that belong
to subclasses of the
{SECRETARY,
ENGINEER,
TECHNICIAN}
specialization.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


● There are two main reasons for including class/subclass relationships and
specializations in a data model.
● The first is that certain attributes may apply to some but not all entities of the
superclass.
● For example, in Figure first the SECRETARY subclass has the specific attribute
Typing_speed, whereas the ENGINEER subclass has the specific attribute Eng_type,
but SECRETARY and ENGINEER share their other inherited attributes from the
EMPLOYEE entity type.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Generalization
The reverse process of abstraction suppresses the differences among entity types, identify
their common features, and generalize them into a single superclass of which the original
entity types are special subclasses.

An arrow pointing to the generalized superclass represents a generalization, whereas


arrows pointing to the specialized subclasses represent a specialization.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Relational Algebra

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


The Relational Algebra

1. The basic set of operations for the relational model is the relational algebra.
2. The relational algebra is very important for several reasons. First, it provides a formal
foundation for relational model operations. Second, it is used as a basis for
implementing and optimizing queries in the query processing and optimization
modules that are integral parts of relational database management systems (RDBMSs)

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Unary Relational Operations: SELECT and PROJECT

The SELECT Operation


1. The SELECT operation is used to choose a subset of the tuples from a relation that
satisfies a selection condition.
2. The SELECT operation is visualized as a horizontal partition of the relation into two
sets of tuples. Those tuples that satisfy the condition are selected, and those tuples that
do not satisfy the condition are discarded.
3. In general, the SELECT operation is denoted by σ <selection condition>(R) where the
symbol σ (sigma) is used to denote the SELECT operator and the selection condition is
a Boolean expression (condition) specified on the attributes of relation R.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
The PROJECT Operation

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Sequences of Operations and the RENAME Operation

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Relational Algebra Operations from Set Theory
The UNION, INTERSECTION, and MINUS Operations

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
The CARTESIAN PRODUCT (CROSS PRODUCT) Operation

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Binary Relational Operations: JOIN and DIVISION
The JOIN Operation

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Variations of JOIN: The EQUI JOIN and NATURAL JOIN

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
The DIVISION Operation

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Notation for Query Trees

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Additional Relational Operations

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


Aggregate Functions and Grouping

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Recursive Closure Operations

● Recursive closure operation cannot be specified in the relational algebra. This


operation is applied to a recursive relationship between tuples of the same type, such
as the relationship between an employee and a supervisor.
● This relationship is described by the foreign key Super_ssn of the EMPLOYEE
relation.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
OUTER JOIN Operations

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
The OUTER UNION Operation

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
Illustrate queries using the following new instances S3 of sailors,vR2 of Reserves and B1 of
boats.

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
LOGICAL DATABASE
DESIGN: ER TO
RELATIONAL

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT


© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT
THANK YOU

© Dr. Archana Bhat, Asst. Prof., Dept. of AI & ML, BMSIT

You might also like