0% found this document useful (0 votes)
40 views

SQL Server Questions and Answers For Freshers - Sanfoundry

This document contains 10 multiple choice questions about SQL Server basics for freshers. It covers SQL concepts like Data Manipulation Language (DML), the SELECT statement, ORDER BY, COUNT, DISTINCT, UNION, ALTER TABLE, UPDATE and LIKE clauses. The questions test understanding of how to query, sort, count and modify data in SQL Server tables. It recommends additional SQL Server practice resources.

Uploaded by

Samiksha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

SQL Server Questions and Answers For Freshers - Sanfoundry

This document contains 10 multiple choice questions about SQL Server basics for freshers. It covers SQL concepts like Data Manipulation Language (DML), the SELECT statement, ORDER BY, COUNT, DISTINCT, UNION, ALTER TABLE, UPDATE and LIKE clauses. The questions test understanding of how to query, sort, count and modify data in SQL Server tables. It recommends additional SQL Server practice resources.

Uploaded by

Samiksha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1/30/24, 1:25 PM SQL Server Questions and Answers for Freshers - Sanfoundry

SQL Server Questions and Answers – Basic SQL –


2
This set of SQL Server Multiple Choice Questions and Answers for freshers focuses on “Basic SQL –
2”.

1. What does DML stand for?


a) Different Mode Level
b) Data Model Language
c) Data Mode Lane
d) Data Manipulation language
View Answer

2. With SQL, how do you select all the records from a table named “Persons” where the value of the
column “FirstName” ends with an “a”?
a) SELECT * FROM Persons WHERE FirstName=’a’
b) SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
c) SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
d) SELECT * FROM Persons WHERE FirstName=’%a%’
View Answer

Answer: c
Explanation: The SQL LIKE clause is used to compare a value to similar values using wildcard
operators.

3. With SQL, how can you return all the records from a table named “Persons” sorted descending by
“FirstName”?
a) SELECT * FROM Persons SORT BY ‘FirstName’ DESC
b) SELECT * FROM Persons ORDER FirstName DESC
c) SELECT * FROM Persons SORT ‘FirstName’ DESC
d) SELECT * FROM Persons ORDER BY FirstName DESC
View Answer

Answer: d
Mitsubishi
Explanation: The SQL SELECT Electric
statement queries data from tables in the database.READ MORE
sponsored by: Mitsubishi Electric

https://www.sanfoundry.com/sqlserver-questions-answers-freshers/ 1/7
1/30/24, 1:25 PM SQL Server Questions and Answers for Freshers - Sanfoundry

advertisement

4. With SQL, how can you return the number of not null records in the “Persons” table?
a) SELECT COUNT() FROM Persons
b) SELECT COLUMNS() FROM Persons
c) SELECT COLUMNS(*) FROM Persons
d) SELECT COUNT(*) FROM Persons
View Answer

Answer: a
Explanation: COUNT(column_name) is used to count the number of rows of a table where column
name is a column that does not allow NULL values.

5. What does the ALTER TABLE clause do?


a) The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table
columns and/or constraints
b) The SQL ALTER TABLE clause is used to insert data into database table
c) THE SQL ALTER TABLE deletes data from database table
d) The SQL ALTER TABLE clause is used to delete a database table
View Answer

Answer: a
Explanation: The ALTER TABLE statement is used to add, delete, or modify columns.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The UPDATE SQL clause can _____________


a) update only one row at a time
https://www.sanfoundry.com/sqlserver-questions-answers-freshers/ 2/7
1/30/24, 1:25 PM SQL Server Questions and Answers for Freshers - Sanfoundry

b) update more than one row at a time


c) delete more than one row at a time
d) delete only one row at a time
View Answer

Answer: b
Explanation: The SQL UPDATE Query is used to modify the existing records in a table. You can use
WHERE clause with UPDATE query to update selected rows otherwise all the rows would be
affected.

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

Answer: a
Explanation: The SQL UNION operator is used to combine the result sets of 2 or more SELECT
statements. It removes duplicate rows between the various SELECT statements.

advertisement

8. Which SQL statement is used to return only different values?


a) SELECT DIFFERENT
b) SELECT UNIQUE
c) SELECT DISTINCT
d) SELECT ALL
View Answer

https://www.sanfoundry.com/sqlserver-questions-answers-freshers/ 3/7
1/30/24, 1:25 PM SQL Server Questions and Answers for Freshers - Sanfoundry

Answer: c
Explanation: The SELECT DISTINCT statement is used to return only distinct (different) values.

9. Which SQL keyword is used to sort the result-set?


a) ORDER BY
b) SORT
c) ORDER
d) SORT BY
View Answer

Answer: a
Explanation: The ORDER BY keyword sorts the records in ascending order by default.

advertisement

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

Answer: d
Explanation: In its simplest form, the syntax for the UPDATE statement when updating one table
is:UPDATE table SET column1 = expression1,column2 = expression2,… WHERE conditions.

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server for Freshers, here is complete set of 1000+ Multiple Choice
Questions and Answers.
https://www.sanfoundry.com/sqlserver-questions-answers-freshers/ 4/7
1/30/24, 1:25 PM SQL Server Questions and Answers for Freshers - Sanfoundry

« Prev - SQL Server Questions and Answers – » Next - SQL Server Questions and Answers –
Basic SQL – 1 Basic SQL – 3

Related Posts:

Check Information Technology Books


Apply for Programming Internship
Practice Programming MCQs
Check SQL Server Books

advertisement

Recommended Articles:
1. SQL Server Questions and Answers – Basic SQL – 1
2. SQL Server Questions and Answers – Basic SQL – 3
3. SQL Server Questions and Answers – Modifying Data – 2
4. SQL Server Questions and Answers – DML Triggers
5. SQL Server Questions and Answers – Access With Sql Server
6. SQL Server Questions and Answers – Windowing
7. SQL Server Questions and Answers – Reporting Services – 2
8. SQL Server Questions and Answers – SQL Audit
9. SQL Server Questions and Answers – User Defined Functions – 1
10. SQL Server Questions and Answers – Bulk Operations

https://www.sanfoundry.com/sqlserver-questions-answers-freshers/ 5/7
1/30/24, 1:25 PM SQL Server Questions and Answers for Freshers - Sanfoundry

advertisement

Additional Resources:
SQL Server MCQ Questions
Visual Basic MCQ Questions
LISP MCQ Questions
Oracle Database MCQ Questions
Basic Chemical Engineering MCQ Questions

Popular Pages:
Basic Civil Engineering MCQ Questions
Automata Theory MCQ Questions
Vector Biology and Gene Manipulation MCQ Questions
C# Programs on LINQ
Basic Electrical Engineering MCQ Questions

https://www.sanfoundry.com/sqlserver-questions-answers-freshers/ 6/7
1/30/24, 1:25 PM SQL Server Questions and Answers for Freshers - 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-questions-answers-freshers/ 7/7

You might also like