Questions Set - 2
Questions Set - 2
2.
How many rows will be fetched when the above query is executed?
a) 6
b) 3
c) 5
d) 7
SELECT * FROM emp e INNER JOIN dept d ON e.deptno = d.deptno WHERE hiredate between
'04/01/1981' AND '04/01/1982' AND LENGTH(JOB)<8;
How many employees’ data will be displayed in output on execution of above query?
a) 2
b) 6
c) 8
d) 9
4. . Find the SQL statements below that is equal to the following for the types of product may be –
Goods, Services, Experiences, Convenience, Shopping, Specialty Goods, Industrial Goods and
Consumer Goods.
SELECT city FROM salesman WHERE product = 'Services' OR product = 'Specialty Goods';
Q1. SELECT city FROM salesman WHERE product IN ('Services', 'Specialty Goods');
Q2. SELECT city FROM salesman WHERE product LIKE 'S%s';
Q3. SELECT city FROM salesman WHERE product LIKE 'S%' AND product LIKE '%s';
Q4. SELECT city FROM salesman WHERE product LIKE 'S%' OR product LIKE '%s';
a) Q1 only
b) Q1 and Q2
c) Q1, Q2 and Q3
d) All
5. Find out the candidate key(s) and the highest normal form in the given relation:
trainee (traineeid, traineename, classroomid, pcid)
a) traineeid, 2NF
b) {classroomid, pcid}, 3 NF
c) traineeid, {classroomid, pcid}, 2NF
d) traineeid, {classroomid, pcid}, 3NF
6.
a) 2
b) 1
c) 3
d) 4
Which employee name will be present at the third location from top after execution of above query?
a) KING
b) CLARK
c) MILLER
d) SMITH
a) 3
b) 4
c) 5
d) 6
9.
Which is the best primary key for the sales table from following?
a- Desc
b- Store_id
c- {productid,store_id}
d- Productid
10. Table employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE.
The SQL statement
SELECT COUNT(*) FROM employee WHERE SALARY > ALL (SELECT SALARY FROM EMPLOYEE);
prints
A. 10
B. 9
C. 5
D. 0
A B C D
A1 B1 C1 D1
A1 B2 C2 D2
A2 B3 C2 D3
A2
B3
C4
D0
Qn 12: Consider the following relational schema along with functional dependencies:
ProductDetails (ProdId, ProdName, Color, Cost, CategoryId, CategoryName)
ProdId -> ProdName;
{ProdId, Color} -> Cost;
ProdId -> CategoryId;
CategoryId -> CategoryName
What would be the total number of relational schema/s after converting to 3NF?
A1
B2
C3
D4
Qn 13:
Qn 14: Find the suitable option to identify number of candidate keys can be form in the given below
Table.
T
A B C D
a b c d
1 1 1 1
a b c d
2 2 2 1
a b c d
3 3 3 2
a b c d
4 3 3 3
a b c d
5 1 4 4
a) 1
b) 3
c) 4
d) 2