Unit-1, 2 and 3
Unit-1, 2 and 3
Unit- 1, 2 and 3
1. Given the relations
employee (name, salary, deptno) and
department (deptno, deptname, address)
Solution: (a)
The query selects all attributes of r. Since we have distinct in query, result can be
equal to r only if r doesn’t have duplicates.
If we do not give any attribute on which we want to join two tables, then the
queries like above become equivalent to Cartesian product. Cartisian product of
two sets will be empty if any of the two sets is empty. So, s should have atleast one
record to get all rows of r.
3. Which of the following is TRUE?
Solution: (c)
BCNF is a stronger version 3NF. So every relation in BCNF will also be in 3NF.
4. Every time attribute A appears, it is matched with the same value
of attribute B, but not the same value of attribute C. Therefore, it is
true that:
A. A → B.
B. A → C.
C. A → (B,C).
D. (B,C) → A.
5. Consider a relational table with a single record for each registered
student with the following attributes.
1. Registration_Number: Unique registration number for each registered
student
2. UID: Unique Identity number, unique at the national level for each citizen
3. BankAccount_Number: Unique account number at the bank. A student
can have multiple accounts or joint accounts. This attributes stores the
primary account number
4. Name: Name of the Student
5. Hostel_Room: Room number of the hostel
Solution: (c)
Closure of AF or AF+ = {ADEF}, closure of AF doesn’t contain C and G.
8. A top-to-bottom relationship among the items in a database is
established by a __________ .
A) Hierarchical schema
B) Network schema
C) Relational Schema
D) All of the above
9. State true or false.
i) The select operator is not a unary operator.
ii) The project operator chooses a subset of attributes or columns of
a relation.
A) i-True, ii-False
B) i-True, ii-True
C) i-False, ii-True
D) i-False, ii-False
10. Which of the syntax is CORRECT for insert statement?
i) insert into <table_name> values <list of values>
ii) insert into <table_name> (column list) values <list of values>
A) i-only
B) ii-only
C) Both of them
D) None of them
11. ____________ is a special type of integrity constraint that
relates two relations & maintains consistency across the relations.
A) Local Key
B) Primary Key
C) Composite Key
D) Foreign Key
13. ________ is used to determine whether a table contains
duplicate rows.
A) Unique predicate
B) Like Predicate
C) Null predicate
D) In predicate
14. The number of tuples in a relation is called its _______While the
number of attributes in a relation is called it’s _________ .
A) Degree, Cardinality
B) Cardinality, Degree
C) Rows, Columns
D) Columns, Rows
15. __________ is a combination of two of more attributes used as a
primary key.
A) Composite Key
B) Alternate Key
C) Candidate Key
D) Foreign Key
16. Which of the following query is CORRECT for using comparison
operators in SQL?
A. MAX
B. MIN
C. TOTAL
D. AVG
20. In SQL, which of the following is a data definition language
commands?
A. RENAME