Online Test - 4 Database Management System
GATE Online Exam Practice Test Database Management System (DBMS)
Questions
Which of the following scenarios may lead to an irrecoverable error in a database system?
- A transaction writes a data item after it is read by an uncommitted transaction.
- A transaction reads a data item after it is read by an uncommitted transaction.
- A transaction reads a data item after it is written by a committed transaction.
- A transaction reads a data item after it is written by an uncommitted transaction.
What happens when a primary key is combined with a foreign key?
- It connects network model between the tables that connect them.
- It connects many-to-many relationship between the tables that connect them.
- It connects parent child relationship between the tables that connect them.
- None of these
Consider the set of relations shown below and the SQL query that follows:
Students: (Roll_ number, Name, Date_ of_ birth)
Courses: (Course_ number, Course_ name, instructor)
Grades: (Roll_ number, Course_number, grade)
Select distinct name
from students, courses, Grades
where students. Roll_number = Grades.
Roll_number
and Courses. Instructor = Korth
Courses. Courses_ number = Grades
Courses_ number and Grades. grade = A
Which of the following sets is computed by the above query?
- Names of students who have got A grade in all courses taught by Korth.
- Names of students who have got A grade in all courses.
- Names of students who have got A grade in at least one of the courses taught by Korth.
- None of above
Which of the following does the database administrator coordinate?
- DBMS and data base
- Application program and data base
- Data base and users
- Application program and users
A relational database, which is in 3NF, may have undesirable data redundancy because there may exist
- non-trivial functional dependencies involving prime attributes on the right side
- non -trivial functional dependencies involving only prime attributes
- either (1) or (2)
- both (1) and (2)
Which of the following relationship calculus-expressions is not safe?
- $\left\\\{t \mid \exists u \in R_1\left(t[A] = u[A]\right) \land \neg \exists s \in R_2 \left(t[A] = s[A]\right)\right\\\}$
- $\left\\\{t \mid \neg (t \in R_1)\right\\\} $
- $\left\\\{t \mid \exists u \in R_1\left(t[A]=u[A]\right) \land \exists s \in R_2 \left(t[A] = s[A]\right)\right\\\}$
- Both (1) and (3) are safe.
Consider a relation geq, which represents “greater than or equal to”, i.e. (x, y)$\in$ geq only if y > = x.
Create table geq:
(
lb integer not null
ub integer not null
primary key lb
foreign key (ub) references geq on delete cascade
)
If a tuple (x, y) is deleted, which of the following is possible?
- A tuple (z, w), with z > y is deleted.
- A tuple (z, w), with z > x is deleted.
- A tuple (z, w), with w < x is deleted.
- The deletion of (x, y) is prohibited.
These are five records in a data base:
| Name | Age | Occupation | Category |
| Neha | 23 | CON | A |
| Dhruti | 24 | ENG | B |
| Sonika | 25 | DOC | C |
| Poonam | 26 | SER | D |
There is an index file associated with this and it contains the values: 1, 3, 2, 4. Which of the following fields is the index built form?
- Age
- Name
- Occupation
- Category
Given relations: $\gamma$ (w, x) and S (y, z), the result of select distinct w, x. From r, S is guaranteed to be the same as $\gamma$, empty. Which among the following is correct?
- $\gamma$ has no duplicates and s is non empty.
- $\gamma$ and s have no duplicates.
- S has no duplicates and $\gamma$ is non empty.
- $\gamma$ and S have the same number of tuples.