You are on page 1of 7

1/30/24, 1:21 PM SQL Basics Questions and Answers - Sanfoundry

SQL Server Questions and Answers – Basic SQL –


1
This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Basic SQL – 1”.

1. Which SQL function is used to count the number of rows in a SQL query?
a) COUNT()
b) NUMBER()
c) SUM()
d) COUNT(*)
View Answer

Answer: d
Explanation: COUNT(*) takes null value row in to consideration.

2. Which SQL keyword is used to retrieve a maximum value?


a) MOST
b) TOP
c) MAX
d) UPPER
View Answer

Answer: c
Explanation: The MAX() function returns the largest value of the selected column.

3. Which of the following SQL clauses is used to DELETE tuples from a database table?
a) DELETE
b) REMOVE
c) DROP
d) CLEAR
View Answer

Answer: a
Explanation: The SQL DELETE Query is used to delete the existing records from a table.
Driving mobility
READ MORE
sponsored by: Mitsubishi Electric
advertisement
https://www.sanfoundry.com/sqlserver-mcqs-basic-sql-1/ 1/7
1/30/24, 1:21 PM SQL Basics Questions and Answers - Sanfoundry

4. ___________removes all rows from a table without logging the individual row deletions.
a) DELETE
b) REMOVE
c) DROP
d) TRUNCATE
View Answer

Answer: d
Explanation: TRUNCATE statement is a Data Definition Language (DDL) operation that marks the
extents of a table for deallocation.

5. Which of the following is not a DDL command?


a) UPDATE
b) TRUNCATE
c) ALTER
d) None of the Mentioned
View Answer

Answer: a
Explanation: Data definition language (DDL) commands enable you to perform the following
tasks:Create, alter, and drop schema objects.

Subscribe Now: SQL Server Newsletter | Important Subjects Newsletters

6. Which of the following are TCL commands?


a) UPDATE and TRUNCATE
b) SELECT and INSERT
https://www.sanfoundry.com/sqlserver-mcqs-basic-sql-1/ 2/7
1/30/24, 1:21 PM SQL Basics Questions and Answers - Sanfoundry

c) GRANT and REVOKE


d) ROLLBACK and SAVEPOINT
View Answer

Answer: d
Explanation: Transaction control commands manage changes made by DML commands. These
SQL commands are used for managing changes affecting the data.

7. ________________ is not a category of SQL command.


a) TCL
b) SCL
c) DCL
d) DDL
View Answer

Answer: b
Explanation: SQL commands can be used not only for searching the database but also to perform
various other functions.They are DDL,DML,TCL and DCL.

advertisement

8. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default
______________
a) ASC
b) DESC
c) There is no default value
d) None of the mentioned
View Answer

https://www.sanfoundry.com/sqlserver-mcqs-basic-sql-1/ 3/7
1/30/24, 1:21 PM SQL Basics Questions and Answers - Sanfoundry

Answer: a
Explanation: ASC is the default sort order. Null values are treated as the lowest possible values.

9. Which of the following statement is true?


a) DELETE does not free the space containing the table and TRUNCATE free the space containing the
table
b) Both DELETE and TRUNCATE free the space containing the table
c) Both DELETE and TRUNCATE does not free the space containing the table
d) DELETE free the space containing the table and TRUNCATE does not free the space containing the
table
View Answer

Answer: a
Explanation: The SQL TRUNCATE command is used to delete all the rows from the table and free
the space containing the table.

advertisement

10. 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
View Answer

Answer: a
Explanation: SQL Aliases are defined for columns and tables. Basically aliases are created to make
the column selected more readable.

https://www.sanfoundry.com/sqlserver-mcqs-basic-sql-1/ 4/7
1/30/24, 1:21 PM SQL Basics Questions and Answers - Sanfoundry

Sanfoundry Global Education & Learning Series – SQL Server.

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

« Prev - SQL Server Questions and Answers – » Next - SQL Server Questions and Answers –
Builtin Functions Basic SQL – 2

Related Posts:

Check SQL Server Books


Check Information Technology Books
Practice Programming MCQs
Apply for Programming Internship
Apply for SQL Server Internship

advertisement

Recommended Articles:
1. SQL Server Questions and Answers – Basic SQL – 2
2. SQL Server Questions and Answers – Basic SQL – 3
3. SQL Server Questions and Answers – Partitioning
4. SQL Server Questions and Answers – Modifying Data – 2
5. SQL Server Questions and Answers – Management Studio – 1
6. SQL Server Questions and Answers – Modifying Data – 1
https://www.sanfoundry.com/sqlserver-mcqs-basic-sql-1/ 5/7
1/30/24, 1:21 PM SQL Basics Questions and Answers - Sanfoundry

7. SQL Server Questions and Answers – Windowing


8. SQL Server Questions and Answers – SQL Audit
9. SQL Server Questions and Answers – Hierarchies
10. SQL Server Questions and Answers – Subqueries

advertisement

Additional Resources:
SQL Server MCQ Questions
Visual Basic MCQ Questions
C# Programs on LINQ
C Programs on File Handling
Basic Chemical Engineering MCQ Questions

Popular Pages:
C++ Algorithm Library
Basic Civil Engineering MCQ Questions
String Programs in C
Bitwise Operators in C
Basic Electrical Engineering MCQ Questions

https://www.sanfoundry.com/sqlserver-mcqs-basic-sql-1/ 6/7
1/30/24, 1:21 PM SQL Basics Questions and Answers - Sanfoundry

Subscribe: SQL Server Newsletter

Name

Email

Subscribe

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, 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.

About | Certifications | Internships | Jobs | Privacy Policy | Terms | Copyright | Contact

     

© 2011-2024 Sanfoundry. All Rights Reserved.

https://www.sanfoundry.com/sqlserver-mcqs-basic-sql-1/ 7/7

You might also like