# Recent questions and answers in Databases

1 vote
1
Suppose that we are using extendable hashing on a file that contains records with the following search-key values: $2, 3, 5, 7, 11, 17, 19, 23, 29, 31$ Show the extendable hash structure for this file if the hash function is $h(x)$ $=$ $x$ $mod$ $8$ and buckets can hold three records.
1 vote
2
Which one of the following statements are not correct? $S1$: $3$NF decomposition is always lossless join and dependency preserving. $S2$: $3$NF decomposition is always lossless join but may or may not be dependency preserving. $S3$: BCNF decomposition is always lossless join and dependency ... but may or may not be dependency preserving. Only $S1$ Only $S4$ Both $S1$ and $S4$ Both $S2$ and $S3$
3
Consider a selection of the form $\sigma_{A\leq 100} (r)$, where $r$ is a relation with $1000$ tuples. Assume that the attribute values for $A$ among the tuples are uniformly distributed in the interval $[0, 500].$ Which one of the following options is the best estimate of the number of tuples returned by the given selection query ? $50$ $100$ $150$ $200$
4
The following relations are used to store data about students, courses, enrollment of students in courses and teachers of courses. Attributes for primary key in each relation are marked by *'. Students (rollno*, sname, saddr) courses (cno*, cname) enroll(rollno* ... number and name of students who got A grade in at least one course taught by teacher names Ramesh for the above relational database.
5
Let R = (A, B) and S = (A, C), and let r (R) and s(S) be relations. Using the special constant null, write tuple-relational-calculus expressions equivalent to each of the following: a. r $ROJ$ s b. r $FOJ$ s c. r $LOJ$ s
6
7
Consider the following two transactions : T1 and T2. T1 : read (A); T2 : read (B); read (B); read (A); if A = 0 then B ← B + 1; if B ≠ 0 then A ← A - 1; write (B); write (A); Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two ... B ← B + 1; then A ← A - 1; write (B); write (A); unlock (A); unlock (A); unlock (B); unlock (B); commit; commit;
8
give domain relation calculus expression works(person-name, company-name, salary) find the names of all employees who earn more than every employee of Small Bank Corporation
9
For a database relation $R(a,b,c,d)$ where the domains of $a,b,c,d$ include only atomic values, only the following functional dependencies and those that can be inferred from them hold: $a\to c\\b\to d$ the relation is in first normal form but not in second normal form. second normal form but not in third normal form. third normal form. none of these.
10
Which of the following has same expressive power with regard to relational query language? Rational algebra and domain relational calculus Relational algebra and tuples relational calculus Relational algebra and domain relational calculus restricted to safe expression Relational algebra and tuples relational calculus restricted to safe expression a and b only c and d only a and c only b and d only
11
Describe the relational algebraic expression giving the relation returned by the following SQL query. Select SNAME from S Where SNOin (select SNO from SP where PNOin (select PNO from P Where COLOUR='BLUE'))
12
A primary key, if combined with a foreign key creates parent child relationship between the tables that connect them many-to-many relationship between the tables that connect them network model between the tables that connect them none of these
13
Consider the following relations $A, B$ and $C:$ ... of $A\cup B$ is the same as that of $A$. $(A\cup B)\bowtie _{A.Id > 40 \vee C.Id < 15} C$ $7$ $4$ $5$ $9$
14
Let $E_1$ and $E_2$ be two entities in an $E/R$ diagram with simple-valued attributes. $R_1$ and $R_2$ are two relationships between $E_1$ and $E_2$, where $R_1$ is one-to-many and $R_2$ is many-to-many. $R_1$ and $R_2$ do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model? $2$ $3$ $4$ $5$
15
Consider the following table: $\text{Faculty(facName, dept, office, rank, dateHired)}$ facName dept office rank dateHired Ravi Art A101 Professor 1975 Murali Math M201 Assistant 2000 Narayanan Art A101 Associate 1992 Lakshmi Math M201 Professor 1982 Mohan CSC C101 Professor 1980 Sreeni Math M203 ... Then $Faculty$ is Not in 3NF,in BCNF In 3NF,not in BCNF In 3NF, in BCNF Not in 3NF, not in BCNF
16
how many view equivalent schedules are possible for the Sch given below:
17
Consider relations $R(A, B)$ and $S(B, C)$. Find a propositional formula $\phi$ such that the following two relational algebra expressions produce the same answer. $\pi_{A,B}(\sigma_\phi(R \bowtie S))$ $R \cap ({\rho_T(A)}(\pi_C(S)) \times \pi_B(S))$
18
B+ Trees are considered BALANCED because. The lengths of the paths from the root to all leaf nodes are all equal. The lengths of the paths from the root to all leaf nodes differ from each other by at most $1$. The number of children of any two non-leaf sibling nodes differ by at most $1$. The number of records in any two leaf nodes differ by at most $1$.
19
20
What is Granularity? The size of database The size of data item The size of record The size of file
21
The problem that occurs when one transaction updates a database item and the transaction fails for some reason is Temporary Select Problem Temporary Modify Problem Dirty Read Problem None
22
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.
23
24
Given the basic ER and relational models, which of the following is INCORRECT? An attribute of an entity can have more than one value An attribute of an entity can be composite In a row of a relational table, an attribute can have more than one value In a row of a relational table, an attribute can have exactly one value or a NULL value
25
Let R(ABCDE) be a relational schema and F={AB->CD, ABC->E,C->A}. The number of candidate keys are a) 1 b) 2 c) 3 d) 4 Is there some standard way to solve such problem.. or we have to consider each Functional Dependency...?Please explain...
26
Choose the correct alternatives (More than one may be correct). Indicate which of the following statements are true: A relational database which is in 3NF may still have undesirable data redundancy because there may exist: Transitive functional ... trivial functional dependencies involving prime attributes only on the left-side. Non-trivial functional dependencies involving only prime attributes.
27
The minimum number of tables to represent ER-Diagram such that the relational database satisfies 1NF.
28
Given two R union compatible relation R1 (A, B) and R2 (C, D) what is the result of the operation R1 A= C AB = D R2? a) R1&#8899;R2 b) R1 &#10799; R2 c) R1 &ndash; R2 d) R1 &cap;R2 How to solve these kind of questions
29
Which level of locking provides the highest degree of concurrency in a relational database ? Page Table Row Page, table and row level locking allow the same degree of concurrency
30
With regards to the expressive power of the formal relational query languages, which of the following statements is true? Relational algebra is more powerful than relational calculus Relational algebra has the same power as relational calculus Relational algebra has the same power as safe relational calculus None of the above
31
Which one of the following statements is $\text{FALSE}$? Any relation with two attributes is in $\text{BCNF}$ A relation in which every key has only one attribute is in $2NF$ A prime attribute can be transitively dependent on a key in a $3NF$ relation A prime attribute can be transitively dependent on a key in a $\text{BCNF}$ relation
32
ORACLE supports: (A) inner join and outer join only (B) outer join and semi join only (C) inner join, outer join , semi join only (D) inner join, outer join, semi join and anti join
33
Which of the following is TRUE? Every relation in 3NF is also in BCNF A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R Every relation in BCNF is also in 3NF No relation can be in both BCNF and 3NF
34
If every non-key attribute is functionally dependent on the primary key then the relation will be in   A. 1NF                          B. 2NF                        C. 3NF                             D. 4NF I think the answer should be 2NF, but in the key it is given 3NF
1 vote
35
36
Which one of the following is a key factor for preferring $B$-trees to binary search trees for indexing database relations? Database relations have a large number of records Database relations are sorted on the primary key $B$-trees require less memory than binary search trees Data transfer from disks is in blocks
37
If $R$ is a relation in Relational Data Model and $A_1,A_2,\dots A_n$ are the attributes of relation $R$, what is the cardinality of $R$ expressed in terms of domain of attributes? $\mid R\mid\leq\mid \text{ dom }(A_1) \times \text{ dom } (A_2)\dots \text{ dom } (A_n)\mid$ ...