This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What Is The Difference Between A Union And A Join In Sql Server? |
|
Answer» A UNION select rows whereas a JOIN selects columns from two or more TABLES. Both can be used to COMBINE data from MULTIPLE tables. In a nutshell, JOIN combines data into new columns, whereas UNION combines data into new rows. A UNION select rows whereas a JOIN selects columns from two or more tables. Both can be used to combine data from multiple tables. In a nutshell, JOIN combines data into new columns, whereas UNION combines data into new rows. |
|
| 2. |
What Is A Cursor And What Are Its Different Types? |
|
Answer» This is the frequently asked SQL Server Interview Questions in an interview. A cursor is a database object, which can utilize to retrieve the data, one row at a time from the result set. When data NEEDS to be updated row-by-row, cursors can be very HANDY. The cursor life cycle consists of mainly 5 STEPS.
Types of a cursor are:
This is the frequently asked SQL Server Interview Questions in an interview. A cursor is a database object, which can utilize to retrieve the data, one row at a time from the result set. When data needs to be updated row-by-row, cursors can be very handy. The cursor life cycle consists of mainly 5 steps. Types of a cursor are: |
|
| 3. |
What Is Collation In Sql Server? |
|
Answer» There are the certain set of rules which WOULD decide how data needs to be sorted and compared in a database. These rules can be referred to as Collation. Example – Character data is sorted using rules that defines the right character sequence, with an option for specifying case sensitivity, character width etc. Collation is predefined in SQL server, which would decide how data in SQL server are stored and retrieved. There are various collations that EXIST in SQL server, but 2 are MAIN:
Where CI is case insensitive and CS is case sensitive. So, by DEFAULT collation is case insensitive, thus all database in it is also case-insensitive. There are the certain set of rules which would decide how data needs to be sorted and compared in a database. These rules can be referred to as Collation. Example – Character data is sorted using rules that defines the right character sequence, with an option for specifying case sensitivity, character width etc. Collation is predefined in SQL server, which would decide how data in SQL server are stored and retrieved. There are various collations that exist in SQL server, but 2 are main: Where CI is case insensitive and CS is case sensitive. So, by default collation is case insensitive, thus all database in it is also case-insensitive. |
|
| 4. |
What Are The Merits And Demerits Of Having An Index In Sql Server? |
|
Answer» There are various MERITS and demerits of index usage in SQL server. Some of them can cite as:
Some disadvantages can be:
There are various merits and demerits of index usage in SQL server. Some of them can cite as: Some disadvantages can be: |
|
| 5. |
What Is The Command To Create A Database In Sql Server? |
|
Answer» There is a command called ‘CREATEDATABASE’, it can be utilized to CREATE any database on the SQL SERVER. Its SYNTAX is: CREATE DATABASE database_name Example- “Test” database can be created to CREATE DATABASE Test There is a command called ‘CREATEDATABASE’, it can be utilized to create any database on the SQL server. Its syntax is: CREATE DATABASE database_name Example- “Test” database can be created to CREATE DATABASE Test |
|
| 6. |
What Is The Replication And Why It Is Required On The Sql Server? |
|
Answer» It is a set of technologies for copy and distributes DATA and database objects from one database to another. Synchronize the data can also be achieved with replication to maintain consistency. Replication can be used to DISTRIBUTE data to various LOCATIONS and to remote or mobile users over the certain medium of internet. Multiple servers having data can be synchronized with the replication process using a replica set. Thus, reading CAPACITY can be enhanced and users can be provided with a CHOICE to selecting among different server to perform read-write operations. It is a set of technologies for copy and distributes data and database objects from one database to another. Synchronize the data can also be achieved with replication to maintain consistency. Replication can be used to distribute data to various locations and to remote or mobile users over the certain medium of internet. Multiple servers having data can be synchronized with the replication process using a replica set. Thus, reading capacity can be enhanced and users can be provided with a choice to selecting among different server to perform read-write operations. |
|
| 7. |
Explain The Usage Of View In Sql Server? |
|
Answer» This is the basic SQL Server Interview Questions asked in an interview. Views are the most beneficial entity for an SQL server developer. There is a whole lot of complexity involved in the database SCHEMA. At the same time, customizing the data for a particular set of users can be a tedious task, which is equally complex as database schema design. These types of complexity can be abstract away with a View. They provide a mechanism to control access to specific ROWS and columns. Thus, the performance of a database can be IMPROVED significantly by AGGREGATING the data. This is the basic SQL Server Interview Questions asked in an interview. Views are the most beneficial entity for an SQL server developer. There is a whole lot of complexity involved in the database schema. At the same time, customizing the data for a particular set of users can be a tedious task, which is equally complex as database schema design. These types of complexity can be abstract away with a View. They provide a mechanism to control access to specific rows and columns. Thus, the performance of a database can be improved significantly by aggregating the data. |
|
| 8. |
What Is A Trigger And How Many Types Of Triggers Are There? |
|
Answer» Every time an event with a table occurs like, insert, update or delete, a batch of SQL CODE can be executed with an entity called TRIGGER. They are managed by DBMS. Triggers can ALSO be utilized to execute a stored procedure. Triggers available in SQL SERVER are listed below:
Every time an event with a table occurs like, insert, update or delete, a batch of SQL code can be executed with an entity called Trigger. They are managed by DBMS. Triggers can also be utilized to execute a stored procedure. Triggers available in SQL server are listed below: |
|
| 9. |
What Are The Multiple Ways To Secure A Sql Server? |
|
Answer» There are MULTIPLE approaches with which a developer can ensure the safety and security of a SQL server. Some of them MIGHT be COMMON usage while others can be more technically oriented.
There are multiple approaches with which a developer can ensure the safety and security of a SQL server. Some of them might be common usage while others can be more technically oriented. |
|
| 10. |
Which Operator Is Used In Query For Pattern Matching? |
|
Answer» LIKE OPERATOR is used for pattern MATCHING, and it can be used as -. % – MATCHES zero or more CHARACTERS. _(Underscore) – Matching exactly one CHARACTER. LIKE operator is used for pattern matching, and it can be used as -. % – Matches zero or more characters. _(Underscore) – Matching exactly one character. |
|
| 11. |
What Are Aggregate And Scalar Functions? |
|
Answer» AGGREGATE functions are USED to evaluate mathematical calculation and return single values. This can be calculated from the columns in a table. Scalar functions return a single value based on the input value. Example -. Aggregate – MAX(), count – Calculated with respect to numeric. Scalar – UCASE(), NOW() – Calculated with respect to strings. Aggregate functions are used to evaluate mathematical calculation and return single values. This can be calculated from the columns in a table. Scalar functions return a single value based on the input value. Example -. Aggregate – max(), count – Calculated with respect to numeric. Scalar – UCASE(), NOW() – Calculated with respect to strings. |
|
| 12. |
What Is The Difference Between Truncate And Drop Statements? |
|
Answer» TRUNCATE removes all the ROWS from the table, and it cannot be ROLLED BACK. DROP command removes a table from the database and OPERATION cannot be rolled back. TRUNCATE removes all the rows from the table, and it cannot be rolled back. DROP command removes a table from the database and operation cannot be rolled back. |
|
| 13. |
How To Find Second Highest Salary Of An Employee? |
|
Answer» There are many ways to find second HIGHEST salary of Employees in SQ. You can either use SQL JOIN or Subquery to solve this PROBLEM. Here is SQL QUERY using Subquery : Select MAX(Salary) from table1 WHERE Salary NOT IN ( select MAX(Salary) from table1. There are many ways to find second highest salary of Employees in SQ. You can either use SQL Join or Subquery to solve this problem. Here is SQL query using Subquery : Select MAX(Salary) from table1 WHERE Salary NOT IN ( select MAX(Salary) from table1. |
|
| 14. |
What Is Sql Profiler? |
Answer»
|
|
| 15. |
What Is Self-join? |
|
Answer» Self-join is SET to be QUERY used to compare to itself. This is used to compare values in a column with other values in the same column in the same table. ALIAS ES can be used for the same table COMPARISON. Self-join is set to be query used to compare to itself. This is used to compare values in a column with other values in the same column in the same table. ALIAS ES can be used for the same table comparison. |
|
| 16. |
What Is Normalization? |
|
Answer» Normalization is the process of minimizing REDUNDANCY and dependency by ORGANIZING fields and table of a DATABASE. The MAIN aim of Normalization is to add, delete or MODIFY field that can be made in a single table. Normalization is the process of minimizing redundancy and dependency by organizing fields and table of a database. The main aim of Normalization is to add, delete or modify field that can be made in a single table. |
|
| 17. |
What Is A Foreign Key? |
|
Answer» A foreign key is ONE table which can be related to the PRIMARY key of another table. RELATIONSHIP NEEDS to be created between two tables by referencing foreign key with the primary key of another table. A foreign key is one table which can be related to the primary key of another table. Relationship needs to be created between two tables by referencing foreign key with the primary key of another table. |
|