
122 True/False questions
-
Self join → Used to return the product but not the sum of the two sources. Returns the set of all possible row combinations.
-
db_datareader, sysadmin, SELECT → Members of the ____/db_owner fixed database roles or the ____ fixed server fol can always run ____ at wish.
-
Only one, INSERT, DELETE → Inner joins can be specified in the ____ clause or the ____ clause. Outer joins can be specified only in the ____ clause.
-
1024 → Gives the highest value in an expression
-
Full-text queries → Can be issued against character-based data in a table when there is a full-text index on that table.
-
TRUNCATE TABLE → Used to delete all rows from a table without logging the individual row deletions.
-
ORDER BY, TOP → Only a specified first set or percent of rows can be returned.
-
HAVING → Used for specifying search conditions for a group or an aggregate.
-
Cannot, FOREIGN KEY, itself → You ____ run TRUNCATE TABLE on tables that are referenced by a ____ constraint unless it is referencing ____.
-
Only one, reference → CREATE TRIGGER can apply to ____ table in the current database, though it can ____ objects in another.
-
SELECT permission → Used to join a table/view to itself.
-
DATEADD → Used to produce a new date/time value which is based on adding an interval to the concerned date.
-
BEGIN TRAN, COMMIT TRAN → To perform multi-statement transactions you need a ____ at the beginning and a ____ at the end.
-
db_owner, db_ddladmin → Subqueries can have an ____ clause when a ____ clause is also used.
-
EXECUTE AS argument → For explicitly specifying the security context under which the current trigger fires.
-
Sequence → A user-defined schema bound object for generating a sequence of numeric values.
-
Left, right, full → If CREATE TRIGGER is part of a ____, it must be the ____ statement.
-
MAXVALUE → Used to specify upper bounds for the sequence object.
-
SELECT TOP, ORDER BY → It is recommended whenever you use the ____ statement you use the ____ clause to indicate the rows that are to be affected.
-
RAW mode → Used to specify that updates be allowed when you view data under a DB-Library browse mode cursor.
-
Severity 20 or higher → Will directly close the database connection without invoking CATCH.
-
MINVALUE → Used to specify upper bounds for the sequence object.
-
CREATE TRIGGER → Used to create a trigger, which is a special kind of stored procedure that will automatically run when an event takes place.
-
DML triggers → Results of the query will be returned as an XML document.
-
Cannot, indexed view, fire → You ____ run TRUNCATE TABLE on tables that participate in an ____ and they cannot ____ any trigger.
-
Sequence, not tied → tinyint
smallint
int
bigint -
UNION → Used to combine the results of multiple queries into a single result set which includes all the rows that belong to all queries participating. Removes duplicates unless ALL is included.
-
TRY...CATCH → Block of code used for processing errors in T-SQL code.
-
Cascade, Constraint → Used to combine and add records from two sources to a query's results when the values can meet the criteria defined.
-
Right outer join → Used to combine rows from two sources where all of the right side rows will be included.
-
Data manipulation language (DML) → Used to run queries and add, delete or edit records.
-
Cross join → Used to return the product but not the sum of the two sources. Returns the set of all possible row combinations.
-
ORDER BY → Used to order the result set of a query and at the same time limit the rows that are returned.
-
INSTEAD OF argument → Specifies that the DML trigger can be fired only when all operations in the triggering statement are successfully completed.
-
LIKE → Gives the lowest value in an expression
-
SET NO_BROWSETABLE ON → Used to set NO_BROWSETABLE to function.
-
Database, ALTER ANY DATABASE → You can create a DDL trigger with ____ scope if you have ____ DDL TRIGGER permission in the current database.
-
COMPUTE, FOR BROWSE → Used to create a sequence.
-
Distributed Transaction Coordinator (DTC) → Windows server service that can coordinate transactions that update multiple transaction protected resources on a single server computer or distributed across networked server computers.
-
Joins → Gives the lowest value in an expression
-
FETCH → Used to specify the number of rows to return as soon as the OFFSET is processed.
-
CREATE VIEW → Used to create a view.
-
COUNT(), performing → All referential ____ actions and ____ checks must succeed before a DML trigger fires.
-
COMPUTE → Used to generate subtotals in a result set. ntext, text and image cannot be dealt with through these.
-
COLLATE → Used to generate subtotals in a result set. ntext, text and image cannot be dealt with through these.
-
MAX → Produces the total of all values in a numeric expression.
-
UNBOUNDED PRECEDING → The window will start at the first row of the partition.
-
Current, first statement → All referential ____ actions and ____ checks must succeed before a DML trigger fires.
-
OFFSET → Used to specify the number of rows to be skipped.
-
AUTO mode → Supports nesting in the resulting XML.
-
Inner join → Used to return all rows from the joined tables/views even where there is no matching row between them.
-
ROLLBACK TRAN → Used to undo all of the work since the last BEGIN TRAN statement.
-
Left outer join → Used to combine and add records from two sources to a query's results when the values can meet the criteria defined.
-
OVER → Computes the average of all values in a numeric expression.
-
Cannot, partitioned → You ____ use SELECT....INTO to create a ____ table.
-
Compute row aggregate functions → RANK
NTILE
DENSE_RANK
ROW_NUMBER -
Data definition language (DDL) → Used to create and delete databases/tables, define table rows and columns, create indexes and take other actions that change the structure of the database.
-
Subquery → An inner select, which is always enclosed in parentheses.
-
PARTITION BY → Argument for telling the windows function to be applied to each partition separately and that computation will be restarted for each partition.
-
Outer join → Used to combine and add records from two sources to a query's results when the values can meet the criteria defined.
-
Aggregate functions, single, ignore → Use ____ to calculate on a set of values in order to return a ____ value. They generate summary values in query results set. Other than COUNT they will ____ null values by default. They are all deterministic.
-
Severity 10 or lower → Will directly close the database connection without invoking CATCH.
-
db_owner, db_datawriter → You can create a ____ trigger if you have ____ permission on the table or view it will be created on.
-
Logical processing order → FROM
ON
JOIN
WHERE
GROUP BY
WITH CUBE or WITH ROLLUP
HAVING
SELECT
DISTINCT
ORDER BY
TOP -
Batch, first → Used to produce and integer that forms a specified part of a date.
-
Sequence value types → Used to delete all rows from a table without logging the individual row deletions.
-
SUM → Used to specify either the BROWSE or the XML option.
-
AFTER argument → Specifies that the DML trigger can be fired only when all operations in the triggering statement are successfully completed.
-
Nested, 32 → Used to produce the number of date/time boundaries that get crossed between two different dates.
-
Mutual Authentication Required → Can be issued against character-based data in a table when there is a full-text index on that table.
-
FOR BROWSE → Cannot be used in SELECT statements joined by the UNION operator.
-
Aggregate functions → AVG
MIN
CHECKSUM_AGG
SUM
COUNT
STDEV
COUNT_BIG
STDEVP
GROUPING
VAR
GROUPING_ID
VARP
MAX -
DATABASE argument → Results of the query will be returned as an XML document.
-
TOP → Used to specify either the BROWSE or the XML option.
-
EXPLICIT mode → Gives more control over how the XML results are formatted.
-
GROUPING SETS() → Used to retrieve data from two or more tables or views.
-
CONTAINS → Specified in the WHERE or HAVING clauses. Used for precise or fuzzy matches.
-
FROM, WHERE, FROM → Inner joins can be specified in the ____ clause or the ____ clause. Outer joins can be specified only in the ____ clause.
-
CREATE SEQUENCE → A user-defined schema bound object for generating a sequence of numeric values.
-
Transaction → Used to combine the results of multiple queries into a single result set which includes all the rows that belong to all queries participating. Removes duplicates unless ALL is included.
-
MIN → Gives the lowest value in an expression
-
COUNT → Gives the exact number of selected rows
-
BROWSE → Used to specify that updates be allowed when you view data under a DB-Library browse mode cursor.
-
Atomic → Gives the lowest value in an expression
-
ALL SERVER argument → Used to specify that the DML trigger is to be executed instead of the triggering statement. Cannot be used for DDL or logon triggers.
-
Directly, indirectly, SUBSTRING → Cannot have tables joined ____ on ntext, test, or image columns. However, this can be done ____ using ____.
-
Analytic functions → Specified in the WHERE or HAVING clauses. Used for precise or fuzzy matches.
-
GETDATE → Used to retrieve the current date and time in SQL Server.
-
HAVING, SELECT → Used for specifying search conditions for a group or an aggregate.
-
FREETEXTTABLE → Used to delete all rows from a table without logging the individual row deletions.
-
DATEPART → Used to produce and integer that forms a specified part of a date.
-
START WITH → Option that can be used to specify a value less than or equal to the maximum and greater than or equal to the minimum value specified.
-
Ranking functions → AVG
MIN
CHECKSUM_AGG
SUM
COUNT
STDEV
COUNT_BIG
STDEVP
GROUPING
VAR
GROUPING_ID
VARP
MAX -
THROW → An alternative to RAISERROR. Can raise an exception and transfer execution to CATCH within TRY...CATCH block. Will cause a statement batch to end.
-
Server, logon, CONTROL SERVER → You can create a DDL trigger with ____ scope or a ____ trigger if you have ____ permission on the server.
-
WITH CHECK OPTION → Used to combine and add records from two sources to a query's results when the values can meet the criteria defined.
-
DML, ALTER → You can create a ____ trigger if you have ____ permission on the table or view it will be created on.
-
Permissions, table, sysadmin, db_ddladmin → TRUNCATE TABLE ____ are granted to the ____ owner, the members of the ____ fixed server role and the db_owner/____ fixed database roles.
-
WITH ENCRYPTION argument → For explicitly specifying the security context under which the current trigger fires.
-
CATCH → Where the error can be dealt with. Once dealt with control will be transferred to the first statement after END CATCH.
-
SCHEMABINDING → Used to ensure that the base table cannot be modified to affect the view definition.
-
CYCLE → Used to tell the sequence object if the sequence should restart. Default is NO.
-
Severity 11 to 19 → Control will be transferred to the associated CATCH block. Can provide information on the error that caused the CATCH block to run.
-
Ranking functions, partition → Use ____ to return a ranking value for each row within a ____. They are nondeterministic.
-
Analytic functions, compute things → To perform multi-statement transactions you need a ____ at the beginning and a ____ at the end.
-
DISTINCT → Used for specifying search conditions for a group or an aggregate.
-
FREETEXT → Specified in the WHERE or HAVING clauses. Used to match the meaning of words, phrases and strings.
-
ROLLUP() → Used to specify that operation should be performed following a different collation.
-
32 levels → There is a maximum of ____ of nesting possible with subqueries.
-
XML argument → Results of the query will be returned as an XML document.
-
SELECT...INTO → Can be inherited from the schema permissions or CONTROL permissions on a table.
-
AVG → Gives the lowest value in an expression
-
DATEDIFF → Used to produce the number of date/time boundaries that get crossed between two different dates.
-
GROUP BY → Used to order the result set of a query and at the same time limit the rows that are returned.
-
Logon triggers → Used to create a trigger, which is a special kind of stored procedure that will automatically run when an event takes place.
-
FOR → Gives the exact number of selected rows
-
Nested, sp_configure → Disable nested triggers by setting the ____ triggers options of ____ to a value of 0.
-
NO_BROWSETABLE → Option to turn on so that all the SELECT statements will behave as if the FOR BROWSE option has been appended to the statements.
-
RAISERROR → Used to determine the partitioning and ordering of a rowset before allowing the associated window function to be applied.
-
Full outer join → Used to retrieve all the rows from both sides where the join condition is evaluated to true.
-
CONTAINSTABLE → Used to delete all rows from a table without logging the individual row deletions.
-
INCREMENT BY → Specified in the WHERE or HAVING clauses. Used to match the meaning of words, phrases and strings.