You are on page 1of 4

Subject: DSE2252 – DataBase Systems - Quiz – 2

Class: 4th SEM DSE Max. Marks: 10


Date: 06-05-2022 Time: 30 min

Q Which set of statements are true with respect following I II, III, IV statements are true?
. I. =SOME and IN operator are equivalent in Oracle SQL
1 II. =SOME and = ALL operator is equivalent in Oracle SQL
III. ≠ SOME and NOT IN operator are not equivalent in Oracle SQL
IV. ≠ SOME and ≠ ALL operator is equivalent in Oracle SQL
a. I & III TRUE b. II & III TRUE
c. III & IV TRUE d. II & IV TRUE
I & III TRUE
Q Consider tables Customer (CustId, CustName, Phone); Bill (Custid, Purchase_Date, Bill_Amount). Which of the following
. SQL statement satisfy the query- How many customers have paid Bills on each day during Jan month 2022?
2
a. SELECT PURCHASE_DATE , COUNT(CUSTID) WHERE b. SELECT PURCHASE_DATE , SUM(BILL_AMOUNT) WHERE
PURCHASE_DATE FROM BILL WHERE PURCHASE_DATE PURCHASE_DATE FROM BILL WHERE PURCHASE_DATE >=‘01-01-2022’
>=‘1-JAN-2022’ AND PURCHASE_DATE<=‘31-JAN- AND PURCHASE_DATE<=‘31-01-2022’GROUP BY PURCHASE_DATE;
2022’GROUP BY PURCHASE_DATE;
c. SELECT PURCHASE_DATE , COUNT(CUSTID) WHERE d. SELECT PURCHASE_DATE , SUM(BILL_AMOUNT) WHERE
PURCHASE_DATE FROM BILL WHERE PURCHASE_DATE PURCHASE_DATE FROM BILL WHERE PURCHASE_DATE >=‘01-01-2022’
>=‘1-JAN-2022’ AND PURCHASE_DATE<=‘31-JAN-2022’; AND PURCHASE_DATE<=‘31-01-2022’GROUP BY BILL_AMOUNT;
SELECT PURCHASE_DATE , COUNT(CUSTID) WHERE PURCHASE_DATE FROM BILL WHERE
PURCHASE_DATE >=‘1-JAN-2022’ AND PURCHASE_DATE<=‘31-JAN-2022’GROUP BY PURCHASE_DATE;

Q Consider the tables EMP (Empno, Ename, Salary, Deptno) & DEPT (Deptno, Dname, Budget). Assume that a view
. DEPT_View1(Dname, Sum(sal), Budget) is crated. Select the set of statements which give error.
3 I. INSERT INTO EMP VALUES (100,’Raj’,1234,’D1’);
II. INSERT INTO DEPT_View1 VALUES (‘D1’,35454,56783);
III. INSERT INTO DEPT VALUES(‘D2’,’ACCOUNTS’,67868);
IV. UPDATE DEPT_View1 SET Budget=78996 WHERE Deptno=’D1’;
a. I & II b. II & III
c. II & IV d. I & IV
II & IV
Q ____________ cursor attribute can be used to check records to be fetched exits or exhausted.
.
4
a. %NOTEOF b. %EOF
c. % EOL d. %NOTFOUND
%NOTFOUND
Q Which of the following is the true with respect to advantages of Cursor for loop?
. Assume the table STUD (RegnO, Name, Marks, Mark2, Avg_marks) , name of the cursor My_Cur & Cursor row variable
5 My_Cur_row.
I. Cursor must be opened using OPEN statement explicitly- OPEN(My_Cur)
II. Records must be retrieved using explicit FETCH statement.
III. Cursor is closed automatically
IV. An EXIT WHEN statement must be used to exit after retrieving all records.
a. I & II are TRUE b. I TRUE but II FALSE
c. III TRUE but IV FALSE d. I & IV TRUE
III TRUE but IV FALSE
Q Consider tables Customer (CustId, CustName, Phone); Bill (Custid, Purchase_Date, Bill_Amount). Which of the following
. SQL statement satisfy the query- Find name of customer, phone of customers who has paid bill amount more than
6 20000.
a. Select custname, phone from customer C, bill B b. Select custname, phone from customer C, bill B where
where c. custid=b. custid and bill_amount>20000; bill_amount>20000;
c. Select custname, phone from customer C, bill B d. Select custname, phone from customer C, bill B where
where c. custid=b. custid Group By bill_amount>20000;
bill_amount>20000;
Select custname, phone from customer C, bill B where c. custid=b. custid and bill_amount>20000;
Q _________ is the name of implicit cursor
.
7
a. SCHEMA b. Table_Name
c. SQL d. PL_SQL
SQL
Q Consider a relationship set R involving E1, E2,…Ep,…En entity sets and descriptive attribute A. The primary key of R can
. be formed as ___________.
8
a. Primary Key(E1) ∪ Primary Key(E2) ∪….. ∪ b. Primary Key(E1) ∪ Primary Key(E2) ∪….. ∪ Primary Key (Ep)
Primary Key (Ep) ∪….. ∪ Primary Key (En)
c. Primary Key(E1) ∪ Primary Key (En) d. Primary Key(E1) ∪ Primary Key(E2) ∪….. ∪ Primary Key (Ep)
∪….. ∪ Primary Key (En)U A
Primary Key(E1) ∪ Primary Key(E2) ∪….. ∪ Primary Key (Ep) ∪….. ∪ Primary Key (En) U A
Q The given ER Diagram will lead to how many relation schemas?
.
9

4
Q The more appropriate mapping cardinality of the relationship set existing between two entity sets ATM and
. TRANSACTIONS will be _________________
1
0
One to Many
Q Which of the following kind of value may be member of every domain?
.
1
1
a. Single Value b. Unique Value
c. NULL Value d. Simple Value
c. NULL Value
Q Which of the Following is the correct Cursor declaration to retrieve Stud_name and Avg_marks in descending order of
. Avg_marks.
1 Assume the table STUD (RegnO, Name, Marks, Mark2, Avg_marks)
2
a. CREATE CURSOR IS SELECT Name, Avg_marks FROM b. CURSOR IS SELECT Name, Avg_marks FROM Stud ORDER BY
Stud ORDER BY Avg_marks DESC; Avg_marks DESC;
c. DECLARE CURSOR IS SELECT Name, Avg_marks d. CURSOR AS FETCH Name, Avg_marks FROM Stud ORDER BY
FROM Stud ORDER BY Avg_marks DESC; Avg_marks DESC;
CURSOR IS SELECT Name, Avg_marks FROM Stud ORDER BY Avg_marks DESC;
Q ____________ will be the output of SELECT RPAD(‘HAPPY FRIDAY’,20,’$’) FROM DUAL;
.
1
3
a. HAPPY FRIDAY$$$$$$$$ b. HAPPY FRIDAY$$$$$$$
c. HAPPY FRIDAY$$$$$$ d. HAPPY FRIDAY$$$$$$$$$
HAPPY FRIDAY$$$$$$$$
Q ________ will be the output of SELECT ROUND(1534.67,-3) FROM DUAL;
.
1
4
1000

Q Consider tables Customer (CustId, CustName, Phone); Bill (Custid, Purchase_Date, Bill_Amount). Which of the following
. SQL statement satisfy the query- Find Total amount, name of customer who has paid Total amount more than 10000
1 during 1st half year 2022.
5
b. SELECT CUSTNAME, SUM(BILL_AMOUNT) FROM CUSTOMER C, BILL B
a. SELECT CUSTNAME, SUM(BILL_AMOUNT) FROM WHERE C. CUSTID = B. CUSTID AND (PURCHASE_DATE>=‘1-JAN-2022’
CUSTOMER C, BILL B WHERE C. CUSTID = B. CUSTID AND AND PURCHASE_DATE<=‘30-JUN-2022’) GROUP BY B.CUSTID HAVING
(PURCHASE_DATE>=‘1-JAN-2022’ AND SUM(BILL_AMOUNT)>10000;
PURCHASE_DATE<=‘30-JUN-2022’) GROUP BY * group by custid
CUSTNAME HAVING SUM(BILL_AMOUNT)>10000;
c. SELECT CUSTNAME, SUM(BILL_AMOUNT) FROM d. SELECT CUSTNAME, SUM(BILL_AMOUNT) FROM CUSTOMER C, BILL B
CUSTOMER C, BILL B WHERE AND (PURCHASE_DATE>=‘1- WHERE AND (PURCHASE_DATE>=‘1-JAN-2022’ AND
JAN-2022’ AND PURCHASE_DATE<=‘30-JUN-2022’) PURCHASE_DATE<=‘30-JUN-2022’) AND SUM(BILL_AMOUNT)>10000
GROUP BY CUSTNAME HAVING GROUP BY CUSTNAME;
SUM(BILL_AMOUNT)>10000; *(no join) *AND SUM(BILL_AMOUNT)>10000
SELECT CUSTNAME, SUM(BILL_AMOUNT) FROM CUSTOMER C, BILL B WHERE C. CUSTID = B. CUSTID
AND (PURCHASE_DATE>= ‘1-JAN-2022’ AND PURCHASE_DATE<= ‘30-JUN-2022’) GROUP BY CUSTNAME
HAVING SUM(BILL_AMOUNT)>10000;

Q What is the statement we can use to know how many records are retrieved so far from a cursor My_Cur.
.
1
6
a. My_Cur%RECCOUNT b. My_Cur%ROWNUM
c. My_Cur%ROWCOUNT d. My_Cur%TUPLES
My_Cur%ROWCOUNT
Q ____________ will be the output of SELECT NEXT_DAY ('06-May-22', 'Wednesday') FROM DUAL;
.
1
7
11-May-2022
Q In the entity set Player, the entity captain leads the other players. So the kind of association between captain and other
. players can be defined as____________ relationship set.
1
8
Recursive
Q What will be the output of the following code snippet?
.
1
9

a. 3 4 5 6 7 b. 3 4 5 6
c. Error d. 4 5 6 7
34567
Q An appropriate relation schema for the given entity set would be:
.
2
0
a. b.
Doctor(DoctorId,DocFname,DocMidInit,DocLname Doctor(DoctorId,DocName,DocFname,DocMidInit,DocLname,Dat
,Date_of_Birth,Dept,Date_of_Join) e_of_Birth,Dept,Date_of_Join, Year_of_Exp)
c. d.
Doctor(DoctorId,DocFname,DocMidInit,DocLname, Doctor(DoctorId,DocFname,DocMidInit,DocLname,Date_of_Birth,
Date_of_Birth,Specialization,Dept,Date_of_Join) Specialization,Qualification,Dept,Date_of_Join,Year_of_Exp)
Doctor(DoctorId,DocFname,DocMidInit,DocLname,Date_of_Birth,Dept,Date_of_Join)

You might also like