# Recent questions and answers in Databases

1
how many view equivalent schedules are possible for the Sch given below:
2
1 vote
3
Consider the following relation: R (A B C) A primary key with 100 tuples. S (E F G) E primary key with 50 tuples. T (AE D) AE primary key with 80 tuples. U (D G H) H primary key with 10 tuples. The maximum number of possible records in the result of _______.
4
Consider the timestamp ordering protocol, and two transactions, one that writes two data items p and q, and another that reads the same two data items. Give a schedule whereby the timestamp test for a write operation fails and causes the first transaction to be ... carry out actions, but are unable to complete their task because of interaction with the other processes, is called a live lock.)
5
Find minimum number of tables required for converting the following entity relationship diagram into relational database? $2$ $4$ $3$ $5$
6
Consider the following entity relationship diagram $(ERD)$, where two entities $E1$ and $E2$ have a relation $R$ of cardinality 1:m. The attributes of $E1$ are $A11$, $A12$ and $A13$ where $A11$ is the key attribute. The attributes of $E2$ are $A21$, $A22$ and $A23$ where ... of the third normal form ($3NF$) is designed from the above $ERD$. The number of tables in the database is $2$ $3$ $5$ $4$
7
Consider the following statements $S1$ and $S2$ about the relational data model: $S1$: A relation scheme can have at most one foreign key. $S2$: A foreign key in a relation scheme $R$ cannot be used to refer to tuples of $R.$ Which one of the following choices is correct? Both $S1$ and $S2$ are true $S1$ is true and $S2$ is false $S1$ is false and $S2$ is true Both $S1$ and $S2$ are false
8
Which of the following statements are TRUE about an SQL query? P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause R : All attributes used in the GROUP BY clause ... S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause P and R P and S Q and R Q and S
9
Consider the following relational schema: $\text{Student} (\underline{\text{school-id}, \text{sch-roll-no}}, \text{sname}, \text{saddress})$ $\text{School} (\underline{\text{school-id}}, \text{sch-name}, \text{sch-address}, \text{sch-phone})$ ... in it, the name of the school and the number of its students scoring $100$ in at least one exam nothing; the query has a syntax error
10
The below figure shows a $B^+$ tree where only key values are indicated in the records. Each block can hold upto three records. A record with a key value $34$ is inserted into the $B^+$ tree. Obtain the modified $B^+$ tree after insertion.
11
Which one of the following statements about normal forms is $\text{FALSE}?$ $\text{BCNF}$ is stricter than $\text{3NF}$ Lossless, dependency-preserving decomposition into $\text{3NF}$ is always possible Lossless, dependency-preserving decomposition into $\text{BCNF}$ is always possible Any relation with two attributes is in $\text{BCNF}$
1 vote
12
Consider two $n \times 1$ vectors $u$ and $v$ , stored as table $U(\text{ind,val})$ and $V(\text{ind,val})$ with the same schema A row $(i,u_i)$ of table $U$ specifies the $i^{th}$ element of vector $u$ has value $u_i$ (similarly for $v$, ... $u + v$ of the two vectors $u$ and $v$. Explain your solution.
1 vote
13
The following relation records the age of $500$ employees of a company, where $empNo$ (indicating the employee number) is the key: $empAge(\underline{empNo},age)$ ... one other employee Employee numbers of all employees whose age is not the minimum Employee numbers of all employees whose age is the minimum
1 vote
14
Is there a chance for Deadlock in Graph based protocol?
1 vote
15
I know that every schedule produced by the Timestamp-based protocol is conflict serializable. But is vice versa is true? Means is all conflict serializable schedules produced by timestamp based protocol ?
1 vote
16
17
Consider the relation $R(P,Q,S,T,X,Y,Z,W)$ with the following functional dependencies. $PQ\rightarrow X;\quad P\rightarrow YX;\quad Q\rightarrow Y; \quad Y\rightarrow ZW$ Consider the decomposition of the relation $R$ into the constituent relations according to ... , but $D_2$ is a lossless decomposition Both $D_1$ and $D_2$ are lossless decompositions Both $D_1$ and $D_2$ are lossy decompositions
1 vote
18
19
R always in "3NF" but "may not BCNF" T/F and why?
20
Consider a join (relation algebra) between relations $r(R)$ and $s(S)$ using the nested loop method. There are $3$ buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results. Assuming $\text{size}(r(R))<\text{size}(s(S)),$ the join will have ... $s(S)$ is more than $0.5$. join selection factor between $r(R)$ and $s(S)$ is less than $0.5$.
21
Consider the following relation schema pertaining to a students database: Students (rollno, name, address) Enroll (rollno, courseno, coursename) where the primary keys are shown underlined. The number of tuples in the student and Enroll tables are $120$ and $8$ respectively. What are the maximum and ... in (Student * Enroll), where *' denotes natural join? $8, 8$ $120, 8$ $960, 8$ $960, 120$
22
Given two tables EMPLOYEE (EID, ENAME, DEPTNO) DEPARTMENT (DEPTNO, DEPTNAME) Find the most appropriate statement of the given query: Select count (*) total' from EMPLOYEE where DEPTNO IN (D1,D2) group by DEPTNO having count (*) >5 Total number of employees in each ... $>5$ Display total number of employees in both departments $D1$ and $D2$ The output of the query must have at least two rows
23
To undo the effects of a committed transaction the only way is a) rollback transaction b) abort transaction c) execute a compensating transaction d)None of these
24
______ is NOT a part of the ACID properties Inconsistency Consistency Atomicity Isolation
1 vote
25
For a $B^+$ - tree of order $d$ with $n$ leaf nodes, the number of nodes accessed during a search is $O(\_)$.
26
Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions or during recovery. Which of the following statements is/are correct? The same undo and redo list ... any further All the transactions that are already undone and redone will not be recovered again The database will become inconsistent
27
Which of the following is a fundamental operation in relational algebra? Set intersection Natural join Assignment None of the above
1 vote
28
Database systems that store each relation in a separate operating system file may use the operating system's authorization scheme, instead of defining a special scheme themselves. In this case, which of the following is false? The administrator enjoys more control on ... in a file Operations on the database are speeded up as the authorization procedure is carried out at the operating system level
1 vote
29
is this is cascadeless? r1(X),w2(X),w1(X), abort2, commit1
30
A primary key for an entity is a candidate key any attribute a unique attribute a superkey
31
Indicate which of the following statements are true: A relational database which is in $3$NF may still have undesirable data redundancy because there may exist: Transitive functional dependencies Non-trivial functional dependencies involving prime ... functional dependencies involving prime attributes only on the left-side. Non-trivial functional dependencies involving only prime attributes.
32
Consider three data items $D1, D2,$ and $D3,$ and the following execution schedule of transactions $T1, T2,$ and $T3.$ In the diagram, $R(D)$ and $W(D)$ denote the actions reading and writing the data item $D$ ... $T2; T3; T1$ The schedule is serializable as $T2; T1; T3$ The schedule is serializable as $T3; T2; T1$ The schedule is not serializable
33
The E-R model is expressed in term of I. Entities II. The relationship among entities. III. The attributes of the entities. IV. Functional relationship. (A) I, II (B) I, II, IV (C) II, II, IV (D) I, II, III
34
In a relational Schema, each tuple is divided into fields called relations domains queries none of these
35
The $\text{E-R}$ model is expressed in terms of : Entities The relationship among entities The attributes of the entities Then (i) and (iii) (i) and (ii) (ii) and (iii) None of the above
36
An entity has: (i) a set of properties (ii) a set of properties and values for all the properties (iii) a set of properties and the values for some set of properties may non-uniquely identify an entity (iv) a set of properties and the values for some set of properties may uniquely identify an entity Which of the above are valid? (i) only (ii) only (iii) only (iv) only
37
An Entity-relationship diagram is a tool to represent Data model Process model Event model Customer model
Suppose we have a database consisting of the following three relations. $\text{FREQUENTS (student, parlor)}$ giving the parlors each student visits. $\text{SERVES (parlor, ice-cream)}$ ... parlor) Express the following in SQL: Print the students that frequent at least one parlor that serves some ice-cream that they like.