Oracle Sql Basics(Engineering > Computer Science And Engineering > Oracle Database ) Questions and Answers
Question 1. In an SQL statement, which of the following parts states the conditions for row selection?
Where
From
Order By
Group By
Explanation:-
Answer: Option A. -> Where
In an SQL statement where clause states the conditions for row selection.
Question 2. Which of the following keyword is used with Data Control Language (DCL) statements?
SELECT
INSERT
DELETE
GRANT
Explanation:-
Answer: Option D. -> GRANT
GRANT is the keyword which is used with Data Control Language statements.
Question 3. A type of query that is placed within a WHERE or HAVING clause of another query is called
Master query
Sub query
Super query
Multi-query
Explanation:-
Answer: Option B. -> Sub query
Sub-query that is placed within a WHERE or HAVING clause of another query.
Question 4. In SQL, which of the following is not a data definition language commands?
RENAME
REVOKE
GRANT
UPDATE
Explanation:-
Answer: Option A. -> RENAME
With RENAME statement you can rename a table.RENAME, REVOKE and GRANT are DDL commands and UPDATE is DML command.
Question 5. SQL has how many main commands for DDL:
1
2
3
4
Explanation:-
Answer: Option C. -> 3
Create, Delete, Alter these are 3 main command.
Question 6. Stack is also called __________
First In First Out (FIFO)
Last In First Out (LIFO)
First In Last Out (FILO)
First Come First Served (FCFS)
Explanation:-
Answer: Option C. -> First In Last Out (FILO)
Stack works on the First In Last Out.
Question 7. The SQL statement SELECT SUBSTR('123456789', INSTR('abcabcabc', 'b'), 4) FROM DUAL;
6789
2345
1234
456789
Explanation:-
Answer: Option B. -> 2345
INSTR function in SQL is used to find the starting location of a pattern in a string. The syntax for the INSTR function is as follows:INSTR(str,pattern):Find the starting location of pattern in string str and SUBSTR Function:- The Substring function in SQL is used to grab a portion of the stored data.
Question 8. A command that lets you change one or more fields in a record is
Insert
Modify
Look-up
All of the Mentioned
Explanation:-
Answer: Option B. -> Modify
Sometimes we need to change the data type of a column. To do this, we use the ALTER TABLE Modify Column ALTER TABLE table_name, MODIFY column_name "New Data Type.
Question 9. Which of the following is illegal?
SELECT SYSDATE "“ SYSDATE FROM DUAL;
SELECT SYSDATE "“ (SYSDATE "“ 2) FROM DUAL;
SELECT SYSDATE "“ (SYSDATE + 2) FROM DUAL;
None of the Mentioned
Explanation:-
Answer: Option D. -> None of the Mentioned
SELECT SYSDATE “ SYSDATE FROM DUAL; outputs 0 SELECT SYSDATE “ (SYSDATE “ 2) FROM DUAL; outputs 2 SELECT SYSDATE “ (SYSDATE + 2) FROM DUAL; outputs -2.
Question 10. ________clause is an additional filter that is applied to the result.
Select
Group-by
Having
Order by
Explanation:-
Answer: Option C. -> Having
The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.