What are disjoint and overlapping constraints? Give an example for each of them
ID: 3862120 • Letter: W
Question
What are disjoint and overlapping constraints? Give an example for each of them ?
Explain the difference between a weak and a strong entity set.?
How the primary key for a weak entity set is formed?
instructor(ID, name, dept_name, salary)
teaches(ID, course id, sec id, semester, year)
3. Write an equivalent relational algebra expression for the following using natural join and the above given schemas.
name (sinstructor.ID =teaches.ID (sdept_name =“Physics” (instructor × teaches)))
3.b List all the fundamentals or basic Relational Algebra operators and briefly explain the function of each.
Explanation / Answer
Disjoint Constraint : this constraing acts as a sub class ie it can be any one of the specialization.
For Eg. an employee can either be a manager,technician,secretary etc.
Overlapping Constraints : These constraints often refer to the superclass ie it can be a part of more than one subclass.
For Eg. a person can have any or all of the id proofs like passport, Driving Lisence, etc.
Weak Entity : An entity which does not have sufficient attributes to form a primary key. Each weak set must be a part of one-to-many relationship set.
Strong Entity : An entity which has one or more attributes for primary key.
Primary key of a weak entity is formed by combining an attribute of weak entity with the primary key of strong entity on which it is dependent.
Equivalent Exp :
name(dept_name="Physics"(instructor instructor.ID=teaches.ID teaches))
The fundamental operations of relational algebra are as follows
Select : It selects tuples that satisfy the given predicate from a relation.
Notation p(r)
Where stands for selection predicate and r stands for relation.
Project : It projects column(s) that satisfy a given predicate.
Notation A1, A2, An (r)
Where A1, A2 , An are attribute names of relation r.
Union : It performs binary union between two given relations
Notation r U s
Where r and s are either database relations or relation result set.
Set difference: The result of set difference operation is tuples, which are present in one relation but are not in the second relation.
Notation r s
Finds all the tuples that are present in r but not in s.
Cartesian product : Combines information of two different relations into one.
Notation r s
Where r and s are relations and their output will be defined as
r s = { q t | q E r and t E s}
Rename : The results of relational algebra are also relations but without any name. The rename operation allows us to rename the output relation. 'rename' operation is denoted with small Greek letter rho .
Notation x (E)
Where the result of expression E is saved with name of x
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.