Sql Interview Question and Answers

111. What are cursors?
  Cursors allow row-by-row prcessing of the result sets.
 
Your Name Your Email-ID
Your Answer
112. What is a weak entity types?
  The entity types that do not have key attributes of their own are called weak entity types. Rests are called strong entity types .The entity that gives identity to a weak entity is called owner entity. And the relationship is called identifying relationship. A weak entity type always has a total participation constraint with respect to its identifying relationship.
 
Your Name Your Email-ID
Your Answer
113. What are defaults?
  A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can’t have defaults bound to them.
 
Your Name Your Email-ID
Your Answer
114. What is specialization?
  It is the process of defining a set of subclasses of an entity type where each subclass contain all the attributes and relationships of the parent entity and may have additional attributes and relationships which are specific to itself.
 
Your Name Your Email-ID
Your Answer
115. What is the difference between Function and Stored Procedure?
 
  • UDF can be used in the SQL statements anywhere in the WHERE / HAVING / SELECT section where as Stored procedures cannot be.
  • UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
  • Inline UDF’s can be though of as views that take parameters and can be used in JOINs and other Rowset operations.
 
Your Name Your Email-ID
Your Answer