Structured Query Language is a Computer Language which is designed for Databases in order to retrieve and manage data in the relational database. It can perform the operations like storing, manipulating and retrieving data which is stored in a relational database with great ease.
Question 1: Select the invalid SQL Type.
A) DECIMAL
B) CHARACTER
C) NUMERIC
D) None of these
Answer: DECIMAL
Explanation: CHARACTER can store upto 8000 characters and is a fixed width character data type.
Question 2: Select the command which is not a DDL command.
A) CREATE
B) ALTER
C) DROP
D) None of these
Answer: None of these
Explanation: DDL commands are used for defining structure of the database, table etc. Following are
Question 3: Select the valid Transaction Control Commands.
A) GRANT
B) REVOKE
C) Both of these
D) None of these
Answer: None of these
Explanation: GRANT and REVOKE are DCL(Data Control Language) Commands and are used for controlling the database. A user can only access if he has rights or permission to access the data.
Question 4: Which of the following is not a valid view?
A) Simple View
B) Complex View
C) Dynamic Management View
D) All of these
Answer: All of these
Explanation: Following are the valid SQL Views
Question 5: Which datatype is used for storing unstructured data in a column?
A) VARCHAR
B) NUMERIC
C) CHAR
D) None of these
Answer: RAW
Explanation: RAW is the datatype which is used for storing unstructured data in a column.
Question 6: What would be returned by the following code:
INSTR(‘TutorEye’, ‘E’)
A) 5
B) 6
C) ‘Ye’
D) None of these
Answer: 6
Explanation: It would return the numeric value of the specified character’s first occurrence
Question 7: Which transactional command permanently updates the database?
A) TRUNCATE
B) ROLLBACK
C) COMMIT
D) None of these
Answer: COMMIT
Explanation: TRUNCATE is not a transactional command.
Question 8: Some rows which do not have matching values can be returned in which join?
A) LEFT Join
B) RIGHT Join
C) EQUI Join
D) None of these
Answer: None of these
Explanation: LEFT Join: It returns the unmatched values only from the left table.
Question 9: Select the correct order for the following SQL statements:
A) SELECT, WHERE, GROUP BY, HAVING
B) SELECT, WHERE, HAVING, GROUP BY
C) SELECT, HAVING, WHERE, GROUP BY
D) None of these
Answer: SELECT, WHERE, GROUP BY, HAVING
Explanation: In SQL,
Question 10: Which of the following can be used to get all the names starting with ‘t’?
A) LIKE “%t%”
B) LIKE “%t_”
C) LIKE “t_”
D) None of these
Answer: None of these
Explanation: % means zero or more characters.
_ means one character.
So the correct answer should be: LIKE “t%”, t followed by any number of characters.