SQL Interview Questions -Set3

Lets explore more on SQL interview questions.

Keep sharing and Keep learning.

Do follow us for more updates on  Fb,G+,Twitter.

SQL interview Questions

  1. Why we use Triggers in SQL? Explain with real time example.
  2. Can we use pre triggers in SQL?
  3. We have Table A AS 10 MB space and Table B as 10 MB space, what would be the size of View created by joining both the tables.
  4. How to improve performance in SQL query execution.
  5. Is view called a physical object?
  6. How many rows would be shown in the result for query Select * from Table A , Table B.
    Where Table A have 10 rows and Table B have 20 rows
  7. Column Bool in Table A, have values 1,0,1,1,0,1,0,1
    write a query to replace all 0 with 5 and all ‘1’ with 10
    Hint:-Update Table A SET Bool = CASE when Bool > 0 THEN 10 ELSE 5 END
  8. Table A , have column named First_Name, write a query to concatenate “LongName” at the end incase name is more than 10 alphabets long.
    Hint:-select len(FIRST_NAME) from employee
  9. Advantages of using SP(Stored procedures)?
    Hint:-
    Stored procedure can reduced network traffic and latency, boosting application performance.
    Stored procedure execution plans can be reused, staying cached in SQL Server’s memory, reducing server overhead.
    Stored procedures help promote code reuse.
    Stored procedures can encapsulate logic. You can change stored procedure code without affecting clients.
    Stored procedures provide better security to your data.
  10. What is a cursor and why would you use it?
  11. How do you auto number rows in SQL Server?
    Using Identity Column