InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Can You Use The On Delete And On Update In The Same Constraint? |
|
Answer» Yes we can. Yes we can. |
|
| 2. |
What Is The Purpose Of The Model Database? |
|
Answer» It WORKS as TEMPLATE DATABASE for the CREATE Database SYNTAX. It works as Template Database for the Create Database Syntax. |
|
| 3. |
What Is The Purpose Of The Master Database? |
|
Answer» Master database KEEPS the INFORMATION about SQL SERVER configuration, databases USERS etc. Master database keeps the information about sql server configuration, databases users etc. |
|
| 4. |
What Is The Purpose Of The Tempdb Database? |
|
Answer» Tempdb database KEEPS the INFORMATION about the temporary objects (#TABLENAME, #Procedure). Also the SORTING, DBCC operations are PERFORMED in the TempDB. Tempdb database keeps the information about the temporary objects (#TableName, #Procedure). Also the sorting, DBCC operations are performed in the TempDB. |
|
| 5. |
What Is The Purpose Of The Use Command? |
|
Answer» USE command is USED for to SELECT the DATABASE. For i.e Use Database Name. Use command is used for to select the database. For i.e Use Database Name. |
|
| 6. |
If You Delete A Table In The Database, Will The Data In The Table Be Deleted Too? |
|
Answer» Yes. Yes. |
|
| 7. |
What Is The Parse Query Button Used For? |
|
Answer» PARSE query BUTTON is USED to CHECK the SQL Query Syntax. Parse query button is used to check the SQL Query Syntax. |
|
| 8. |
What Is Usually The First Word In A Sql Query? |
|
Answer» SELECT. SELECT. |
|
| 9. |
Does A Sql Server 2005 Select Statement Require A From? |
|
Answer» NO. NO. |
|
| 10. |
What Is The Order By Used For? |
|
Answer» Order By CLAUSE is USED for sorting records in Ascending or DESCENDING order. Order By clause is used for sorting records in Ascending or Descending order. |
|
| 11. |
Does Order By Actually Change The Order Of The Data In The Tables Or Does It Just Change The Output? |
|
Answer» ORDER By CLAUSE CHANGE only the OUTPUT of the DATA. Order By clause change only the output of the data. |
|
| 13. |
What Are Four Major Operators That Can Be Used To Combine Conditions On A Where Clause? |
|
Answer» OR, AND, IN and BETWEEN. OR, AND, IN and BETWEEN. |
|
| 14. |
Is A Null Value Equal To Anything? Can A Space In A Column Be Considered A Null Value? Why Or Why Not? |
|
Answer» No NULL VALUE means nothing. We can’t CONSIDER space as NULL value. No NULL value means nothing. We can’t consider space as NULL value. |
|
| 15. |
Will Count(column) Include Columns With Null Values In Its Count? |
|
Answer» YES, it will INCLUDE the NULL COLUMN in COUNT. Yes, it will include the null column in count. |
|
| 16. |
What Are Table Aliases? |
|
Answer» Aliases can make it easier to WORK with table names. Using aliases is helpful when:
Aliases can make it easier to work with table names. Using aliases is helpful when: |
|
| 17. |
Are Semicolons Required At The End Of Sql Statements In Sql Server 2005? |
|
Answer» No it is not REQUIRED. No it is not required. |
|
| 18. |
Do Comments Need To Go In A Special Place In Sql Server 2005? |
|
Answer» No its not NECESSARY. No its not necessary. |
|
| 19. |
What Is A Synonym? Why Would You Want To Create A Synonym? |
|
Answer» SYNONYM is a single-part name that can replace a two, three or four-part name in MANY SQL statements. Using SYNONYMS in RDBMS cuts down on typing.
SYNONYM is a single-part name that can replace a two, three or four-part name in many SQL statements. Using SYNONYMS in RDBMS cuts down on typing. |
|
| 20. |
Can A Synonym Name Of A Table Be Used Instead Of A Table Name In A Select Statement? |
|
Answer» Yes. Yes. |
|
| 21. |
Can You Type More Than One Query In The Query Editor Screen At The Same Time? |
|
Answer» YES we can. Yes we can. |
|
| 22. |
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? |
|
Answer» Not NECESSARY. Not Necessary. |
|
| 23. |
When Would You Use An Insert Into .. Select Option Versus An Insert Into .. Values Option? Give An Example Of Each? |
|
Answer» INSERT INTO .. SELECT is used insert DATA in to table from DIFFERENT tables or condition BASED insert. INSERT INTO .. SELECT is used insert data in to table from different tables or condition based insert. |
|
| 24. |
What Does The Update Command Do? |
|
Answer» UPDATE COMMAND will MODIFY the EXISTING RECORD. Update command will modify the existing record. |
|
| 25. |
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? |
|
Answer» YES we can. ALTER Table MODIFY COLUMN. Yes we can. Alter Table Modify Column. |
|
| 26. |
Will Sql Server 2005 Allow You To Reduce The Size Of A Column? |
|
Answer» Yes it allows. |
|
| 27. |
What Is The Default Value Of An Integer Data Type In Sql Server 2005? |
|
Answer» NULL. NULL. |
|
| 28. |
Does Server Sql Treat Char As A Variable-length Or Fixed-length Column? |
|
Answer» SQL SERVER treats CHAR as fixed length COLUMN. SQL Server treats CHAR as fixed length column. |
|
| 29. |
If You Are Going To Have Too Many Nulls In A Column, What Would Be The Best Data Type To Use? |
|
Answer» Variable length columns only use a very small AMOUNT of space to store a NULL so VARCHAR DATATYPE is the good OPTION for null values. Variable length columns only use a very small amount of space to store a NULL so VARCHAR datatype is the good option for null values. |
|
| 30. |
When Columns Are Added To Existing Tables, What Do They Initially Contain? |
|
Answer» The COLUMN INITIALLY CONTAINS the NULL VALUES. The column initially contains the NULL values. |
|
| 31. |
What Command Would You Use To Add A Column To A Table In Sql Server? |
|
Answer» ALTER TABLE TABLENAME ADD column_name DATATYPE. ALTER TABLE tablename ADD column_name DATATYPE. |
|
| 32. |
Does An Index Slow Down Updates On Indexed Columns? |
|
Answer» Yes. Yes. |
|
| 33. |
What Command Would You Use To Create An Index? |
|
Answer» CREAT INDEX INDEXNAME ON TABLE(COLUMN NAME). CREAT INDEX INDEXNAME ON TABLE(COLUMN NAME). |
|
| 34. |
What Does The Not Null Constraint Do? |
|
Answer» CONSTRAIN will not ALLOW NULL VALUES in the COLUMN. Constrain will not allow NULL values in the column. |
|
| 35. |
What Command Must You Use To Include The Not Null Constraint After A Table Has Already Been Created? |
|
Answer» DEFAULT, WITH CHECK or WITH NOCHECK. DEFAULT, WITH CHECK or WITH NOCHECK. |
|
| 36. |
When A Primary Key Constraint Is Included In A Table, What Other Constraints Does This Imply? |
|
Answer» Unique + NOT NULL. |
|
| 37. |
How Are The Unique And Primary Key Constraints Different? |
|
Answer» A UNIQUE CONSTRAINT is similar to PRIMARY key, but you can have more than one UNIQUE constraint per table. When you declare a UNIQUE constraint, SQL Server creates a UNIQUE index to speed up the process of searching for duplicates. In this case the index defaults to NONCLUSTERED index, because you can have only one CLUSTERED index per table.
A UNIQUE constraint is similar to PRIMARY key, but you can have more than one UNIQUE constraint per table. When you declare a UNIQUE constraint, SQL Server creates a UNIQUE index to speed up the process of searching for duplicates. In this case the index defaults to NONCLUSTERED index, because you can have only one CLUSTERED index per table. |
|
| 38. |
What Is A Concatenated Primary Key? |
|
Answer» Each table has ONE and only one primary key, which can consist of one or many columns. A concatenated primary key comprises two or more columns. In a single table, you MIGHT find several columns, or GROUPS of columns, that might serve as a primary key and are called candidate keys. A table can have more than one candidate key, but only one candidate key can BECOME the primary key for that table. Each table has one and only one primary key, which can consist of one or many columns. A concatenated primary key comprises two or more columns. In a single table, you might find several columns, or groups of columns, that might serve as a primary key and are called candidate keys. A table can have more than one candidate key, but only one candidate key can become the primary key for that table. |
|
| 39. |
What Is A Referential Integrity Constraint? What Two Keys Does The Referential Integrity Constraint Usually Include? |
|
Answer» Referential integrity in a relational database is consistency between coupled tables. Referential integrity is USUALLY enforced by the combination of a PRIMARY key or candidate key (alternate key) and a foreign key. For referential integrity to hold, any field in a table that is declared a foreign key can contain only values from a parent table’s primary key or a candidate key. For INSTANCE, deleting a record that contains a value referred to by a foreign key in another table would break referential integrity. The relational database management system (RDBMS) enforces referential integrity, normally either by deleting the foreign key rows as well to maintain integrity, or by RETURNING an error and not performing the delete. Which method is used would be determined by the referential integrity CONSTRAINT, as defined in the data dictionary. Referential integrity in a relational database is consistency between coupled tables. Referential integrity is usually enforced by the combination of a primary key or candidate key (alternate key) and a foreign key. For referential integrity to hold, any field in a table that is declared a foreign key can contain only values from a parent table’s primary key or a candidate key. For instance, deleting a record that contains a value referred to by a foreign key in another table would break referential integrity. The relational database management system (RDBMS) enforces referential integrity, normally either by deleting the foreign key rows as well to maintain integrity, or by returning an error and not performing the delete. Which method is used would be determined by the referential integrity constraint, as defined in the data dictionary. |
|
| 40. |
What Does The On Delete Cascade Option Do? |
|
Answer» ON DELETE CASCADE:
ON DELETE CASCADE: |
|
| 41. |
What Does The On Update No Action Do? |
Answer»
ON UPDATE NO ACTION: |
|
| 42. |
What Is The New In Sql Server 2008? |
|
Answer» File stream data type, ACTIVITY MONITOR, RESOURCE governor, data COMPRESSION, compressed backup. File stream data type, Activity Monitor, Resource governor, data compression, compressed backup. |
|
| 43. |
What Are System Databases Into Sql Server (2005/2008)? |
|
Answer» TEMPDB, MSDEB, MASTER, MSDB, mssqlsystemresource. TEMPDB, MSDEB, MASTER, MSDB, mssqlsystemresource. |
|
| 45. |
What Is Fill Factor? |
|
Answer» Fill FACTOR is a setting that is applicable to Indexes in SQL Server. The fill factor value determines how much DATA is written to an INDEX PAGE when it is created / rebuilt. Fill Factor is a setting that is applicable to Indexes in SQL Server. The fill factor value determines how much data is written to an index page when it is created / rebuilt. |
|
| 47. |
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? |
| Answer» | |
| 48. |
What Is The Default Port No On Which Sql Server Listens? |
|
Answer» 1433. 1433. |
|
| 49. |
How Do You Troubleshoot Errors In A Sql Server Agent Job? |
|
Answer» Inside SSMS, in OBJECT explorer under SQL Server Agent look for Job Activity Monitor. The job activity monitor displays the current status of all the jobs on the instance. Choose the particular job which failed, right click and choose view history from the drop down menu. The execution history of the job is displayed and you MAY choose the execution time (if the job failed multiple times during the same DAY). There WOULD information such as the time it took to execute that Job and details about the error occurred. Inside SSMS, in Object explorer under SQL Server Agent look for Job Activity Monitor. The job activity monitor displays the current status of all the jobs on the instance. Choose the particular job which failed, right click and choose view history from the drop down menu. The execution history of the job is displayed and you may choose the execution time (if the job failed multiple times during the same day). There would information such as the time it took to execute that Job and details about the error occurred. |
|