Dbms All Pyq With Solution
Dbms All Pyq With Solution
i ➥ A candidate key is minimal set of one or more attributes that, taken collectively, allow us to
uniquely identify any entity in the entity set.
ii ➥ A candidate key for which no proper subset is also a candidate key is called a super key.
iii ➥ A super key is a set of one or more attributes that, taken collectively, allows us to uniquely
identify any entity in the entity set.
iv ➥ A super key for which no proper subset is also a super key is called a candidate key.
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ eid
ii ➥ did
iii ➥ eid, did
iv ➥ eid, did, enameeid, did, ename
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ X→Y, Z→X
ii ➥ Y→Z, Z→X
iii ➥ X→Y, X→Z
iv ➥ Y→X, X→Z
Best Explanation:
Answer: (iii)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ A, B only
ii ➥ B, C, D only
iii ➥ A, B, C only
iv ➥ A, B, C, D
Best Explanation:
Answer: (iv)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ A, B
ii ➥ A, C
iii ➥ B, C
iv ➥ A, B, C
Best Explanation:
Answer: (i)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ R1∩ R2
ii ➥ R1- R2
iii ➥ R1- (R1-R2)
iv ➥ R1∪R2
Best Explanation:
Answer: (i), (iii)
Explanation: Upload Soon
i ➥ (A)-(III),(B)-(II),(C)-(IV),(D)-(I)
ii ➥ (A)-(II),(B)-(IV),(C)-(I),(D)-(III)
iii ➥ (A)-(II),(B)-(III),(C)-(IV),(D)-(I)
iv ➥ (A)-(II),(B)-(I),(C)-(IV),(D)-(III)
Best Explanation:
Answer: (iii)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ Both Q1 and Q3
ii ➥ Both Q2 and Q3
iii ➥ Only Q3
iv ➥ Only Q2
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
Which of the following relational algebra query computes the names of sailors who have reserved a red and a green boat?
i➥
ii ➥
iii ➥
iv ➥
Best Explanation:
Answer: (i)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ Both Q1 and Q2
ii ➥ Both Q2 and Q3
iii ➥ Only Q1
iv ➥ Only Q2
Best Explanation:
Answer: (i)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i➥
ii ➥
iii ➥
iv ➥
Best Explanation:
Answer: (i)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
Which of the following relational algebra query computes the names of sailor who have reserved all boats ?
i➥
ii ➥
iii ➥
iv ➥
Best Explanation:
Answer: (ii)
Explanation: Upload Soon
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
A. FAILED
B. TERMINATED
C. PARTIALLY COMMITTED
D. COMMITTED
E. ACTIVE
Given a transaction in active state during its execution, find its next transitioned state from the
options given below:
i ➥ A only
ii ➥ C only
iii ➥ D only
iv ➥ Either A or C only
i ➥ Buffer manager
ii ➥ File manager
iii ➥ Logs
iv ➥ Transaction processing system
A. SELECT coursename, count(*) 'total' from STUDENT natural join COURSE group
by coursename;
B. SELECT C.coursename, count(*) 'total' from STUDENT S, COURSE C where
S.courseno=C.courseno group by coursename;
C. SELECT coursename, count(*) 'total' from COURSE C where courseno in
(SELECT courseno from STUDENT);
i ➥ A and B only
ii ➥ A only
iii ➥ B only
iv ➥ C only
Explanation:
Disjoint Constraint
• A disjoint constraint requires that Higher level entity set belong to only one lower-level entity set.
• For example, an account entity can be either a savings account or a current account , but cannot
be both. Here account is higher level entity and saving account , current account are lower level
entities.
Partial Participation
• It is not based on Generization/ Specialization.
• The entity in the entity set may or may not participate in the relationship.
• Suppose employee entity manages department entity. Here, manages is a relationship between
employee and department. Not every employee manage department only manager manages
department. So, participation of employee entity is partial.
Overlapping Constraints
• In overlapping Constraints, the same Higher level entity may belong to more than one lower-level
entity set.
• For example, person entity may belong to both customer entitity and employee entity.
i ➥ B/2
ii ➥ log2 B
iii ➥ B+R
iv ➥ B
i ➥ 63
ii ➥ 64
iii ➥ 67
iv ➥ 68
Ask,
Order of leaf node =?
Formula,
n*(Key size + Record Pointer) + Block Pointer <= Block size
Calculation,
=> n*(9+7) + 6 <= 1024 Byte
=> 16n <= 1018
=> n <= 1018/16
=> n <= 63.625
=> n = 63
So,Option(I) is correct.
More Discussion Explanation On YouTube Learn Topic Wise Help-Line
i ➥ A -I , B -III , C -IV , D – II
ii ➥ A -I , B -III , C -IV , D – II
iii ➥ A -I , B -III, C -II , D – IV
iv ➥ A -III , B -I , C -IV , D – II
Answer – IV
Explanation:
A. Degree of Table R: The number of Attributes/Column in a table is called Degree of Table.
Degree of Table R is 6.
C. Foreign key of relation STUDENT: Courseno is the primary key of relation COURSE and Courseno is the Foreign key of
relation STUDENT. Because Foreign key is an attribute which referred to primary key of another Table.
i ➥ A and C only
ii ➥ B and C only
iii ➥ B only
iv ➥ C only
Answer – I
Explanation:
Given,
Functional dependencies set F={x→y, z→w}
(xz)+ = xyzw
Therefore, xz is a Candidate key.
Concept,
First Normal Form: A relation is in first normal form if every field contains only atomic values.
Second Normal Form: In 2NF, part of the candidate key should not determined another
Attributes( No partial dependency allow).
i ➥ DDL
ii ➥ DML
iii ➥ HTML
iv ➥ XML
i ➥ (34, 31)
ii ➥ (50, 52)
iii ➥ (57, 53)
iv ➥ (60, 64)
Answer: III
Explaination:
Given,
Key size = 10 Byte,
Block size = 1024 Byte,
Record Pointer = 9 Byte,
Block Pointer = 8 Byte.
Asked,
Order of Internal node of B+ Tree = ?,
Order of Leaf/External node of B+ Tree = ?.
Formula,
For Internal node (B+ Tree)
n* Block Pointer + (n-1)*Key size <= Block size,
Where,
n= order of internal node,
m= order of leaf/external node.
Calculation,
For Internal node (B+ Tree)
=> n* Block Pointer + (n-1)*Key size <= Block size,
=> n* 8 + (n-1)*10 <= 1024,
=> 8n + 10n – 10 <= 1024,
=> 18n <= 1034,
=> n <= 57.4
=> n = 57
i ➥ UY, VY
ii ➥ UY, VY, XY
iii ➥ UYZ, VYZ, VWZ
iv ➥ UYZ, VYZ, XYZ
Answer – IV
Explanation:
On the basis of above given table structures, retrieve the distinct employee ID (EMPID) of all employees of
university who are working on project No. 20, 30 and 40.
i➥2
ii ➥ 4
i➥3
ii ➥ 4
iii ➥ 5
iv ➥ 6
i ➥ 30
ii ➥ 20
iii ➥ 50
iv ➥ 1500
i ➥ 5,3
ii ➥ 5,2
iii ➥ 7,5
iv ➥ 8,7
Comprehension:
Answer question (27-31) based on the problem statement given below:
An organization needs to maintain database having five attributes A, B, C, D, E. These attributes are
functionally dependent on each other for which functionally dependency set F is given as : F: {A→
BC, D → E, BC → D, A →D}. Consider a universal relation R(A, B, C, D, E) with functional dependency
set F. Also all attributes are simple and take atomic values only.
i ➥ F’ = {A → B, A → C, BC → D, D →E}
ii ➥ F’ = {A → BC, B → D, D → E}
iii ➥ F’ = {A → B, A → C, A → D, D → E}
iv ➥ F’ = {A → B, A → C, B → D, C → D,D → E}
i ➥ BC→D
ii ➥ D→E
iii ➥ A→D
i ➥ BC
ii ➥ AD
iii ➥ A
iv ➥ AB
i ➥ 1 NF
ii ➥ 2 NF
iii ➥ 3 NF
iv ➥ BCNF
i ➥ Unique key
ii ➥ Primary key
iii ➥ Candidate key
iv ➥ Check key
i ➥ R is in 4NF
ii ➥ R is not in 1NF
iii ➥ R is in 2Nf and not in 3NF
iv ➥ R is in 2NF and 3NF
i ➥ P only
ii ➥ Q only
iii ➥ Both P and Q
iv ➥ Neither P nor Q
i ➥ Complex data-types
ii ➥ Multivalued attributes
iii ➥ Association with multiplicities
iv ➥ Generalization relationship
On deleting the table (20,40), the set of other tuples that must be deleted to maintain the
referential integrity of table is
i ➥ (30,35) only
ii ➥ (30,35) and (35,20) only
iii ➥ (35,20) only
iv ➥ (40,45) and (25,40) only
i ➥ 1 only
ii ➥ Both 2 and 3
iii ➥ 2 only
iv ➥ 3 only
Primary keys in the tables are shown using Underline. Now, Consider the following query:
SELECT S.Name, Sum (P.Marks)
FROM Students S, Performance P
WHERE S.Roll-No = P.Roll-No
GROUP BY S.Name
The number of rows returned by the above query is
i➥3
ii ➥ 2
iii ➥ 0
iv ➥ 1
i ➥ 20 , 20
ii ➥ 3, 20
iii ➥ 3, 5
iv ➥ 20, 5
i ➥ We can apply redo and undo operation in arbitrary order because they are idempotent.
ii ➥ We must redo log record (vi) to set A to 16,500.
iii ➥ We must undo log record (vi) to set A to 16,500 and then redo log record (ii) and (iii).
iv ➥ We need not redo records (ii) and (iii) because transaction T1 has committed.
i ➥ Update table
ii ➥ Remove table
iii ➥ Delete table
iv ➥ Drop table
i ➥ Inner Join
ii ➥ Outer Join
iii ➥ Semi Join
iv ➥ Anti Join
i ➥ Collision
ii ➥ Root
iii ➥ Foreign Key
iv ➥ Records
i ➥ 1 NF
ii ➥ 2 NF
iii ➥ 3 NF
iv ➥ 4 NF
i ➥ Pk(r1 ) → Pk(r2 )
ii ➥ Pk(r2 ) → Pk(r1 )
iii ➥ Pk(r2 ) → Pk(r1 ) and Pk(r1 ) → Pk(r2 )
iv ➥ Pk(r2 ) → Pk(r1 ) or Pk(r1 ) → Pk(r2 )
i ➥ SELECT
ii ➥ CREATE
iii ➥ AVG
iv ➥ MODIFY
Code:
i ➥ Functional Dependencies
ii ➥ Data integrity
iii ➥ Referential integrity
iv ➥ Normal forms
i ➥ LOOK-UP
ii ➥ INSERT
iii ➥ MODIFY
iv ➥ CHANGE
i ➥ S1
ii ➥ S2
iii ➥ S3
iv ➥ S4