Friday, 5 July 2019

Question SET 1


  1. Relation between JQuery and Javascript?
  2. Difference between Abstract Class and Interface?
  3. While updating a table you get an error. How you will roll back the changes?
  4. There are 4 records in a table with your name. There is no primary key. How can you delete two records out of 4 records?
  5. What are indexes. What are different types of indexes present in MS sql server. 
  6. Difference between string and string builder.
  7. What does immutable mean in string builder?
  8. What are delegates? 
  9. Delegates are value type or reference type? - Reference type
  10. Difference between User defined function and Procedures. 
  11. Where all you use 4 pillars of OOPS concept. Give examples.
  12. Difference between session and Cache.
  13. Difference between creating an object and Inherting a class. 
====
  1. Javascript is a language while Jquery is a library build on top of Javascript. JQuery help to complete common task that can be done by Javascript in easy way. It is basically used to reduce the amount of work required to create web based application. 
  2. Abstract Class
    Interface
    It can contain both abstract methods and non abstract methods. Methods of abstract class implement default behavior.
    Interface contains only abstract method and methods cannot have implementation.
    Multiple inheritance cannot be achieved.
    Multiple inheritances can be achieved by Interface.
    It can contain all types of modifiers like private
    It can contain only public modifier
    Performance is fast.
    Performance is slow because it time to find the actual method in corresponding class.
  3. We can use transaction to roll back changes. 
    BEGIN TRAN
    BEGIN TRY
      update tbl set City='chennai',LastName='vinoth' from aa AS tbl;

      -- if update is what you want then
      COMMIT TRAN
    END TRY
    BEGIN CATCH
      -- if NOT then
      IF @@TRANCOUNT > 0
          ROLLBACK
      THROW
    END CATCH

  4. One option that SQL Server gives you is the ability to set ROWCOUNT
  5. SELECT * FROM dbo.duplicateTest 
     
    SET ROWCOUNT 1 
    DELETE FROM dbo.duplicateTest WHERE ID = 1 
    SET ROWCOUNT 0 
     
    SELECT * FROM dbo.duplicateTest 
    DELETE TOP(1) FROM dbo.duplicateTest WHERE ID = 1 
    >> We can delete using  RowNumber, Rank with CTE also.

No comments:

Post a Comment