SQL Server Interview Questions and Answers (11-20)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

SQL Server Interview Questions-(11-20)

11. Can we take backup for TempDB Database?


a. Yes
b. No
12. In which SQL Server edition SQL Server Agent is not available?
a. Standard edition
b. Express edition
c. Enterprise edition
d. Developer edition
13. How many non-clustered indexes can we create per a table in SQL server?
a. 1
b. 999
c. 1024
d. Unlimited
14. From which SQL Server version service packs are not available?
a. 2012
b. 2014
c. 2016
d. 2017
15. In which SQL Server version Always On Automatic seeding was introduced?
a. 2019
b. 2017
c. 2012
d. 2016
16. In which log Shipping mode the TUF File will create?
a. Log shipping with no recovery
b. Log shipping with standby
17. Can we create a cluster and non-clustered index on the same table?
a. Yes
b. No
18. Can we take database differential backup without taking full backup in SQL Server?
a. Yes
b. No
19. In which SQL Server page the different changes are stored?
a. Data Page
b. BCM
c. DCM
d. PFS
20. Can we access the database which is in emergency mode?
a. Yes
b. No
11. Can we take backup for TempDB Database?
c. Yes
d. No

A. Since TempDB stores temporary objects Backup and restore operations are not allowed on
tempdb.

 We can’t drop tempDB


 Operations within tempdb are minimally logged so that transactions can be rolled back.
 tempdb is re-created every time SQL Server is started so that the system always starts with a
clean copy of the database.
 Temporary tables and stored procedures are dropped automatically on disconnect

No Backup Option for TempDB

TempDB Contents:

 Temporary user objects that are explicitly created. They include global or local temporary
tables and indexes, temporary stored procedures
 table variables, tables returned in table-valued functions, and cursors.
 Internal objects that the database engine creates. They include: Work tables to store
intermediate results for spools, cursors, sorts, and temporary large object (LOB) storage.

12. In which SQL Server edition SQL Server Agent is not available?
a. Standard edition
b. Express edition
c. Enterprise edition
d. Developer edition

A. No. SQL Server Express Edition is a free version that does not include the SQL Agent (because it is
free).
13. How many non-clustered indexes can we create per a table in SQL server?
a. 1
b. 999
c. 1024
d. Unlimited

A. We can create up to 1000 indexes per table (one clustered index+999 clustered indexes)

Script to create non clustered Index

14. From which SQL Server version service packs are not available?
a. 2012
b. 2014
c. 2016
d. 2017

A. SPs will no longer be available from SQL Server 2017 version. Only Cumulative Updates (CUs) and
critical updates (GDRs) will be provided.

 CU’s will be released for every one month for the first year and then every quarter for the
final four years of the five-year.

15. In which SQL Server version Always On Automatic seeding was introduced?
a. 2019
b. 2017
c. 2012
d. 2016

A. SQL Server 2016 introduced automatic seeding of availability groups

 When you create an availability group with automatic seeding, SQL Server automatically
creates the secondary replicas for every database in the group.
 You no longer have to manually back up and restore secondary replicas.

16. In which log Shipping mode the TUF File will create?
a. Log shipping with no recovery
b. Log shipping with standby

A. The Transaction Undo File (TUF) is used in log shipping as a mechanism to store uncommitted
transactions that are present in the transaction log backup being shipped to the secondary server.

 The secondary server applies these transaction log backups in sequence to bring the
database to the same state as the primary server.
 However, if the secondary server were to apply a transaction log backup that contained
uncommitted transactions, it could lead to data inconsistency.
 To prevent this from happening, the uncommitted transactions are stored in the TUF file on
the primary server and shipped to the secondary server along with the transaction log
backups.

17. Can we create a cluster and non-clustered index on the same table(column)?
a. Yes
b. No

A. Yes, We can create clustered and non-clustered index on the same table and same column as well.
18. Can we take database differential backup without taking full backup in SQL Server?
a. Yes
b. No

A. Since full backup is foundational backup, we can’t take differential backup without taking the full
backup

 Differential Backup checks for the recent full backup, if full backup is not available the
differential backup will fail with the following error.

19. In which SQL Server page the different changes are stored?
a. Data Page
b. BCM
c. DCM
d. PFS

A. A differential backup captures only the data that has changed since that full backup

 A differential backup records only the data that has changed since the full backup upon the
differential backup is based.
20. Can we access the database which is in emergency mode?
a. Yes
b. No

A. Yes, we can access the database in emergency mode with some limitations

 A database can be set to EMERGENCY state for troubleshooting purposes


 When a database is put in the Emergency state, it makes the following major
changes to the database configuration:
 It makes the database READ ONLY
 Restricts the access to members of sysadmin fixed server role only
 Benefits of putting database in Emergency Mode
 Emergency mode is one of the database recovery technique used to repair
the data lose or rebuild the log so that you can bring the database in
recoverable state and online.
 The database may be accessed as READ ONLY, so you can export the data
out of the database by using any method like BCP, DTS or SELECT INTO
statement.

You might also like