You are on page 1of 23

Module I

PART– B ((Long Answer Questions))

Ref Link: https://tinyurl.com/yf6hgh9s ,


https://tinyurl.com/yfesfut9
4) Discuss about the Starburst rule Definition? Write the query for the following statement
“salary of employees is not larger than the salary of the manager of their department”?

Ans. Starburst Active Rule System, has gained popularity mainly because of its simple syntax and
semantics, which adopts the classical set-oriented syntax and semantics of relational
databases

CREATE RULE Mgrsals ON Emp

WHEN INSERTED, UPDATED(Dno), UPDATED(Sal)

IF EXISTS (

SELECT *

FROM Emp E, Dept D, Emp M

WHERE E.Dno = D.Dno AND E.Sal > M.Sal AND D.Mgr = M.Name )

THEN ROLLBACK

Relations Emp(Name,Sal,Dno) and Dept(Dno,Mgr)

• The rule is activated when an employee is created, and when the salary or the department
of an employee changes

• rollback = abort the transaction with the statement that caused the triggering event

Remark about the example:

✸ The constraint (the salary of employees is not larger than the salary of the manager of
their department) is declarative

✸ rule Mgrsals does not cover all the scenarios that could lead to violating the constraint

✸ another rule is necessary on relation Dept, to check the constraint when a department
changes its manager

5) Write the query for the following statement “If the average salary of employees gets over 100,
then reduces the salary of all employees by 10 %” using starburst rule?

Ans. Rules are triggered by the execution of operations in statements that are part of transactions
Rules are statement-level: they are executed once per statement even for statements that trigger
events on several tuples
CREATE RULE SalaryControl ON Emp

WHEN INSERTED, DELETED, UPDATED(Sal)

IF (SELECT AVG(Sal) FROM Emp) > 100 )

THEN

UPDATE Emp

SET Sal = 0.9 * Sal

Another Example of invocation

INSERT INTO Emp VALUES(’Dupont’, 90)

8) Write the query for the following statement “If average salary of employees exceed 100,
reduce salary of each employee by 10%” using recursive rules?

Ans. CREATE TRIGGER SalaryControl

AFTER INSERT, DELETE, UPDATE ON Salary OF EMP

WHEN (Select AVG(Salary) From EMP>100)

THEN Update EMP

Set Salary=.9*Salary

Table EMP:

Name Salary

john 90

David 100

Insert tuple (Rick, 200)


How many times the trigger is invoked?
If ”Set Salary=.9*Salary” changed to ”Set Salary=1.1*Salary”
it goes into an infinite loop.

PART– C (Problem Solving and Critical Thinking Questions)


1) Write the syntax for finding supervisor “The supervisor of an employee must be older
than the employee” Using a trigger.
Ans. create trigger supervisorAge

on Employee

after insert, update

as

if exists (

select *

from Inserted I,

Employee E

where ( I.SuperSSN = E.SSN and I.BDate < E.BDate )

or ( E.SuperSSN = I.SSN and E.BDate < I.BDate ) )

begin

raiserror( 'Constraint Violation: The age of an employee must be less than the age of
his/her supervisor', 1, 1)

rollback

end

2) State the syntax for satisfying the following statement “The location of a project must be
one of the locations of its department.

Ans.

select PLocations, DLocations

from Project P, DeptLocations DP

where PName= P.PLocations and DP.DLocations = Equal

end

3) Definition and use of triggers in Oracle? Write the Trigger syntax in Oracle?
Ans. TRIGGERS are stored programs that are fired by Oracle engine automatically when DML
Statements like insert, update, delete are executed on the table or some events occur. The code
to be executed in case of a trigger can be defined as per the requirement.

Example:

CREATE [OR REPLACE] TRIGGER trigger_name

{BEFORE | AFTER } triggering_event ON table_name

[FOR EACH ROW]

[FOLLOWS | PRECEDES another_trigger]

[ENABLE / DISABLE ]

[WHEN condition]

DECLARE

declaration statements

BEGIN

executable statements

EXCEPTION

exception_handling statements

END;

4) Definition and use of triggers in DB2? Write the Trigger syntax in DB2?

Ans. A trigger is a piece of code that is automatically executed, or fired in response to a data
modification event on a table. The data modification event include insert, update, delete driven
by an INSERT, DELETE, UPDATE, and MERGE statement.

Db2 stores the triggers in the database catalog, where each trigger is attached to a single table.
You cannot call a trigger directly, only Db2 can call the trigger when an event occurs on the table.

Example:

CREATE [OR REPLACE] TRIGGER trigger_name

[NO CASCADE] {AFTER | BEFORE | INSTEAD OF} trigger_event

ON { table_name |view_name }

REFERENCING {OLD AS | NEW AS | OLD TABLE AS | NEW TABLE AS}

{correlation_name |identifier}

{FOR EACH ROW | FOR EACH STATEMENT}

action;
5) Given the relational schema:
EMPLOYEE(Name, Salary, DeptNum)
DEPARTMENT(DeptNum, ManagerName)
Define the following active rules in Oracle and DB2.

I) A rule that deletes all the employees belonging to a department when that department is
deleted.

Ans. create trigger T1

after delete on Department

for each row

when (Employee.Deptnum = Old.Deptname)

delete from Employee where Deptnum = Old.Deptnum

end

II) A rule that reacts to the deletion of the employee who is manager in a department by
deleting that department and all its employees.

Ans. create trigger T2

after delete on Employee

for each row

when (Old.Name in(Select ManagerName from Department)

begin

delete from Employee where Deptnum = Old.Deptnum;

delete from Department where Deptnum = Old.Deptnum;

end

III) A rule that, each time that salary of an employee becomes higher than that of his or her
manager, makes that salary equal to that of the manage.

Ans. create trigger T3

after update of Salary on Employee

for each row

declare x number;

begin

select Salary into x

from Employee join Department on Name = ManagerName

where Department.DeptNum = new.DeptNum


if new.Salary > x. then

update Employee set Salary = x

where Name = new.Name

end

6) Given the relational schema:


STUDENT(Name, Subject, Supervisor)
PROFESSOR(Name, Subject)
COURSE(Title, Professor)
EXAM(StudentName, CourseTitle)
Describe the triggers that manager the following integrity constraints (business
rules):
i) Each student must work in the same area as his or her supervisor.

create trigger T1

after update of Subject on Student

for each row

when Subject <> select Subject

from Professor

where Professor.Name=new.SuperVisor then signal SQLSTATE 70005 (


“Wrong Subject” )

ii) Each student must have taken at least three courses in the subject of his or
her supervisor.

create trigger T2
after update of Subject on Student
for each row
when 3 < ( select count(*)
from Exam join Course on CourseTitle=Title
join Professor on Professor=Professor.Name
join Student on StudentName=Student.Name
join Professor as P2 on SuperVisor=P2.Name
where Professor.Subject=P2.Subject
and student.Name=new.Name )
then signal SQLSTATE 70006 (“Two few Courses”)

iii) Each student must have taken the exam for the course taught by his or her
supervisor.

create trigger T3
after update of SuperVisor on Student
for each row
when not exist ( select * from Exam join Course on CourseTitle=Title
where StudentName=new.Name and
Professor=new.Supervisor )
then signal SQLSTATE 70007 (“Exam loss”)

7) Given the relational schema:


EMPLOYEE(Name, Salary, DeptNum)
DEPARTMENT(DeptNum, ManagerName)
Define the following active rules in Oracle and DB2.
A rule that, each time the salaries are modified, verifies that there are no departments in
which the average salary increases more than three percent and in this case cancels the
modification.

Ans. create trigger T4

after update of Salary on Employee

for each row

declare x number;

declare y number;

declare l number;

begin

select avg(salary), count(*) into x,l

from Employee

where DeptNum=new.DeptNum;

y=((x*l)-new.Salary+old.Salary)/l;

if (x>(y*1.03)) then

update Employee set Salary=old.Salary

where DeptNum=new.DeptNum;

end

8) Given the relational schema:

EMPLOYEE(Name,Salary,DeptNum) DEPARTMENT(DeptNum, ManagerName) Define the


following active rules in Oracle and DB2.1.A rule that, each time that the salaries are modified,
verifies their average and if it is higher than 50 thousand, deletes all the employees whose
salaries have been modified and are higher than 80 thousand.

Ans.

create trigger T5

after update of Salary of Employee


for each statement

when ((select avg(Salary) from new_table) > 50000)

delete from Employee

where Salary>80000

and Name in ( Select new_table.Name

from new_table an n join old_table as o

on n.Name=o.Name

where n.Salary<>old.Salary )

(DB2)

create trigger T5

after update of Salary of Employee

when ((select avg(Salary) from new_table) > 50000)

delete from Employee

where Salary>80000

and Name in ( Select new_table.Name

from new_table an n join old_table as o

on n.Name=o.Name where n.Salary<>old.Salary )

9) A family tree represents the structure of a family. Show how the information of a family
tree Can be represented by means of a relational database, in which only the male line or
only the female line is represented.

Ans. John Brown & Ann Smith

Adam Brown Stephen Brown

& Juliet Brown &

Mary Blacks Caroline Harris

Peter Brown Nadia Brown Christine Brown

Gregory Brown

This information can be represented by the database:

MARRIAGE (Husband, Wife)


PATERNITY(Father, Child)

This schema involves that each person has an unique name.

The family see in picture above becomes:

To represent also the offspring of the female members, it is necessary to add another relation
for maternity.

10) Define a database schema that organizes, The information necessary to generate the radio
programmes page of a daily newspaper, with station, times and programme title; besides
the name, include transmission frequency and the location of the radio station.

Ans. A possible schema is:

STATION (Name, Frequency, Address)

PROGRAMME(Title,Station,Time)

This schema assumes that the same title can not be used for other programme in different
stations. If instead this happens, then the key for PROGRAMME must be composed of both Title
and Station.

Module II
PART– B ((Long Answer Questions))
7) CREATE TABLE Lab Test (Name, Physician, TestID) and write the program for Patients who were
the sole receivers of all tests ordered by a physician?

Ans. CREATE TABLE LabTest (Name, Physician, TestID) AS VALID EVENT HOUR AND TRANSACTION

◼ Event tables are timestamped with instant sets.


◼ Each row identifies a particular kind of (instantaneous) event, with the timestamp of
that row specifying the instant(s) when that event occurred.
◼ Event tables may also be associated with transaction time:
SELECT L1.Name, L2.Physician
FROM LabTest(Name) AS L1, L1(Physician) AS L2,
LabTest(Physician) AS L3
WHERE VALID(L1) = VALID(L2)
AND L2.Physician = L3.Physician
AND VALID(L1) = VALID(L3)

◼ VALID(L1) is an event set containing all tests done to a particular patient


◼ VALID(L2) contains the times of all tests done to a particular patient and ordered by a
particular physician
◼ VALID(L3) is an event set containing all tests ordered by a particular physician.

PART– C (Problem Solving and Critical Thinking Questions)


1) Create a table using the attributes (name, address, city, and region) of employees living in
INDIA. Write a Query to find the list of persons living in INDIA.

Ans. select E.FName, E.LName

from Employee E, EmployeeAddress A, Department D

where E.SSN = A.SSN and E.SSN = D.MgrSSN

and A.City = ’India’


and A.FromDate <= getdate() and getdate() < A.ToDate

and D.FromDate <= getdate() and getdate() < D.ToDate

2) Create a tables “employee” and “Employee Lifecycle”? Give the name of current
employees who do not work currently in any department?

Ans. select distinct E.FName, E.LName

from Employee E, EmployeeLifecycle L

where E.SSN = L.SSN

and L.FromDate <= getdate() and getdate() < L.ToDate

and not exists (

select * from Affiliation A

where E.SSN = A.SSN

and A.FromDate <= getdate() and getdate() < A.ToDate )

3) Create a tables “employee”, “Supervision” and “WorksOn”? Give the name of super visors
who had work on a project at sometime?

Ans. select distinct E.FName, E.LName

from Employee E, Supervision S, WorksOn W

where E.SSN = S.SuperSSN and E.SSN = W.SSN

4) Write the syntax for “Who has been on a drug for more than a total of six months”? Using
following Scenario:
● Patient records include information on the drugs prescribed to each patient.
● The valid time specifies the period(s) during which the drug was prescribed.
● The valid time has a granularity of day (transaction time granularity is system defined):

Ans: i) Who has been on a drug for more than a total of six months

Select Name, Drug

From Prescription(Name, Drug) as P

Where cast(valid (P)as interval month > interval ‘6’ month

Result will contain the maximal interval(s) when the patient has been on the drug
Restructuring of tables as part of the FROM clause helps keeping queries concise

5) Explain about Valid Time Projection and write the syntax of “What drugs was Melanie
prescribed during 1994”using the patient record?

Ans. Select Drug


Valid intersect (valid(Prescription), period ‘[1994]’ day)

From Prescription

Where Name= ‘Melanie’

The Result is a list of drugs, each associated with a set of0020period during 1994 that they
were prescribed to melanie .

6) Create a table of “employee” and Write the syntax to “Find the employee's salary at a given
time: e.g. the current one:”

Ans.

Employee(Name, Salary, Title, DateofBirth, StartDate, StopDate)

Select Salary

from Employee

where name = ‘bob’

and start<= current_timestamp

and current_timestamp <= stop

7) Give the name of the managers living currently in Houston.

Ans. select E.FName, E.LName

from Employee E, EmployeeAddress A, Department D


where E.SSN = A.SSN and E.SSN = D.MgrSSN

and A.City = ’Houston’

and A.FromDate <= getdate() and getdate() < A.ToDate

and D.FromDate <= getdate() and getdate() < D.ToDate

8) Write the sql query “At any point in time an employee cannot work more than once in a
project.In other terms (SSN,PNumber) is a sequenced primary key for WorksOn”

Ans. create trigger Seq_PK_WorksOn on WorksOn

after insert, update as

if exists ( select * from Inserted W1

where 1 < ( select count(*) from WorksOn W2

where W1.SSN = W2.SSN and W1.PNumber = W2.PNumber

and W1.FromDate < W2.ToDate and W2.FromDate < W1.ToDate ) )

begin

raiserror 13000

’At any point in time an employee cannot work more than once in a project’

rollback transaction

end

9) Write the sql query for finding the name(s) of the employee(s) who had the less salary on
1/1/2010. Make your own tables.

Ans. select E.FName, E.LName

from Employee E, EmployeeSalary S

where E.SSN = S.SSN

and salary = ( select min(salary) from EmployeeSalary

where FromDate => ’2010-01-01’ and ’2010-01-01’ > ToDate )

and S.FromDate => ’2010-01-01’ and ’2010-01-01’ > S.ToDate


10) Write the sql query for finding the name(s)of the employee(s) who had the highest salary
on 1/1/2002. Make your own tables.

Ans. select E.FName, E.LName

from Employee E, EmployeeSalary S

where E.SSN = S.SSN

and salary = ( select max(salary) from EmployeeSalary

where FromDate <= ’2002-01-01’ and ’2002-01-01’ < ToDate )

and S.FromDate <= ’2002-01-01’ and ’2002-01-01’ < S.ToDate


Module III
PART– B ((Long Answer Questions))

Ref: https://tinyurl.com/yk6zcqwq

7) Write the Algorithm Binding Passing analysis for Recursive


Predicates?
Algorithm 9.13 Binding passing analysis for recursive predicates

1. Initial ly A = fq g, with q the initial goal, where q is a recursive predicate and is not a totally free
adornment.

2. For each h 2 A, pass the binding to the heads of rules dening q.

3. For each recursive rule, determine the adornments of its recursive goals (i.e., of q or predicates
mutually recursive with q).

4. If the last step generated adornments not currently in A, add them to A and resume from step 2.
Otherwise halt.

The calling goal g is said to have the binding passing property when A does not contain any recursive
predicate with totally free adornment. In this case, we say that g has the unique binding passing
property when A contains only one adornment for each recursive predicate.

When the binding passing property does not hold, then a totally free adornment occurs, and
mutually recursive predicates must be computed as if the calling goal had no bound arguments.
Otherwise, the methods described in the previous sections are applicable, and the recursive
program is rewritten according to the method selected

9) Write the Algorithm Construction of the Rule-Goal graph rgg(P) for non-recursive program P?

Ans. The rule-goal graph for a program P is denoted rgg(P ). The rule-goal graph for a nonrecursive
program is constructed as follows:

Algorithm:

1. Initial step: The query goal is adorned according to the constants and deferred constants
(i.e., the variables preceded by $), and becomes the root of rgg(P ).
2. 2. Bindings passing from goals to rule heads: If the calling goal g unites with the head of the
rule r, with mgu , then we draw an edge (labeled with the name of the rule, i.e., r) from the
adorned calling goal to the adorned head, where the adornments for h(r) are computed as
follows: (i) all arguments bound in g are marked bound in h(r) ; (ii) all variables in such
arguments are also marked bound; and (iii) the arguments in h(r) that contain only constants
or variables marked bound in (ii) are adorned b, while the others are adorned f . For
instance, say that our goal is g = p(f (X1); Y1; Z1; a), and the head of r is h(r) = p(X2; g(X2 ;
Y2); Y2; W2). (If g and h(r) had variables in common, then a renaming step would be
required here.) A most general under exists for the two: = fX2=f (X1); Y1=g(f (X1); Y2); Z1=Y2;
W2=ag; thus, bindings might be passed from this goal to this
head in a top-down execution, and the resulting adornments of the head must be computed.
The united head is h(r) = p(f (X1); g(f (X1 ); Y2); Y2; a). For instance, say that the goal was
adorned pbf f b ; then variables in the rst argument of the head (i.e., X1) are bound. The
resulting adorned head is pbf f b , and there is an edge from pbf f b to pbf f b . But if the
adorned goal is pf bf b , then all the variables in the second argument of the head (i.e., X1;
Y2) are bound. Then the remaining arguments of the head are bound as well. In this case,
there is an edge from the adorned goal pf bf b to the adorned head pbbbb

3. Left-to-right passing of bindings to goals: A variable X is bound after the nth goal in a rule,
if X is among the bound head variables (as for the last step), or if X appears in one of the
goals of the rule preceding the nth goal. The (n + 1)th goal of the rule is adorned on the basis
of the variables that are bound after the nth goal.

The rule-goal graph determines the safety of the execution in a top-down mode and yields
an overall execution plan, under the simplifying assumption that the execution of a goal
binds all the variables in the goal

PART– C (Problem Solving and Critical Thinking Questions)


1) Find the seniors who satised all requirements for a cs degree.

Ans. seniors who satisfied all requirements for a cs degree cannot be expressed using ALL, but
must instead be expressed using double negation and existential quartiers.

Find senior students where there is no required cs course our senior has not taken.

SELECT Name

FROM student

WHERE Year = 'senior' AND Name NOT IN

(SELECT s.Name

FROM student s, req r

WHERE r.Major = 'cs' AND s.Year = 'senior' AND


NOT EXISTS

(SELECT t.*FROM took t

WHERE t.Course=r.Course AND

t.Name = s.Name

2) Find the name of junior-level students who have taken both cs101 and cs143 ?

Ans.

3) Write the query for “Junior-level Students who did not take course cs143”using Negation?
Ans.

4) Create a tables of student (Name, Major, Year), Took (Name, Course, Grade) and write the
query for “Find the senior students who are NOT missing any requirement” using Double
Negation?

Ans.

req missing(Name) student(Name; ; senior);

req(cs; Course);

-:hastaken(Name; Course).

all req sat(Name) student(Name; ; senior);

:req missing(Name).
Turning a universally quantized query into a doubly negated existential query is never without
difficulty, but this is a skill that can be mastered with some practice. Indeed, such a transformation is
common in natural languages, particularly in euphemistic nuances.

5) Given the relations: employee(name, salary, deptno) department (deptno, deptname,


address) Explain which query cannot be expressed using the basic relational algebra
operations?

Ans. The six basic operators of relational algebra are the selection(σ ), the projection(π), the
Cartesian product (x) (also called the cross product or cross join), the set union (U), the set
difference (-), and the rename (p). These six operators are fundamental in the sense that none of
them can be omitted without losing expressive power. Many other operators have been defined
in terms of these six. Among the most important are set intersection, division, and the natural
join, but aggregation is not possible with these basic relational algebra operations. So, we cannot
run sum of all employees’ salaries with the six operations

[The sum of all employees’ salaries can’t be expressed]

6) Explain how the magic sets and related methods are also applicable to programs that have
the binding passing property, but not the unique binding passing property. Apply the magic
sets method to the following example:
?sg(marc; Who).
sg(X; Y) <-- parent(XP; X); sg(YP; XP);
parent(YP; Y).
sg(A,A)

Ans. The recursive rule here states that X and Y are of the same generation if their respective parents
XP and YP also are of the same generation. The exit rule sg(X; X) states that every element of the
universe is of the same generation as itself. Obviously this rule is unsafe, and we cannot start a bottom-
up computation from it. However, consider a top-down computation on these rules, assuming for
simplicity that the fact parent(tom; marc) is in the database. Then, the resolvent of the query goal
with the first rule is parent(XP; marc); sg(XP; YP); parent(YP; Y). Then, by unifying the first goal in this
list with the fact parent(tom; marc), the new goal list become sg(tom; YP); parent(YP; Y). Thus, the
binding was passed from the first argument in the head to the first argument of the recursive predicate
in the body. Now, the recursive call unfolds as in the previous case , yielding the parents of tom, who
are the grandparents of marc. In summary, the top-down computation generates all the ancestors of
marc using the recursive rule. This computation causes the instantiation of variables X and XP while Y
and YP remain unbound. The basic idea of magic sets is to emulate this top-down binding passing using
rules to be executed in a bottom-up fashion Therefore, we can begin by restricting our attention to
the bound arguments and use the following rule: sg(X) parent(XP; X); sg(XP). Then, we observe that
the top-down process where bindings are passed from X to XP through parent can be emulated by the
bottom-up execution of the magic rule m:sg(XP) m:sg(X); parent(XP; X); ; the rule is constructed from
the last one by exchanging the head with the recursive goal (and adding the prefix \m."). Finally, as
the exit rule for the magic predicate, we add the fact m:sg(marc), where marc is the query constant.

the magic predicate m:sg is computed as shown by the first two rules in Example 1. shows how the
original rules are rewritten with the addition of the magic goal m:sg to restrict the bottom up
computation.
The magic sets method applied to Example 1

m:sg(marc).

m:sg(XP) m:sg(X); parent(XP; X).

sg0(X; X) m:sg(X).

sg0(X; Y) parent(XP; X); sg0(XP; YP); parent(YP; Y); m:sg(X).

?sg0(marc; Z).

Observe Example 1 , the exit rule has become safe as a result of the magic sets rewriting, since
only people who are ancestors of marc are considered by the transformed rules. Moreover, the magic
goal in the recursive rule is useful in narrowing the search because it eliminates people who are not
ancestors of marc.

7) Write the Program on Recursive View in SQL using following Table?

Ans. CREATE RECURSIVE VIEW prodDetails (Part_cost, Assembly) AS


SELECT
Part_cost,
BASIC-PART AS subpart
FROM
Assembly
WHERE
BASIC-PART IS NULL
UNION ALL
SELECT
p.Part_cost,
(
rl.subpart || ' > ' || e. BASIC-PART
) AS part
FROM
Part_cost pc

SELECT
Part,

FROM
Assembly
ORDER BY
BASIC-PART;
8) Create a tables of Part_Cost (BASIC-PART,SUPPLIER, COST, TIME), Assembly (PART,
SUBPART, QTY) and write the query for "find the parts using 'top_tube'" using recursive
queries?

Ans.

WITH RECURSIVE all super(Major, Minor) AS ( SELECT PART, SUBPART

FROM assembly

UNION

SELECT assb.PART, all.Minor

FROM assembly assb, all super all

WHERE assb.SUBPART = all.Major

SELECT *

WHERE Minor = 'top tube

9) Create a tables of Part_Cost (BASIC-PART, SUPPLIER, COST, TIME), Assembly (PART,


SUBPART, QTY) and write the query for "Materialization of the view of recursive view?

Ans.

Materialized views are excessively stored query execution results in the database. They can be used
to partially or completely answer queries which will be further appeared instead of re-executing query
from the scratch. There is a large number of published works that address the maintenance, especially
incremental update, of materialized views and query rewriting for using those ones. Some of them
support materialized views based on recursive query in datalog language. Although most of datalog
queries can be transferred into SQL queries and vice versa but it is not the case for recursive queries.
Recursive queries in the data log try to find all possible transitive closures. Recursive queries in SQL
(Common Table Expression – CTE) return direct links but not transitive closures.

CREATE RECURSIVE view all subparts(Major, Minor) AS

SELECT PART SUBPART


FROM assembly

UNION

SELECT all.Major assb.SUBPART

FROM all subparts all, assembly assb

WHERE all.Minor= assb.PART

The SELECT statement before UNION is obviously equivalent to the exit rule in Example 8.15, while
the SELECT statement after UNION corresponds to the recursive rule. Therefore we will refer to them
as exit select and recursive select, respectively. Since all subparts is a virtual view, an actual query on
this view is needed to materialize the recursive relation or portions thereof. For instance, the query
of Ref Answer 8 requests the materialization of the whole relation.

You might also like