SQL Query SQL Quires Exam Questions MCQ's Multiple Choice Question Sample Paper
i. Which of the following statement contains an error?
- Select * from EMP where EMPID=493945;
- Select EMPID from EMP where EMPID=493945;
- Select EMPID from EMP;
- Select EMPID where EMPID=493945 and LASTNAME=
ii. You issue the following statement. What will be displayed if the EMPID selected is 60494?
iii. Select DECODE (empid, 38475,’TERMINATED’, 60494,’LOA’,’ACTIVE’)
iv. Which of the following uses of the having clause are appropriate?
- To put returned data into sorted order
- To exclude certain data groups based on known criteria
- To include certain data groups based on unknown criteria
- To include certain data groups based on known criteria.
v. A Cartesian product is
- A group function
- Produced as a result of a join select statement with no where clause
- The result of fuzzy logic
- A special feature of Oracle server
vi. After referencing NEXTVAL, the value in CURRVAL
- Is incremented by one
- Is now in PREVVAL
- Is equal to NEXTVAL
- Is unchanged
vii. Which of the statement is not true about roles?
- Roles can be granted to other roles.
- Privileges can be granted to roles.
- Roles can be granted to users.
- Roles can be granted to synonyms.
2. Identify some of the character, number, and date functions available in SQL. Can two functions be combined provide some examples?
3. What is the purpose of the nvl( ) function? What data types does it accept? What is the purpose of a decode ( ) statement? What data types does it accept?
4. How is the group by clause of a select statement used? Identify some situations where statements containing the group by clause return errors?
5. What is a simple view? How does it differ from a complex view? Which view allows the user to insert data into the view’s underlying table? Explain with examples.
6. How can you grant and revoke system privileges to users.
7. User Jones has select privileges on YOU.emp granted to her with the with grant option. You then issue revoke select on EMP from JONES. Can JONES still administer the privilege? Why or why not?
8. What is a self join? How might a self join be used? How many equality operations should be used to create a self join?