Docsity

Exam 2 Sample Questions - Database System Design | CSCE 520, Exams of Computer Science

Toggle sidebar
bg1
SAMPLE Name:
TEST 2
CSCE 520โ€“ Spring 2003
April 10, 2003
Answer the following questions. Be brief and precise, please.
You have 1 hour 15 minutes to finish the exam.
Undergraduate students!!! Answer only question for a total of 85!
1.
2. Exercises similar to Database Systems the Complete book Chapter 5 and 6, writing Relational
Alg. queries, and SQL queries, insert, update statements.
3. Understand constraints, assertions, triggers, their timings of verification, and basic syntax.
4. Describe the components of triggers, like ({BEFORE, AFTER, INSTEAD OF} {INSERT,
DELETE, UPDATE}.
5. Let R(A,B) be the following table: r=[(1, 2), (1, 3), (1,2), (2, 5), (3, 5), (2, 3)]
Show the answers to the following queries:
Query 1: (
p
A,B (
s
A=1(R ))
Query 2:
Select A, B
FROM R
WHERE A=1
What does it mean that SQL operates on bags. Why are bags more efficient to manage than sets?
6. SQL query may have five different clauses, a SELECT, FROM, WHERE, GROUP BY and
HAVING clause. Explain how each of these clauses works and how they are evaluated in an
SQL query. Give an example using all five clauses.
7. Given two relation schemas R(A1,A2) and S(A1,A3) define a relational algebra expression
which is the equivalent of R NATURALJOIN S using only operations from the following list:
union, difference, Cartesian product, projection, selection, renaming.
8. Given two relations R(A,B) and S(A, B), show how to express intersection R ๏ƒ‡ S using set
differences only.
1

Partial preview of the text

Download Exam 2 Sample Questions - Database System Design | CSCE 520 and more Exams Computer Science in PDF only on Docsity!

SAMPLE Name:

TEST 2

CSCE 520โ€“ Spring 2003 April 10, 2003 Answer the following questions. Be brief and precise, please. You have 1 hour 15 minutes to finish the exam. Undergraduate students !!! Answer only question for a total of 85!

  1. Exercises similar to Database Systems the Complete book Chapter 5 and 6, writing Relational Alg. queries, and SQL queries, insert, update statements.

  2. Understand constraints, assertions, triggers, their timings of verification, and basic syntax.

  3. Describe the components of triggers, like ({BEFORE, AFTER, INSTEAD OF} {INSERT, DELETE, UPDATE}.

  4. Let R(A,B) be the following table: r=[(1, 2), (1, 3), (1,2), (2, 5), (3, 5), (2, 3)] Show the answers to the following queries: Query 1: ( p A,B ( s A=1(R )) Query 2: Select A, B FROM R WHERE A= What does it mean that SQL operates on bags. Why are bags more efficient to manage than sets?

  5. SQL query may have five different clauses, a SELECT, FROM, WHERE, GROUP BY and HAVING clause. Explain how each of these clauses works and how they are evaluated in an SQL query. Give an example using all five clauses.

  6. Given two relation schemas R(A1,A2) and S(A1,A3) define a relational algebra expression which is the equivalent of R NATURALJOIN S using only operations from the following list: union, difference, Cartesian product, projection, selection, renaming.

  7. Given two relations R(A,B) and S(A, B), show how to express intersection R ๏ƒ‡ S using set differences only.