Dbms All 8 Assignments
Dbms All 8 Assignments
Q1. Ans:
d)S1 is a Data Definition (DDL) Query and S2 is a Data Manipulation Query
Q2. Ans:
b) IIattribute_name(relation_name1)∊IIattribute_name(relation_name2)
Q3.
Ans: c) student_id, course_id
Q4.
Ans: c) r ⋈ s (r natural join s)
Q5.
Ans: c) FULL OUTER JOIN
Q6.
Ans: c) R1 – (R1 – R2)
Q7.
Ans: b) A Candidate Key for which no proper subset is also a Candidate
Key is called as Super Key.
Q8.
Ans: b) department_id
Q9.
Ans: b) sap
Q10.
Ans: b) {12, Jessica} is an instance of a relation schema
DBS ASSIGNMENT NO 02
Q1.
Ans: b) employee_id department
c) manager department
Q2.
Ans: d) SELECT pname FROM emp_project WHERE dnum = 4;
Q3.
Ans: c) INSERT INTO customer VALUES (‘Stacey’,’Loan’,10)
Q4.
Ans: b) SELECT branch_name FROM loan
GROUP BY branch_name
HAVING AVG (amount) < 126678
Q5.
Ans: d) ALTER TABLE student
MODIFY fees DEFAULT 1000;
Q6.
Ans: c) 7
Q7.
Ans: b) course NATURAL RIGHT OUTER JOIN prereq
Q8.
Ans: a) Agacy
Q9.
Ans: c) Sahana can grant create index privilege to other users
Q10.
Ans: a) Prints the name of the employees who have salary greater than
atleast one employee of department 5
DBS ASSIGNMENT NO 03
Q1.
Ans: b) LAPTOP
Q2.
Ans: a) {<d> | Ǝs(< d,s > € EMPLOYEE ∧ s >50000)}
Q3.
Ans: d) {t|Ǝd € DOCTORS(t [DOCTORNAME] =d[DOCTORNAME] ∧
Ǝh € HOSPITAL (h[HOSPITALID] =d[HOSPITALID] ^ h[NAME] =
Peerless'))}
Q4.
Q5.
Ans: a) IIRANK(Marks > 80 ∧ SCHOOL = ‘ ABS INTERNATIONAL’(
STUDENTS ))
Q6.
Ans: c) EXEC SQL
DECLARE C CURSOR FOR
SELECT NAME
FROM PRODUCT
WHERE SALE_COUNT> accounted_sale AND MONTH= :target_month
END EXEC
Q7.
Ans: b) A LOAN can be borrowed by N CUSTOMERS and a CUSTOMER can
borrow atmost 1 LOAN.
Q8.
Ans: a) DOGS inherit the attributes of CARNIVORES.
b) DOGS inherit the attributes of ANIMALS.
Q9.
Ans: d) EXEC SQL BEGIN DECLARE SECTION;
int PRODUCTID:
char PRODUCTNAME [50]; EXEC
SQL END DECLARE SECTION;
Q10.
Ans: a)
DBS ASSIGNMENT NO 04
Q1.
Ans: b) (B, D, E) → B
d) {A, B, C} {E, F}
Q2.
Ans: c) X → Y , X → Z
Q3.
Ans: b) Reg No, Class.ID, [Address Phone)
Q4.
Ans: b) Pug
Q5.
Ans: a) FD2 and FD3
c) FD5
Q6.
Ans: a) 1 NF
Q7.
Ans: b) R₁(A, B, C), R₂(A, E, D), R3(A, E, F, G)
Q8.
Ans: d) Both 1 and 2 are lossy
Q9.
Ans: a) { P , Q, R ,S }
Q10.
Ans: b) 2NF
DBS ASSIGNMENT NO 05
Q1.
Ans: b) Approx. 44 milliseconds
Q2.
Ans: b) Level 1
Q3.
Ans: b) CGI (Common Gateway Interface)
Q4.
Ans: d) 99.02%
Q5.
Ans: a) URI (Uniform Resource Identifier)
Q6.
Ans: b) Doctor
Q7.
Ans: a) Test_date, Doc_Id and Pat_Id Q8.
Ans: b) It is used to record the history of operations performed on a file
Q9.
Ans: d)
Expected op:
Q10.
Ans: c) 8
ASSIGNMENT 6
If we see the precedence graph there is a loop/cycle. Hence this schedule cant
be conflict serializable since this is not conflict serializable this schedule is view
serializable.
2.
3.
4.
Explanation :
If we observe the graph T3 should be executed first but without executing T4
T3 won’t be executed therefore T4 will executed first after T4 , T3 will be
executed followed by T2 and T1.
5.
6.
7.
ANS : (c) 3
There can be 3 conflict serializable schedules
T3 T1 T2
T1 T3 T2
T1 T2 T3
8.
ANS : (b)
Explanation :
Since B is not given it may be inconsistent sometimes.
9.
10.
ANS : (a)Partially Committed State Explanation
:
Partially Committed state is When a transaction executes its final operation, it is
said to be in a partially committed state.
ASSIGNMENT 8
1.
2.
ANS : (a) 1465 block transfer is required
3.
ANS : (d) After recovery completion the value of B will be 400 and value of
A will be 1500 and the value of C will be 1000
5.
ANS : (b) The queries are equivalent as projection is moved down past the
equijoins and new projection operations are created as required.
8.
ANS :
9.
ANS : (a)
10.