YouTube Icon

Interview Questions.

Top 50 Sql Server 2005 Interview Questions - Jul 28, 2022

fluid

Top 50 Sql Server 2005 Interview Questions

Q1. Are Semicolons Required At The End Of Sql Statements In Sql Server 2005?

No it is not required.

Q2. What Is A Linked Server?

Linked Servers is a concept in SQL Server through which we will upload other SQL Server to a Group and query each the SQL Server databases using T-SQL Statements.

Q3. Does Server Sql Treat Char As A Variable-period Or Fixed-duration Column?

SQL Server treats CHAR as fixed period column.

Q4. Will Count(column) Include Columns With Null Values In Its Count?

Yes, it'll consist of the null column in count.

Q5. What Is A Foreign Key?

FOREIGN KEY constraints identify the relationships between tables.

A overseas key in a single desk factors to a candidate key in every other desk. Foreign keys save you movements that could go away rows with overseas key values when there aren't any candidate keys with that price. In the subsequent pattern, the order_part table establishes a overseas key referencing the part_sample table described in advance. Usually, order_part would actually have a foreign key against an order desk, however that is a easy instance.

CREATE TABLE order_part

(order_nmbr int,

part_nmbr int

FOREIGN KEY REFERENCES part_sample(part_nmbr)

ON DELETE NO ACTION,

qty_ordered int)

GO.

Q6. Will Sql Server 2005 Allow You To Reduce The Size Of A Column?

Yes it allows.

Q7. What Is The Syntax To Execute The Sys.Dm_db_missing_index_details?

Select * from sys.Dm_db_missing_index_details.

Q8. What Are Four Major Operators That Can Be Used To Combine Conditions On A Where Clause?

OR, AND, IN and BETWEEN.

Q9. What Is A Query?

A request for records from a database. There are three standard techniques for posing queries:

Choosing parameters from a menu: In this technique, the database machine provides a listing of parameters from which you can pick. This is perhaps the easiest way to pose a query because the menus guide you, but it is also the least bendy.

Query via example (QBE): In this approach, the system presents a blank file and lets you specify the fields and values that outline the question.

Query language: Many database systems require you to make requests for records within the shape of a stylized question that must be written in a special question language. This is the most complex approach as it forces you to learn a specialized language, however it is also the maximum effective.

Q10. What Does The Not Null Constraint Do?

Constrain will not permit NULL values inside the column.

Q11. Can We Perform Backup Restore Operation On Tempdb?

NO.

Q12. What Does The On Update No Action Do?

ON UPDATE NO ACTION:

Specifies that if an strive is made to replace a key fee in a row whose key is referenced by using overseas keys in present rows in other tables, an blunders is raised and the UPDATE is rolled returned.

Specifies that if an attempt is made to delete a row with a key referenced with the aid of overseas keys in present rows in different tables, an errors is raised and the DELETE is rolled back.

Q13. What Is The Default Port No On Which Sql Server Listens?

1433.

Q14. What Is The Parse Query Button Used For?

Parse query button is used to test the SQL Query Syntax.

Q15. What Is The Purpose Of The Master Database?

Master database continues the records about sq. Server configuration, databases customers and so on.

Q16. What Is The Purpose Of The Tempdb Database?

Tempdb database keeps the information approximately the transient objects (#TableName, #Procedure). Also the sorting, DBCC operations are carried out within the TempDB.

Q17. Do Comments Need To Go In A Special Place In Sql Server 2005?

No its not important.

Q18. What Is The Default Value Of An Integer Data Type In Sql Server 2005?

NULL.

Q19. What Is The Purpose Of The Model Database?

It works as Template Database for the Create Database Syntax.

Q20. What Stored By The Master?

Server's configurations and logins.

Q21. How Do You Troubleshoot Errors In A Sql Server Agent Job?

Inside SSMS, in Object explorer underneath SQL Server Agent look for Job Activity Monitor. The activity pastime monitor displays the cutting-edge fame of all of the jobs on the example. Choose the particular task which failed, proper click and choose view records from the drop down menu. The execution records of the activity is displayed and you could pick out the execution time (if the job failed more than one times in the course of the equal day). There could records such as the time it took to execute that Job and details about the error took place.

Q22. What Are The Commands Used In Dcl?

GRANT, DENY and REVOKE.

Q23. What Is Fill Factor?

Fill Factor is a placing that is relevant to Indexes in SQL Server. The fill element cost determines how a whole lot information is written to an index page while it is created / rebuilt.

Q24. When Would You Use An Insert Into .. Select Option Versus An Insert Into .. Values Option? Give An Example Of Each?

INSERT INTO .. SELECT is used insert information in to desk from special tables or condition based insert.

INSERT INTO .. VALUES you have to specify the insert values.

Q25. Is A Null Value Equal To Anything? Can A Space In A Column Be Considered A Null Value? Why Or Why Not?

No NULL fee manner nothing. We can’t recollect area as NULL fee.

Q26. Does A Sql Server 2005 Select Statement Require A From?

NO.

Q27. What Does The On Delete Cascade Option Do?

ON DELETE CASCADE:

Specifies that if an strive is made to delete a row with a key referenced by way of overseas keys in present rows in other tables, all rows containing the ones foreign keys also are deleted. If cascading referential moves have also been described on the target tables, the specified cascading moves also are taken for the rows deleted from the ones tables.

Specifies that if an strive is made to replace a key price in a row, wherein the important thing cost is referenced by overseas keys in current rows in different tables, all of the overseas key values also are updated to the brand new value distinct for the important thing. If cascading referential actions have additionally been defined on the target tables, the required cascading movements are also taken for the important thing values up to date in the ones tables.

Q28. What Are The Dmvs?

Dynamic Management Views (DMV) go back server country records that may be used to monitor the fitness of a server instance, diagnose problems, and tune performance.

Q29. What Command Would You Use To Add A Column To A Table In Sql Server?

ALTER TABLE tablename ADD column_name DATATYPE.

Q30. What Are System Databases Into Sql Server (2005/2008)?

TEMPDB, MSDEB, MASTER, MSDB, mssqlsystemresource.

Q31. What Is The Default Order Of An Order By Clause?

Ascending Order.

Q32. Where The Sql Logs Gets Stored?

It's saved into root folder SQL server, LOG folder.

Q33. How Are The Unique And Primary Key Constraints Different?

A UNIQUE constraint is much like PRIMARY key, but you may have multiple UNIQUE constraint according to desk. When you claim a UNIQUE constraint, SQL Server creates a UNIQUE index to hurry up the process of trying to find duplicates. In this example the index defaults to NONCLUSTERED index, because you can have best one CLUSTERED index in line with desk.

 The quantity of UNIQUE constraints in keeping with table is confined through the quantity of indexes on the desk i.E 249 NONCLUSTERED index and one feasible CLUSTERED index.

Contrary to PRIMARY key UNIQUE constraints can accept NULL but simply once. If the constraint is defined in a combination of fields, then every subject can be given NULL and can have a few values on them, so long as the aggregate values is unique.

Q34. Does Order By Actually Change The Order Of The Data In The Tables Or Does It Just Change The Output?

Order By clause exchange most effective the output of the data.

Q35. Can You Change The Data Type Of A Column In A Table After The Table Has Been Created? If So, Which Command Would You Use?

Yes we will. Alter Table Modify Column.

Q36. What Is Usually The First Word In A Sql Query?

SELECT.

Q37. While You Are Inserting Values Into A Table With The Insert Into .. Values Option, Does The Order Of The Columns In The Insert Statement Have To Be The Same As The Order Of The Columns In The Table?

Not Necessary.

Q38. When Columns Are Added To Existing Tables, What Do They Initially Contain?

The column to begin with carries the NULL values.

Q39. What Does The Update Command Do?

Update command will modify the existing report.

Q40. What Is The New In Sql Server 2008?

File stream records kind, Activity Monitor, Resource governor, information compression, compressed backup.

Q41. What Is The Order By Used For?

Order By clause is used for sorting information in Ascending or Descending order.

Q42. What Stored By The Model?

Templates of recent database items, like tables and column.

Q43. How Many Files Can A Database Contain In Sql Server?How Many Types Of Data Files Exists In Sql Server? How Many Of Those Files Can Exist For A Single Database?

 A Database can contain a most of 32,767 documents.

 There are Primarily 2 styles of facts documents Primary records file and Secondary statistics file(s). There can be simplest one Primary facts report and multiple secondary information files so long as the full # of documents is much less than 32,767 documents.

Q44. Can You Type More Than One Query In The Query Editor Screen At The Same Time?

Yes we will.

Q45. What Stored By The Msdb?

Scheduled jobs, Backup/Restore and DTA statistics.

Q46. What Command Must You Use To Include The Not Null Constraint After A Table Has Already Been Created?

DEFAULT, WITH CHECK or WITH NOCHECK.

Q47. Does An Index Slow Down Updates On Indexed Columns?

Yes.

Q48. Can A Synonym Name Of A Table Be Used Instead Of A Table Name In A Select Statement?

Yes.

Q49. When A Primary Key Constraint Is Included In A Table, What Other Constraints Does This Imply?

Unique + NOT NULL.

Q50. What Command Would You Use To Create An Index?

CREAT INDEX INDEXNAME ON TABLE(COLUMN NAME).




CFG