SQL Questions and Answers – SQL Syntax

This set of SQL Multiple Choice Questions & Answers (MCQs) focuses on “SQL Syntax”.

1. SQL keywords are case sensitive.
a) True
b) False
View Answer

Answer: b
Explanation: SQL keywords are NOT case sensitive.
“SELECT * FROM table_name;” is same as “select * from table_name;”. Both upper and lower case letters can be used in SQL.

2. Which character is used to separate SQL statements in database systems?
a) :
b) ;
c) _
d) %
View Answer

Answer: b
Explanation: A SQL statement begins with a SQL keyword and ends with a semicolon. Using semicolon is the standard way to separate each SQL statement in database systems.

3. Which of the following SQL command(s) retrieves information from a Database?
a) Update
b) Extract
c) Select
d) Retrieve
View Answer

Answer: c
Explanation: Update modifies the data which exists in a database. Select retrieves data from a database. Extract and Retrieve are not valid SQL commands.
advertisement
advertisement

4. Using which command one can delete existing data from database without deleting the table?
a) Drop
b) Delete
c) Remove
d) Collapse
View Answer

Answer: b
Explanation: Drop deletes a table. Delete command is used to delete data from a database without deleting the table. Remove and Collapse are not SQL commands.

5. Which SQL command is used to modify data in a Database?
a) Modify
b) Change
c) Save
d) Update
View Answer

Answer: d
Explanation: Update command updates data in a database. Modify, Change and Save are not valid SQL commands.

6. To insert new data into a database, which of the following SQL command is used?
a) Insert
b) Insert Into
c) Update
d) Add New
View Answer

Answer: b
Explanation: Insert Into is used to insert new data into a database. Update modifies the existing data in a Database, whereas the rest are not SQL statements.

7. Which command is used to eliminate a table from a database?
a) Drop
b) Delete
c) Remove
d) Eliminate
View Answer

Answer: a
Explanation: Drop deletes a table. Delete command deletes the contents of a table. Remove and Eliminate are not valid SQL commands.
advertisement

8. Which of the following is used to modify an existing table?
a) Alter
b) Alter Table
c) Modify
d) Update
View Answer

Answer: b
Explanation: Alter Table is used to modify an existing table. Update modifies data of a table. Modify and Alter is not SQL commands.

9. To create a new table, which of the following command is used?
a) Create
b) Create New
c) Create Table
d) Create New Table
View Answer

Answer: c
Explanation: Create Table creates a new table in the database, whereas the rest are not SQL commands.
advertisement

10. Which of the following is a valid SQL command for an Index?
a) Create Index
b) Change Index
c) Add Index
d) Remove Index
View Answer

Answer: a
Explanation: Create Index is used to create a relational Index on a database table, whereas the rest are not valid SQL commands.

Sanfoundry Global Education & Learning Series – SQL.

To practice all areas of SQL, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.