0% found this document useful (0 votes)
41 views2 pages

DBS Lab Quiz-1 Fall 22

The document contains a 15 question quiz on database systems topics. The questions cover SQL statements like SELECT, WHERE, ORDER BY, JOIN, aggregation functions like COUNT and more. It tests concepts like data types, string functions, precedence of operators and clauses in a SQL statement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views2 pages

DBS Lab Quiz-1 Fall 22

The document contains a 15 question quiz on database systems topics. The questions cover SQL statements like SELECT, WHERE, ORDER BY, JOIN, aggregation functions like COUNT and more. It tests concepts like data types, string functions, precedence of operators and clauses in a SQL statement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Database Systems – (BS-CS (M) – Fall 20) – Semester Fall 22

Time Allowed: 15 Mins. Quiz#1 Total Marks: 15

Roll No. ________________________ Name _____________________________

1. What will happen to the result, if parenthesis are removed IN the following SELECT statement?
SELECT (200+((sal*0.1)/2)) FROM emp;

A) No difference, because the answer will always be NULL.


B) No difference, because the answer will be the same.
C) The result will be higher.
D) The result will be lower.
2. SELECT empno, DISTICT ename, sal FROM emo;
A) empno, unique values of ename, and then sal are displayed.
B) Empno and unique values of the two columns, ename sal are displayed.
C) DISTINCT is not a valid key word of SQL.
D) The statement will return an error.
3. SELECT ename, NVL(sal,0) N1, NVL2(sal,sal,0) N2 FROM emp;
A) Column N1 will show correct values, and column N2 will show zero for all rows.
B) Column N2 will show correct values, and column N1 will show zero for all rows.
C) Columns N1 and N2 will have different results.
D) Columns N1 and N2 will have same results.
4. Which clause of SELECT statement limits the rows selected?
A) ORDER BY C) WHERE
B) FROM D) SELECT
5. Which of the following is a correct order of clauses of SELECT statement?
A) ORDER BY, WHERE, FROM
B) FROM, WHERE, ORDER BY
C) WHERE, FROM, ORDER BY
D) FROM, ORDER BY, WHERE
6. Which of the following statement should be used to search pname that begins with DI_?
A) WHERE dname = 'DI%'
B) WHERE dname LIKE 'DI%'
C) WHERE dname LIKE 'DI\_%' ESCAPE '\'
D) WHERE dname LIKE 'DI\_' ESCAPE '\'
7. Column alias names cannot be used in which clause?
A) ORDER BY C) WHERE
B) FROM D) SELECT
8. Which of the following function is used to return a specific portion of a string?
A) INSTR C) REPLACE
B) SUBSTR D) LPAD
9. What will be returned by SIGN(ABS(NVL(-32,0)))?
A) 0 C) -1
B) 32 D) 1

10. Which of the following statement would change all occurrences of the string 'OPR' to 'RES' in the
loc column of DEPT table?
A) SEELCT TRANSLATE (loc, 'OPR', 'RES') FROM dept;
B) SEELCT CONVERT (loc, 'OPR', 'RES') FROM dept;
C) SEELCT EXTRACT (loc, 'OPR', 'RES') FROM dept;
D) SEELCT REPLACE (loc, 'OPR', 'RES') FROM dept;
11. Which of the following is not a type of SQL statement?
A) Data Definition Language (DDL)
B) Data Control Language (DCL)
C) Data Communication Language (DCL)
D) Data Manipulation Language (DML)
12. What is the output of SUBSTR(‘123456789’, INSTR(‘abcabcabc’, ‘b’), 4)?
A) 2345 C) 456789
B) 6789 D) 1234
13. What is the correct order of precedence?
A) Comparison Operator > NOT > AND > OR
B) Comparison Operator > OR > AND > NOT
C) Comparison Operator > AND > OR > NOT
D) NOT>AND>OR > Comparison Operator
14. What is the default order of Order By clause?
A) Ascending
B) Descending
C) None
D) Both A and B
15. What is the use of ‘||’ in SQL?
A) OR Operator
B) AND Operator
C) For Alias
D) For Concatenation
16. The COUNT function in SQL returns the number of ______________
A) Values
B) Distinct values
C) Group By
D) Columns
17.

Q2) Write the queries for the given questions

1) Display All employees info. whose salaries are greater than 500 and job is manager

2)

You might also like