Before Applying job posting in any websites or recruiting agencies or sending resumes to job recruiters or any other employment website you need to improve your skills on general knowledge, Aptitude, Puzzles, logical reasoning, general english, database, programming as per your job profile. Job recruiters or mostly preferring job candidates who are having more stuff in those categories mentioned above. So improving more skills on your job profile always boost up your career and your performance. Even hiring companies and job recruiters who are looking for many job posting websites actually they are looking and filtering on these activities. In these Sql Server section you need to update more questions to perform well in front of job recruiters and companies. Sql Server Interview questions are most important to score in interview, Update all questions to score well in all rounds in job interview.

Sql Server interview questions and answers

21)
what is LEFT OUTER JOIN ?

Left join will display all records in left table of the SQL statement. In SQL below customers with or without orders will be displayed. Order data for customers without orders appears as NULL values. For example, you want to determine the amount ordered by each customer and you need to see who has not ordered anything as well. You can also see the LEFT OUTER JOIN as a mirror image of the RIGHT OUTER JOIN (Is covered in the next section)if you switch the side of each table

CODE
SELECT Customers.*, Orders.* FROM Customers LEFT OUTER JOIN ON Customer, CustomerID = Orders. CustomerID

22)
What is RIGHT OUTER JOIN ?

Right join will display all records in right table of the SQL statement . In SQL below all orders with or without matching customer records will be displayed. Customer data for orders without customers appears as NULL values . For example, you want to determine if there are any orders in the data with undefined CustomerID values (say, after a conversion or something like it). You can also see the RIGHT OUTER JOIN as a mirror image of the LEFT OUTER JOIN if you switch the side of each table.

CODE
SELECT Customers.*, Orders.* FROM Customers RIGHT OUTER JOIN Orders ON Customers. CustomerID = Orders.CustomerID

23)
How can you increase SQL performance?

Following are tips which will increase your SQl performance:

  • Every index increasesthe time takes to perform INSERTS, UPDATES, and DELETES, so the number of indexes should not be too much. Try to use maximum 4-5 indexes on one table , not more .If you have read-only table, then the number of indexes may be increased.
  • Keep your indexes as narrow as possible . This reduces the size of the index and reduces the number of reads required to read the index.
  • Try to create indexes on columns that have integer values rather than character values.
  • If you create a composite (multi-column) index, the orders of the columns in the key are very important . try to order the columns in the key as to enhance selectivity, with the most selective columns to the leftmost of the key.
  • If you want to join several tables, try to create surrogate integer keys for this purpose and create indexes on their columns.
  • Create surrogate integer primary key (identity for example ) if your table will not have many insert operations
  • Clustered indexes are more preferable than nonclustered, if you need to select by a range of values or you need to sort results set with GROUP BY of ORDER BY .
  • If your application will be performing the same query over and over on the same table, consider creating a covering index on the table
  • You can use the SQL Server Profiler Create Trace Wizard with “Identify Scans of Large Tables” trace to determine which tables in your database may need indexes. This trace will show which tables are being scanned by queries instead of using an index.
24)
Explain READ COMMITTED levels in SQL Server ?

The shared lock is held for the duration of the transaction, meaning that no other transactions can change the data at the same time. Other transactions can insert and modify data in the same table, however, as long as it is not locked by the first transaction.

25)
READ UNCOMMITTED levels in SQL Server ?

No shared locks and no exclusive locks are honored . This is the least restrictive isolation level resulting in the best concurrency but the least data integrity.