1.
The Stored Procedure - 2 true choices.
Correct Answer(s)
B. Is a set of T-SQL that are executed as a single block of code that performs a specific task.
D. Can be created to carry out repetitive
Explanation
A stored procedure is a set of T-SQL statements that are executed as a single block of code that performs a specific task. It is commonly used in database administration and information activities. Additionally, stored procedures can be created to carry out repetitive tasks efficiently.
2.
All information about tables in user Database is stored in a set of tables called the System catalog.that can be accessed using........- 1 true choice.
Correct Answer
B. Catalog Stored Procedures
Explanation
The System catalog is a set of tables that stores information about tables in the user Database. Catalog Stored Procedures are used to access this System catalog. Therefore, the correct answer is Catalog Stored Procedures.
3.
The Stored procedures use to manage the security of the database. They are:-1 true choice.
Correct Answer
C. Sercurity Stored Procedures
Explanation
Security stored procedures are used to manage the security of the database. These procedures help in controlling access to the database, managing user permissions, and enforcing security policies. They can be used to create and manage user accounts, grant or revoke privileges, and implement security measures such as encryption and authentication. By using security stored procedures, administrators can ensure that only authorized users have access to the database and that sensitive data is protected.
4.
Where are Catalog Stored Procedures ?-2 true choices
Correct Answer(s)
A. Sp_column
D. Sp_database and sp_statistics
Explanation
The correct answer is A and C, which means that the catalog stored procedures can be found in sp_column, sp_database, and sp_statistics. These stored procedures are used for various purposes related to managing and querying database catalogs. They provide functionality such as retrieving information about columns, databases, and statistics, which are essential for database administrators and developers.
5.
The ........is used to change the owner of the current database.-1 true choice.
Correct Answer
B. Sp_changedbowner
Explanation
The correct answer is "sp_changedbowner". This stored procedure is used to change the owner of the current database. It allows the user to specify a new owner for the database, which can be useful in situations where ownership needs to be transferred or updated.
6.
The Cursor Stored Procedures are.........- 2 true choices.
Correct Answer(s)
A. sp_describe_column
D. Sp_cursor_list
Explanation
The correct answer is "sp_describe_column" and "sp_cursor_list". These are both stored procedures that are used in cursor operations. "sp_describe_column" is used to retrieve information about the columns in a specified table or view, while "sp_cursor_list" is used to retrieve information about the open cursors on a specified server. Both of these stored procedures are commonly used in cursor operations to gather information about the columns and cursors being used.
7.
Database Mail and SQL mail stored Procedures.- 1 true choice.
Correct Answer
A. Used to pefrom email operations from with in the SQL server.
Explanation
The correct answer is "Used to perform email operations from within the SQL server." Database Mail and SQL Mail Stored Procedures are used to send emails directly from the SQL server. This functionality allows users to send notifications, alerts, or reports via email without the need for external applications or tools. It simplifies the process of integrating email functionality into SQL server applications and automates the sending of emails based on certain conditions or triggers within the database.
8.
Advantages of The Store Procedures are:
Correct Answer(s)
A. Reduced client/server traffic
C. Reuse of code.
Explanation
The advantages of stored procedures include reduced client/server traffic and reuse of code. By executing stored procedures on the server side, the amount of data transmitted between the client and server is minimized, resulting in reduced network traffic. Additionally, stored procedures allow for the reuse of code, as they can be created to carry out repetitive tasks, eliminating the need to rewrite the same code multiple times.
9.
Which are not System Stored Procedures?-2 true choices.
Correct Answer(s)
B. Extended Stored Procedures
C. Temporary Stored Procedures
Explanation
Extended Stored Procedures and Temporary Stored Procedures are not System Stored Procedures. System Stored Procedures are pre-defined stored procedures that are included with the SQL Server software and are used for various administrative tasks. Extended Stored Procedures are custom procedures that are created by users and are used to extend the functionality of SQL Server. Temporary Stored Procedures are created and used within a specific session or connection and are automatically dropped when the session or connection is closed.
10.
The................are not residents of SQL server. they are implemented as Dynamic Link Libraries(DLL) executed outsite the SQL Sever Environment.- 1 true choice.
Correct Answer
C. Extended Stored Procedures.
Explanation
Extended Stored Procedures are not residents of SQL server. They are implemented as Dynamic Link Libraries (DLL) executed outside the SQL Server environment.
11.
The Stored procedures are created for temporary use with a session are called...- 1 true choice.
Correct Answer
D. Temporary Stored Procedures
Explanation
Temporary stored procedures are created for temporary use within a session. They are not permanently stored in the database and are only available for the duration of the session. These procedures can be used to perform specific tasks or calculations within a session and are useful when there is a need for temporary logic or data manipulation. Unlike customer stored procedures, temporary stored procedures are not meant to be reused or accessed by other sessions or users.
12.
The..............are used to perform tasks that are unable to be perform using standard T-SQL statement.- 1 true choice
Correct Answer
A. Extended Stored Procedures.
Explanation
Extended Stored Procedures are used to perform tasks that are unable to be performed using standard T-SQL statements. T-SQL Stored Procedures and Local Stored Procedures are both types of stored procedures that can be executed within the database, but they do not provide the same level of functionality as Extended Stored Procedures. Extended Stored Procedures allow for the execution of external programs or scripts from within the database, providing additional capabilities beyond what can be achieved with standard T-SQL statements. Therefore, the correct answer is Extended Stored Procedures.
13.
The ...................are created individual user databases.And can not be accessed by any user other than the one who has created it.- 1 true choice
Correct Answer
C. Local stored Procedures
Explanation
Local stored procedures are created individual user databases and can not be accessed by any user other than the one who has created it. This means that these stored procedures are specific to a particular user and cannot be accessed or modified by other users in the database. They provide a level of security and privacy for the user who created them.
14.
The Global Tem Procedures ....- 3 true choices
Correct Answer(s)
A. Are dropped at the end of the last session.
D. Can be used any user
E. Are visible for all users
Explanation
The correct answer choices are "are dropped at the end of the last session," "can be used any user," and "are visible for all users." This suggests that the Global Tem Procedures are not retained after the current session ends, they can be used by any user, and they are visible to all users.
15.
Temporary Stored Procedures include:- 2 true choices
Correct Answer(s)
A. Local Temporary Procedures
B. Global Temporary Procedures
Explanation
Temporary stored procedures are procedures that are created and stored in the temporary database of a database management system. They are used for a specific session or connection and are automatically deleted when the session or connection ends. Local temporary procedures are created within a specific session and can only be accessed by that session. Global temporary procedures are created within a specific database and can be accessed by multiple sessions. Therefore, the correct answer is Local Temporary Procedures and Global Temporary Procedures.
16.
The...............create stored procedures for performance of various tasks, they are referred to as user-defined or custom stored procedures and can be set to override the default system procedures.- 1 true choice.
Correct Answer
B. Customer Stored Procedures
Explanation
Customer stored procedures are created by users to perform specific tasks and can override the default system procedures. These procedures are customized and tailored to meet the specific needs of the user. Extended stored procedures, T-SQL stored procedures, and system stored procedures are not specifically mentioned in the question and do not match the given explanation. Therefore, the correct answer is customer stored procedures.
17.
EXECUTE xp_fileexists 'C:\sample.txt' - 1 true choice.
Correct Answer
B. Check file sample.txt exists or not
Explanation
The correct answer is "check file sample.txt exists or not". This is because the given SQL statement "EXECUTE xp_fileexists 'C:\sample.txt'" is used to check whether the file "sample.txt" exists or not at the specified path "C:\sample.txt". Therefore, the correct answer accurately describes the purpose of the SQL statement.
18.
Using "OUTPUT" clause.- 2 true choice
Correct Answer(s)
A. Return information from each row on which the INSERT, UPDATE, and DELETE have been executed.
C. Useful to retrieve the value of an identity or computed column after an INSERT or UPDATE operation
Explanation
The correct answer is "Return information from each row on which the INSERT, UPDATE, and DELETE have been executed" and "Useful to retrieve the value of an identity or computed column after an INSERT or UPDATE operation". The OUTPUT clause in SQL is used to return information from each row that has been affected by an INSERT, UPDATE, or DELETE statement. It can be used to retrieve the value of an identity or computed column after an INSERT or UPDATE operation.
19.
A Stored Procedure can reference tables,views, user-define functions and other
Correct Answer
A. True
Explanation
A stored procedure is a set of SQL statements that are stored in the database and can be executed as a single unit. It can reference tables, views, user-defined functions, and other database objects to perform complex operations or calculations. This allows for better organization and reusability of code, as well as improved performance since the database can optimize the execution of the stored procedure. Therefore, the statement "A Stored Procedure can reference tables, views, user-define functions and other" is true.
20.
When a local temporary table is created inside a stored procedures, the table disappears when the procedure is exited.
Correct Answer
B. True
Explanation
When a local temporary table is created inside a stored procedure, it is only accessible within that specific procedure. Once the procedure is exited, the temporary table is automatically dropped and no longer exists. This is because local temporary tables are tied to the scope of the procedure and are meant to be used for temporary storage within that particular execution context.
21.
System stored procedure used to display the definition of a stored procedure?-1 true choice.
Correct Answer
B. Sp_helptext
Explanation
The correct answer is sp_helptext. The sp_helptext system stored procedure is used to display the definition of a stored procedure in SQL Server. It takes the name of the stored procedure as a parameter and returns the text of the stored procedure's definition. This can be useful for viewing the code of a stored procedure and understanding its functionality.
22.
OBJECT_DEFINITION() - 2 choices
Correct Answer(s)
B. System function used to display the 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.
Explanation
The correct answer is A and D. OBJECT_DEFINITION() is a system function used to display the definition of a stored procedure. It can be used without specifying the object ID to display the definition of the current stored procedure, or it can be used with the object ID to display the definition of a specific stored procedure. Therefore, both options A and D are correct explanations for the given answer.
23.
Everyone can modify or rename all procedure.
Correct Answer
B. False
Explanation
The statement suggests that everyone has the ability to modify or rename all procedures. However, the correct answer is false, indicating that not everyone has this capability. This implies that there are restrictions or limitations in place regarding the modification or renaming of procedures, possibly due to security or organizational policies.
24.
Stored procedures can be dropped if they are no longer needed. if another stored procedure calls a deleted procedure,- 1 choice.
Correct Answer
B. An error message is display.
Explanation
If a stored procedure is dropped and another stored procedure calls the deleted procedure, an error message will be displayed. This is because the calling procedure is unable to find the deleted procedure and cannot execute it. Therefore, attempting to call a deleted procedure will result in an error being displayed.
25.
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
Correct Answer
B. Executed sucessfully
Explanation
If a new procedure is created using the same name as well as the same parameters as the dropped procedure, all calls to the dropped procedure will be executed successfully. This means that the new procedure will be able to handle the calls that were previously made to the dropped procedure without any issues or errors.
26.
Before dropping a procedure, execute the .......................... system stored procedure to determine which objects depend on the procedure- 1 choice
Correct Answer
B. Sp_depends
Explanation
To determine which objects depend on a procedure before dropping it, the correct system stored procedure to execute is sp_depends. This procedure will provide a list of all the objects that depend on the specified procedure, allowing the user to assess the potential impact of dropping it. The other options listed, sys.sql_modules, sp_helptext, and sp_check, are not specifically designed for this purpose.
27.
When a stored procedure is created using options, these options should be included in the ALTER PROCEDURE statement to retain their function.
Correct Answer
B. True
Explanation
When a stored procedure is created with options, these options need to be included in the ALTER PROCEDURE statement in order to maintain their functionality. This means that if any changes need to be made to the stored procedure, the options should be included in the ALTER PROCEDURE statement to ensure that the procedure still operates as intended. Therefore, the statement "True" is correct.
28.
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
Correct Answer
D. A values zero...................a non-zero
Explanation
When a stored procedure is executed successfully, it returns a value of zero by default. However, if errors are encountered and the procedure is not successfully executed, a non-zero integer value is returned. In this case, the correct answer states that a value of zero is returned when the stored procedure is executed successfully, and a non-zero value is returned when the procedure encounters errors and is not successfully executed.
29.
The RETURN statement passes control back to the calling program. any T-SQL statements following the RETURN statement are executed.
Correct Answer
B. False
Explanation
The explanation for the given correct answer is that the RETURN statement in T-SQL does not execute any statements following it. Once the RETURN statement is encountered, it immediately passes control back to the calling program or stored procedure, and any statements after the RETURN statement are not executed. Therefore, the statement "any T-SQL statements following the RETURN statement are executed" is incorrect.
30.
Which statement is true?- 1 choice
Correct Answer
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.
Explanation
The correct answer is that when the RETURN statement is used in a stored procedure, it cannot return a null value. If a procedure tries to return a null value, a warning message is generated and the value zero is returned.
31.
.....................are defined at the time of creation of procedure.- 2 choice
Correct Answer(s)
A. Input parameters
B. Output parameters
Explanation
Input parameters and output parameters are defined at the time of creation of a procedure. These parameters allow the procedure to receive input values and return output values when it is executed. Input parameters are used to pass values into the procedure, while output parameters are used to return values from the procedure. By defining these parameters, the procedure can be customized and made more flexible, as it can accept different inputs and produce different outputs based on the values passed to it. The other options, "A and B" and "Name of stored procedure", are not directly related to the parameters of a procedure.
32.
Displays the default error message for an error.-1 choice.
Correct Answer
C. ERROR_MESSAGE()
Explanation
The correct answer is ERROR_MESSAGE(). This function is used to display the default error message for an error. It returns the error message text as a result. The other options, MESSAGE_ERROR(), RETURN_ERROR(), @@ERROR, and @@ERROR_LINE, do not specifically display the default error message for an error.
33.
Specifies an integer value to be returned though the stored procedure.- 1 choice
Correct Answer
C. RETURN
Explanation
The correct answer is RETURN. In stored procedures, the RETURN statement is used to specify an integer value that will be returned. This value can be used to indicate the success or failure of the stored procedure or to return any other relevant information. The RETURN statement is commonly used in programming languages and databases to control the flow of execution and return values from functions or procedures.
34.
Which are true?- 3 choice
Correct Answer(s)
A. @@ERROR_LINE : Returns the line number that caused the error
B. @@ERROR : Returns the error number for the error in the last T_SQL statment.
E. The return code indicates the execution status of the stored procedure.
Explanation
The correct answer is @@ERROR_LINE : Returns the line number that caused the error, @@ERROR : Returns the error number for the error in the last T_SQL statement, and The return code indicates the execution status of the stored procedure. These options are true because @@ERROR_LINE returns the line number that caused the error, @@ERROR returns the error number for the error in the last T_SQL statement, and the return code indicates the execution status of the stored procedure.
35.
The OUTPUT keyword specifies that the variables are involved in passing values from the called procedure to the callling program.
Correct Answer
A. True
Explanation
The OUTPUT keyword is used to indicate that the variables in a called procedure will be used to pass values back to the calling program. This means that any changes made to the variables within the called procedure will be reflected in the calling program after the procedure is executed. Therefore, the statement "The OUTPUT keyword specifies that the variables are involved in passing values from the called procedure to the calling program" is true.
36.
Which statement is not True?- 2 choice
Correct Answer(s)
B. When an error occurs in the TRY block, the statements following the statement that caused the error are executed only after CATCH block is executed.
C. When the @@ERROR funtion is called, an error message is returned for the error occuring in the last executed statement.
Explanation
The given correct answer states that the statements following the statement that caused the error in the TRY block are executed only after the CATCH block is executed. However, this statement is not true. In reality, when an error occurs in the TRY block, the statements following the statement that caused the error are not executed. The control is immediately transferred to the CATCH block. Additionally, the answer also states that the @@ERROR function returns an error message for the error occurring in the last executed statement, which is also not true. The @@ERROR function returns the error number, not the error message.
37.
Which statements are true?- 3 choices
Correct Answer(s)
A. Trigger can not be executed directly nor do they pass or receive parameters.
C. Trigger is a stored procedure that executed when data in a specified table is modified.
E. Trigger are often created to enforce referential integrity among logically related data in different table.
Explanation
The first statement is true because triggers cannot be executed directly and they do not pass or receive parameters.
The second statement is true because a trigger is executed when data in a specified table is modified.
The fifth statement is true because triggers are often created to enforce referential integrity among logically related data in different tables.
However, the fourth statement is false because a trigger is not the same as a check constraint.
38.
DML Trigger is executed when ....- 1 choice
Correct Answer
B. Data is inserted,modified or delete in a table or a View using the INSERT,UPDATE or DELETE statements
Explanation
DML triggers are executed when data is inserted, modified, or deleted in a table or a view using the INSERT, UPDATE, or DELETE statements. This means that whenever any of these statements are used to make changes to the data in a table or view, the DML trigger associated with that table or view will be triggered and its code will be executed.
39.
The DDL Triggers....
Correct Answer(s)
A. Are used to check and control database operations.
E. Operate only after the table or view is modified.and are defined either at the database or the server level
Explanation
DDL triggers are used to check and control database operations, operating only after the table or view is modified. These triggers can be defined either at the database or the server level. They are not specifically used to enforce business rules when data is modified, as that is the role of DML triggers.
40.
Which statements are true?- 2 choices
Correct Answer(s)
C. A table can have multiple AFTER trigger defined for each INSERT, UPDATE, and DELETE operation.
E. The Trigger is executed after the inserted and Deleted tables are created.
Explanation
This answer is correct because it accurately states that a table can have multiple AFTER triggers defined for each INSERT, UPDATE, and DELETE operation. It also correctly states that the trigger is executed after the inserted and deleted tables are created.
41.
INSTEAD OF Triggers.- 2 choices
Correct Answer(s)
A. Is executed in place of the INSERT, UPDATE or DELETE operation.
D. Are executed before constraint checks are performed on the table.and They executed after creating Inserted and Deleted tables,
Explanation
INSTEAD OF triggers are executed in place of the INSERT, UPDATE, or DELETE operation. They allow the user to define custom actions to be performed instead of the default database operations. These triggers can be created on tables but not on views. They are executed before constraint checks are performed on the table and after creating the Inserted and Deleted tables, which are used to access the data being modified.
42.
Which statement is true?
Correct Answer
B. Delete trigger do not use the Inserted table to delete records from atable
Explanation
This statement is true because delete triggers do not use the Inserted table to delete records from a table. The Inserted table is used in delete triggers to capture the rows that are being deleted, while the Deleted table is used in update triggers to capture the rows that are being updated. Therefore, the correct answer is that delete triggers do not use the Inserted table.
43.
Where are true?
Correct Answer(s)
A. Each triggering action can have multiple AFTER triggers
C. Trigger definition can be viewed if the information is not encrypted
D. DML trigger definition can be modified by dropping and creating the trigger.
Explanation
The given correct answer includes three statements that are true. First, each triggering action can have multiple AFTER triggers, meaning that multiple triggers can be executed after a specific action occurs on a table. Second, the trigger definition can be viewed if the information is not encrypted, allowing users to see the details of how a trigger is defined. Third, the DML (Data Manipulation Language) trigger definition can be modified by dropping and creating the trigger, providing the ability to make changes to the trigger's functionality.
44.
DDL Triggers are...
Correct Answer(s)
B. DROP Trigger
E. CREATE and ALTER Trigger
Explanation
DDL triggers are special types of triggers in a database management system that are fired in response to specific Data Definition Language (DDL) statements. These triggers are used to perform actions before or after certain DDL statements are executed.
The given correct answer includes DROP Trigger, CREATE and ALTER Trigger. This means that DDL triggers can be created or altered using the CREATE and ALTER statements, and they can also be dropped or deleted using the DROP statement. These actions allow for the management and customization of DDL triggers in a database system.
45.
Which statements are false?
Correct Answer(s)
A. DDL trigger for DROP operation can be created as an INSTEAD OF trigger.
C. A DDL trigger definition can be display using as_helptext.
Explanation
The statement "DDL trigger for DROP operation can be created as an INSTEAD OF trigger" is false. INSTEAD OF triggers are used for DML operations (INSERT, UPDATE, DELETE), not for DDL operations like DROP.
The statement "a DDL trigger definition can be displayed using as_helptext" is also false. The correct syntax to display the definition of a DDL trigger is sp_helptext, not as_helptext.
46.
Indexes are used for faster retrieval of data.and improve the speed of query when accessing data a database.
Correct Answer
A. True
Explanation
Indexes are indeed used for faster retrieval of data and to improve the speed of queries when accessing data in a database. By creating indexes on specific columns, the database can organize and sort the data in a way that allows for quicker searching and retrieval. Without indexes, the database would have to scan through the entire table to find the requested data, which can be time-consuming and inefficient. Therefore, using indexes can greatly enhance the performance and efficiency of database operations.
47.
...............index stores data in a sorted manner.
Correct Answer
B. Clustered
Explanation
A clustered index stores data in a sorted manner based on the values of the indexed column(s). This means that the physical order of the data in the table corresponds to the order of the clustered index. This can improve the performance of queries that involve range scans or ordered retrieval of data. In contrast, a nonclustered index does not dictate the physical order of the data and is stored separately from the table. Unique indexes ensure that the indexed column(s) contain unique values, but they do not necessarily store data in a sorted manner.
48.
A table can have only one Clustered index and 249 nonclustered indexs.
Correct Answer
A. True
Explanation
A table can have only one clustered index because the clustered index determines the physical order of the data in the table. It defines the way the data is stored on disk, so there can only be one clustered index. On the other hand, a table can have multiple nonclustered indexes, up to a maximum of 249, which are separate structures that provide an alternate way to access the data in the table without changing the physical order. Therefore, the statement is true.
49.
A ..............can be defined on a column with no duplicate values.
Correct Answer
B. Unique Index
Explanation
A unique index is a type of index that can be defined on a column with no duplicate values. This means that each value in the column must be unique and cannot be repeated. The purpose of a unique index is to enforce uniqueness in a column, ensuring that no two rows in the table have the same value for the indexed column. This can be useful in scenarios where data integrity and uniqueness are important, such as when dealing with primary keys or unique identifiers.
50.
A ...........is created on 2 or more columns. Both clustered index and nonclustered index can be ............
Correct Answer
A. Composite Index
Explanation
A composite index is created on 2 or more columns. Both clustered index and nonclustered index can be composite indexes.