Sort Quiz Over SQL And T-SQL

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Nbans
N
Nbans
Community Contributor
Quizzes Created: 4 | Total Attempts: 7,253
| Attempts: 302 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Is it possible to Enable or Disable a Database trigger ?

Explanation

It is possible to enable or disable a database trigger. A trigger is a stored procedure that automatically executes when a specific event occurs in the database. By enabling or disabling a trigger, we can control whether it will execute or not when the associated event occurs. This allows us to temporarily disable a trigger without deleting it from the database, and later enable it again when needed.

Submit
Please wait...
About This Quiz
SQL Quizzes & Trivia

SQL is a language used in programming for managing data held in a relational database management system. T-SQL, on the other hand, is Microsoft's and Sybase's version. How... see morewell do you understand these two? Find out below. see less

2. You can use the disable trigger feature only if you are the table owner or database administrator.

Explanation

The statement is stating that the disable trigger feature can only be used by the table owner or the database administrator. This means that regular users or other roles do not have the authority to use this feature. Therefore, the correct answer is true.

Submit
3. If @@sqlstatus = 0, then:

Explanation

The correct answer is "Indicates successful completion of the fetch statement." This means that if the value of @@sqlstatus is 0, it indicates that the fetch statement was executed successfully and there is no error.

Submit
4. You can fetch only one row at a time.

Explanation

The fetch command moves the current cursor position one or more rows down the cursor result set. By default, a fetch returns only a single row.
The syntax for multiple rows: set cursor rows number for cursor_name

Submit
5. Which of the following statements is TRUE for the having clause A) aggregates are permitted in the having clause B) subqueries are permitted in the having clause

Explanation

The correct answer is Both A and B. The having clause in SQL allows the use of aggregates, such as SUM or COUNT, to filter the results of a query based on a condition. It also permits the use of subqueries, which are queries nested within the main query, to further filter the results. Therefore, both statements A and B are true for the having clause.

Submit
6. If @@sqlstatus = 1, then:

Explanation

If @@sqlstatus = 1, it indicates that the fetch statement resulted in an error. This means that there was an issue with retrieving data from the result set.

Submit
7. A stored procedure or trigger can define two cursors with the same name if only one is executed.

Explanation

For example, the following stored procedure works, because only one emp_crsr cursor is defined in its scope:
create procedure sp_emp_proc @id int
as
if @id > 100
declare emp_crsr cursor
for select fname from employee
else
declare emp_crsr cursor
for select lname from employee
return

Submit
8. The ________ operator combines result sets from multiple queries.

Explanation

The "union all" operator combines the result sets from multiple queries, including duplicate rows. It concatenates the rows from all the queries and returns a single result set. This allows for the combination of data from different queries into a single result, without removing any duplicate rows.

Submit
9. You can create a trigger on a temporary object.

Explanation

Triggers cannot be created on temporary objects. Temporary objects are session-specific and are automatically dropped at the end of the session. Triggers are used to perform actions when certain events occur on a database table, and they require a permanent object to be associated with. Therefore, it is not possible to create a trigger on a temporary object.

Submit
10. If @@sqlstatus = 2, then:

Explanation

If @@sqlstatus = 2, it indicates that there is no more data in the result set. This means that the fetch statement has successfully retrieved all the available data and there are no more rows to fetch.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 11, 2011
    Quiz Created by
    Nbans
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Is it possible to Enable or Disable a Database trigger ?
You can use the disable trigger feature only if you are the table...
If @@sqlstatus = 0, then:
You can fetch only one row at a time.
Which of the following statements is TRUE for the having clause...
If @@sqlstatus = 1, then:
A stored procedure or trigger can define two cursors with the same...
The ________ operator combines result sets from multiple queries.
You can create a trigger on a temporary object.
If @@sqlstatus = 2, then:
Alert!

Advertisement