SQL MCQ's Question Set 2
Q.1. Which is not DDL (data definition language) operation
- Renaming a table
- SQL create table
- Add a column to an existing table
- Update data into a table in SQL database
Answer:- (4)
Q.2. Which statement is correct? A table can have
- many primary key and many unique key
- one primary key and one unique key
- one primary key and many unique key
- many primary key and one unique key
Answer:- (3)
Q.3. Which SQL commands can be used to delete all records from the table in a sql database?
- Delete
- Delete with where condition
- TRUNCATE
- DROP
Answer:- (1) and (3)
Q.4. SQL Command to remove stored procedure SQL
- Remove
- Drop
- Delete
- Erase
Answer:- (2)
Q.5. Which SQL sub language is used for creating and destroying table structure?
- DDL
- DML
- TCL
- DCL
Answer:- (2)
Q.6. Which SQL function is used to count the number of rows in a SQL query?
- COUNT()
- NUMBER()
- SUM()
- COUNT(*)
Answer:- (4)
Q.7. What is the purpose of the SQL AS clause?
- a) The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column
- b) The AS clause is used with the JOIN clause only
- c) The AS clause defines a search condition
- d) All of the mentioned
Answer:- (1)
Q.8. The UNION SQL clause can be used with _____________
- a) SELECT clause only
- b) DELETE and UPDATE clauses
- c) UPDATE clause only
- d) All of the mentioned
Answer:- (1)
Q.9. How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
- a) UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
- b) MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
- c) MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
- d) UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
Answer:- (4)
Q.10. What is the meaning of LIKE ‘%0%0%’?
- a) Feature begins with two 0’s
- b) Feature ends with two 0’s
- c) Feature has more than two 0’s
- d) Feature has two 0’s in it, at any position
Answer:- (4)
Q.11. Which of the following statements is true concerning subqueries?
- a) Involves the use of an inner and outer query
- b) Cannot return the same result as a query that is not a subquery
- c) Does not start with the word SELECT
- d) All of the mentioned
Answer:- (1)
Q.12. Which of the following statement is true?
- a) Views could be looked as an additional layer on the table which enables us to protect intricate or sensitive data based upon our needs
- b) Views are virtual tables that are compiled at run time
- c) Creating views can improve query response time
- d) All of the Mentioned
Answer:- (4)
Q.13. The phrase “greater than at least one” is represented in SQL by ___________
- a) < all
- b) < some
- c) > all
- d) > some
Answer:- (4)
Q.14. Aggregate functions are functions that take a ___________ as input and return a single value.
- a) Collection of values
- b) Single value
- c) Double value
- d) All of the mentioned
Answer:- (1)
Q.15. The ________ keyword is used to access attributes of preceding tables or subqueries in the from clause.
- a) In
- b) Lateral
- c) Having
- d) With
Answer:- (2)
For more Technical MCQ's and Interview Questions Click here