Quiz Me SQL

44 Questions | Total Attempts: 721

SettingsSettingsSettings
SQL Quizzes & Trivia

Questions regarding sql server 2005. Mainly from stored procedures, triggers and indexes.


Questions and Answers
  • 1. 
    Which of the following statemens are true?
    • A. 

      Procedures and functions must return values

    • B. 

      Procedures and functions may return value

    • C. 

      Procedures may return values

    • D. 

      Functions must return values

  • 2. 
    The Stored Procedure   - 2 true choices.
    • A. 

      Is a set of pre-compiled T-SQL statements executed as a single unit.

    • B. 

      Is a set of T-SQL that are executed as a single block of code that performs a specific task.

    • C. 

      Is used in database Administrative and information activities.

    • D. 

      Can be created to carry out repetitive

  • 3. 
    Advantages of The Store Procedures are:
    • A. 

      Reduced client/server traffic

    • B. 

      Reuse of code.

    • C. 

      Implicit invockation

  • 4. 
    The Stored procedures  are created for temporary use with a session are called...- 1 true choice.
    • A. 

      Local Temporary Procedures

    • B. 

      Temporary Stored Procedures

    • C. 

      Remote Stored Procedures

    • D. 

      Global Temporary Procedures

  • 5. 
    The..............are used to perform tasks that are unable to be perform using standard T-SQL statement.- 1 true choice
    • A. 

      Extended or CLR Stored Procedures

    • B. 

      T-SQL Stored Procedures

    • C. 

      Local stored Procedures

  • 6. 
    The................are not residents of SQL server. they are implemented as Dynamic Link Libraries(DLL) executed outsite the SQL Sever Environment.- 1 true choice.
    • A. 

      Remote Stored Procedures

    • B. 

      CLR Stored Procedures

    • C. 

      Custom Stored Procedures

  • 7. 
    The ...................are created in individual user databases.And  can not be accessed by any user other than the one who has created it.- 1 true choice
    • A. 

      Local stored Procedures

    • B. 

      Temporary Stored Procedures

    • C. 

      Extended Stored Procedures

  • 8. 
    The Local Temporary Procedures are............- 2 true choices
    • A. 

      Visible only to the user that create them.

    • B. 

      Use # prefix before the procedure name

    • C. 

      Visible for all users

    • D. 

      Use ##

    • E. 

      Can be used any user

  • 9. 
    The Global Temporary Procedures  ....- 3 true choices
    • A. 

      Are dropped at the end of the last session

    • B. 

      Can be used any user

    • C. 

      Are visible for all users

    • D. 

      Can only be used by its owner

    • E. 

      Are dropped at the end of the current session

  • 10. 
    OBJECT_DEFINITION() - 2 choices
    • A. 

      System stored procedure use to display the dependencies of a stored procedure

    • B. 

      System function used to display the definition of a stored procedure

    • C. 

      System view used to display definition of a stored procedure

    • D. 

      System function used to display the definition of a stored procedure by specifying the object ID of the procedure

  • 11. 
    Using "OUTPUT" clause.- 2 true choice
    • A. 

      Return information from each row on which the INSERT, UPDATE, and DELETE have been executed

    • B. 

      Useful to retrieve the value of an identity or computed column after an INSERT or UPDATE operation

    • C. 

      Print out a Variable

    • D. 

      Create stored procedures for performance of various tasks, they are referred to as user-defined or custom stored procedures

  • 12. 
    When a local temporary table is created inside a stored procedures, the table disappears when the procedure is exited.
    • A. 

      True

    • B. 

      False

  • 13. 
    System stored procedure used to display the definition of a stored procedure?
    • A. 

      Object_definition()

    • B. 

      Sp_helptext

    • C. 

      Sp_depends

    • D. 

      Sp_display

  • 14. 
    A Stored Procedure can reference tables,views, user-define functions and other
    • A. 

      True

    • B. 

      False

  • 15. 
    The permission associated with the stored procedure are not lost when a store procedure is re-created. And when a stored procedure is altered, the permissions defined for the stored procedure remain the same even though the procedure definetion is changed
    • A. 

      True

    • B. 

      False

  • 16. 
    Everyone can  modify or rename all procedure
    • A. 

      True

    • B. 

      False

  • 17. 
    Stored procedures can be dropped if they are no longer needed. if another stored procedure calls a deleted procedure,- 1 choice.
    • A. 

      A replaced procedure is dipslay.

    • B. 

      An error message is display

    • C. 

      No procedure display

    • D. 

      B and C

  • 18. 
    Before dropping a procedure, execute the .......................... system stored procedure to determine which objects depend on the procedure- 1 choice
    • A. 

      Sp_depends

    • B. 

      Sp_help

    • C. 

      Sp_helptext

  • 19. 
    The RETURN statement passes control back to the calling program. any T-SQL statements following the RETURN statement are  executed.
    • A. 

      True

    • B. 

      False

  • 20. 
    If a new procedure is created using the same name as well as the same parameters as the drop procedure,all calls to the dropped procedure will be - 1 choice
    • A. 

      Denied immediately

    • B. 

      Executed sucessfully

    • C. 

      Had some error messages

    • D. 

      No Action

  • 21. 
    If a stored  procedure is executed sucessfully, It returns ...........by defaul. If errors are encountered and the procedure is not successfully executed, ...............interger value is returned.- 1 choice
    • A. 

      A values zero...................a non-zero

    • B. 

      A non-zero .................a zero

    • C. 

      A non-zero ........... a greater than zero

  • 22. 
    .....................are defined at the time of creation of procedure.- 2 choice
    • A. 

      Input parameters

    • B. 

      Output parameters

    • C. 

      Name of stored procedure

    • D. 

      Nothing

  • 23. 
    Which statement is true?
    • A. 

      If the OUTPUT key word is omitted, the procedure is still exceuted

    • B. 

      If the OUTPUT key word is omitted, the procedure is still exceuted but does not return a value

    • C. 

      If the OUTPUT key word is omitted, the procedure is not exceuted but is not return a value

    • D. 

      If the OUTPUT key word is omitted, the procedure is still exceuted and return a value

  • 24. 
    Which statement is true?- 1 choice
    • A. 

      When the RETURN statement is used in a stored procedure, It can return a null value. if a procedure tries to return a null value, a warning message is generated and the value zero is returned.

    • B. 

      When the RETURN statement is used in a stored procedure, It can not return a null value. if a procedure tries to return a null value, a warning message is generated and the value zero is returned

    • C. 

      When the RETURN statement is used in a stored procedure, It can not return a null value. if a procedure tries to return a null value, a warning message is generated and the value one is returned

    • D. 

      A and C

  • 25. 
    Displays the default error message for an error.-1 choice.
    • A. 

      MESSAGE_ERROR()

    • B. 

      ERROR_MESSAGE()

    • C. 

      @@ERROR

    • D. 

      @@ERROR_LINE

Related Topics
Back to Top Back to top