Top 8 Anz Sql Server Interview Questions
Q1. What Is Normalization?
Normalization is the technique of minimizing redundancy and dependency by way of organizing fields and desk of a database. The important purpose of Normalization is to feature, delete or modify discipline that can be made in a unmarried table.
Q2. How To Find Second Highest Salary Of An Employee?
There are many methods to discover second highest revenue of Employees in SQ. You can either use SQL Join or Subquery to resolve this trouble.
Here is SQL query using Subquery :
Select MAX(Salary) from table1 WHERE Salary NOT IN ( pick MAX(Salary)
from table1.
Q3. What Is Self-be a part of?
Self-be a part of is set to be question used to evaluate to itself. This is used to compare values in a column with other values within the identical column within the same table. ALIAS ES may be used for the same desk comparison.
Q4. What Is Sql Profiler?
Microsoft SQL Server Profiler is a graphical person interface to SQL Trace for monitoring an example of the Database Engine or Analysis Services. You can seize and save statistics approximately each occasion to a document or desk to research later.
Use SQL Profiler to reveal simplest the activities in that you are interested.
If strains have become too large, you may clear out them primarily based at the statistics you want, so that only a subset of the occasion information is accumulated. Monitoring too many occasions adds overhead to the server and the monitoring method and might reason the hint record or trace table to grow very huge, especially when the monitoring process takes vicinity over a long time frame.
Q5. What Is The Difference Between Truncate And Drop Statements?
TRUNCATE gets rid of all the rows from the table, and it can not be rolled back. DROP command eliminates a table from the database and operation can not be rolled back.
Q6. What Is A Foreign Key?
A foreign key's one table which can be related to the primary key of some other desk. Relationship wishes to be created between two tables through referencing foreign key with the number one key of another desk.
Q7. What Are Aggregate And Scalar Functions?
Aggregate capabilities are used to assess mathematical calculation and return single values. This may be calculated from the columns in a desk. Scalar features go back a single cost primarily based on the input cost.
Example -.
Aggregate – max(), be counted – Calculated with recognize to numeric.
Scalar – UCASE(), NOW() – Calculated with appreciate to strings.
Q8. Which Operator Is Used In Query For Pattern Matching?
LIKE operator is used for sample matching, and it may be used as -.
% – Matches 0 or more characters.
_(Underscore) – Matching precisely one character.

