Database Questions and Answers – Tuple Relational Calculus and Domain Relational Calculus

This set of Database test focuses on “Tuple Relational Calculus and Domain Relational Calculus”.

1. Find the ID, name, dept name, salary for instructors whose salary is greater than $80,000 .
a) {t | t ε instructor ∧ t[salary] > 80000}
b) Э t ∈ r (Q(t))
c) {t | Э s ε instructor (t[ID] = s[ID]∧ s[salary] > 80000)}
d) None of the mentioned
View Answer

Answer: a
Explanation: This expression is in tuple relational format.

2. A query in the tuple relational calculus is expressed as:
a) {t | P() | t}
b) {P(t) | t }
c) {t | P(t)}
d) All of the mentioned
View Answer

Answer: c
Explanation: The tuple relational calculus, is a nonprocedural query language. It describes the desired information without giving a specific procedure for obtaining that information.

3.

advertisement
advertisement
{t | Э s ε instructor (t[name] = s[name]
∧ Э u ε department (u[dept name] = s[dept name]
∧ u[building] = “Watson”))}

Which of the following best describes the query?
a) Finds the names of all instructors whose department is in the Watson building
b) Finds the names of all department is in the Watson building
c) Finds the name of the dapartment whose instructor and building is Watson
d) Returns the building name of all the departments
View Answer

Answer: a
Explanation: This query has two “there exists” clauses in our tuple-relational-calculus expression, connected by and (∧).
Note: Join free Sanfoundry classes at Telegram or Youtube

4. Which of the following symbol is used in the place of except?
a) ^
b) V
c) ¬
d) ~
View Answer

Answer: c
Explanation: The query ¬P negates the value of P.

5. “Find all students who have taken all courses offered in the Biology department.” The expressions that matches this sentence is :
a) Э t ε r (Q(t))
b) ∀ t ε r (Q(t))
c) ¬ t ε r (Q(t))
d) ~ t ε r (Q(t))
View Answer

Answer: b
Explanation: ∀ is used denote “for all” in SQL.
advertisement

6. Which of the following is the comparison operator in tuple relational calculus
a) ⇒
b) =
c) ε
d) All of the mentioned
View Answer

Answer: b
Explanation: The comparison operators are (<, ≤, =, =, >, ≥).

7. An expression in the domain relational calculus is of the form
a) {P(x1, x2, . . . , xn) | < x1, x2, . . . , xn > }
b) {x1, x2, . . . , xn | < x1, x2, . . . , xn > }
c) { x1, x2, . . . , xn | x1, x2, . . . , xn}
d) {< x1, x2, . . . , xn > | P(x1, x2, . . . , xn)}
View Answer

Answer: d
Explanation: Here x1, x2, . . . , xn represent domain variables. P represents a formula composed of atoms, as was the case in the tuple relational calculus.
advertisement

8. Find the names of all instructors in the Physics department together with the course id of all courses they teach:
a)

{< c > | Э s (< c, a, s, y, b, r, t >ε section
∧s = “Fall” ∧ y = “2009”
∨Эu (< c, a, s, y, b, r, t >ε section
∧s = “Spring” ∧ y = “2010”

b)

{< n, c > | Э i, a (< i, c, a, s, y > ε teaches
∧ Э d, s (< i, n, d, s > ε instructor ∧ d = “Physics”))}

c)

{< n > | Э i, d, s (< i, n, d, s > ε instructor ∧ s > 80000)}

d)

{< i, n, d, s > | < i, n, d, s > ε instructor ∧ s > 80000}
View Answer
Answer: b
Explanation: None.
 
 

9. In domain relaional calculus “there exist” can be expressed as
a) (P1(x))
b) (P1(x)) Э x
c) V x (P1(x))
d) Э x (P1(x))
View Answer

Answer: d
Explanation:Э is used to denote “some” values in relational calculus.

10. A set of possible data values is called
a) Attribute
b) Degree
c) Tuple
d) Domain
View Answer

Answer: d
Explanation: None.

Sanfoundry Global Education & Learning Series – Database Management System.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.