T-SQL Dev Job

Descrição

Professional SQL Server Quiz sobre T-SQL Dev Job, criado por Dariusz Spiewak em 22-03-2015.
Dariusz Spiewak
Quiz por Dariusz Spiewak, atualizado more than 1 year ago
Dariusz Spiewak
Criado por Dariusz Spiewak mais de 9 anos atrás
23
1

Resumo de Recurso

Questão 1

Questão
What are the essential properties of transactions?
Responda
  • Atomicity
  • Durability
  • Consistency
  • Manageability
  • Isolation
  • Co-operativity

Questão 2

Questão
A database that's gone through how many normalization forms is usually considered "good enough"?
Responda
  • 1
  • 2
  • 3
  • 4
  • 5

Questão 3

Questão
What are the benefits of stored procedures?
Responda
  • Execution plan retention/caching
  • Code reuse
  • Parameter sniffing
  • Improved security

Questão 4

Questão
What are the types of triggers?
Responda
  • INSTEAD OF
  • DELAYED
  • BEFORE
  • AFTER

Questão 5

Questão
Triggers take part in transactions.
Responda
  • True
  • False

Questão 6

Questão
Changes to table variables within a scope of a transaction get rolled back when the transaction is rolled back.
Responda
  • True
  • False

Questão 7

Questão
One should prefer using CHECK constraints to triggers.
Responda
  • True
  • False

Questão 8

Questão
DDL triggers are always AFTER triggers.
Responda
  • True
  • False

Questão 9

Questão
It's best practice to build views from other views. This promotes code reuse.
Responda
  • True
  • False

Questão 10

Questão
Some views can be used to update underlying tables.
Responda
  • True
  • False

Questão 11

Questão
Some views with aggregate functions in them can be used to update the underlying table(s).
Responda
  • True
  • False

Questão 12

Questão
An indexed view materializes data in the I/O subsystem and requires a clustered index.
Responda
  • True
  • False

Questão 13

Questão
Heaps are tables without a clustered index on them.
Responda
  • True
  • False

Questão 14

Questão
It's best practice to put clustered indexes on all tables, even the small ones.
Responda
  • True
  • False

Questão 15

Questão
The SCHEMABINDING option used with a view prevents schema changes to any underlying tables.
Responda
  • True
  • False

Questão 16

Questão
What is the main benefit of using an index on a table?
Responda
  • It prevents updating table statistics too frequently.
  • It stores the data in the table in an ordered state.
  • It makes writing queries easier.
  • It helps locate rows more quickly and efficiently.

Questão 17

Questão
For all intents and purposes, is a clustered index the same as the table itself?
Responda
  • YES
  • NO

Questão 18

Questão
You should always write queries in a way that takes advantage of set-based operations and avoid cursors.
Responda
  • True
  • False

Questão 19

Questão
A linked server configuration enables SQL Server to exec commands against an OLE DB data sources on remote servers.
Responda
  • True
  • False

Questão 20

Questão
A subquery can be used anywhere an expression can be used.
Responda
  • True
  • False

Questão 21

Questão
An INNER JOIN will always return at least one row of data.
Responda
  • True
  • False

Questão 22

Questão
It's best practice to always use LEFT OUTER JON instead of RIGHT OUTER JOIN and these two should not be used in the same query for the sake of clarity and ease of understanding.
Responda
  • True
  • False

Questão 23

Questão
If two tables, [A] with m rows and [B] with n rows, are CROSS JOINed, the result set has how many rows?
Responda
  • m + n - 1
  • m * n - 1
  • m * n
  • ( m - 1 ) * ( n - 1 )

Questão 24

Questão
In a FULL OUTER JOIN all of the rows of all of the joined tables are included, whether they are matched or not.
Responda
  • True
  • False

Questão 25

Questão
If you SELF JON a table, you have to use table aliases.
Responda
  • True
  • False

Questão 26

Questão
What are the types of SQL user-defined functions?
Responda
  • Scalar
  • Inline table-valued
  • Procedural
  • Functional
  • Multi-statement table-valued

Questão 27

Questão
An inline table-valued function is the best type of function from the point of view of function performance.
Responda
  • True
  • False

Questão 28

Questão
Multi-statement table-valued functions can have side-effects (e.g., update a table).
Responda
  • True
  • False

Questão 29

Questão
You can insert data returned straight from a stored procedure by using the INSERT...EXEC statement.
Responda
  • True
  • False

Questão 30

Questão
An identity field can temporarily be disabled (for instance, during a data load) by using one of the SET directives.
Responda
  • True
  • False

Questão 31

Questão
When a table is truncated, an identity field is reset to its starting value.
Responda
  • True
  • False

Questão 32

Questão
When all the rows in a table are DELETEd, the identity column gets reset to its initial value.
Responda
  • True
  • False

Questão 33

Questão
Every table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table.
Responda
  • True
  • False

Questão 34

Questão
It is possible to change the length of a column defined as a PRIMARY KEY constraint without first deleting it and then re-creating it.
Responda
  • True
  • False

Questão 35

Questão
Which constraint enforces referential integrity?
Responda
  • UNIQUE KEY constraint
  • FOREIGN KEY constraint
  • CHECK constraint
  • TRIGGER

Questão 36

Questão
A CHECK constraint does not come into play if the relevant column receives a NULL value.
Responda
  • True
  • False

Questão 37

Questão
One should always prefer CHECK constraints to TRIGGERS.
Responda
  • True
  • False

Questão 38

Questão
The UNIQUE constraint is always implemented as a unique index on the relevant column(s).
Responda
  • True
  • False

Questão 39

Questão
What is the outcome of the expression under the default settings of SQL Server: SELECT ( 'a' + NULL ) ?
Responda
  • a
  • NULL
  • an error is returned

Questão 40

Questão
It is best practice not to use query/table hints in production code due to maintenance issues.
Responda
  • True
  • False

Questão 41

Questão
Which WHERE clause has the potential to benefit from an index?
Responda
  • WHERE Firstname LIKE '%N'
  • WHERE Firstname LIKE 'N%'
  • WHERE Firstname LIKE '%N%'

Questão 42

Questão
BCP lets one perform data imports and exports using a command-line utility.
Responda
  • True
  • False

Questão 43

Questão
Dirty reads can happen if you use the isolation level of READ COMMITTED.
Responda
  • True
  • False

Questão 44

Questão
The SERIALIZABLE isolation level is sufficient to ensure that no phantom rows appear within a transaction.
Responda
  • True
  • False

Questão 45

Questão
It is best practice to set FILLFACTOR to 100 (or 0) on an index in a read-only table.
Responda
  • True
  • False

Questão 46

Questão
The DENY permission takes precedence over all other permissions that a user might have for an object.
Responda
  • True
  • False

Questão 47

Questão
A lock can go from the row level to the page level.
Responda
  • True
  • False

Questão 48

Questão
The DELETE command has much more overhead in terms of log activity than TRUNCATE.
Responda
  • True
  • False

Questão 49

Questão
It is best practice to specify collation inline within a query.
Responda
  • True
  • False

Questão 50

Questão
The collation of a SQL Server can be changed without re-installation once the server has been installed.
Responda
  • True
  • False

Questão 51

Questão
The SNAPSHOT isolation level relies heavily on tempdb.
Responda
  • True
  • False

Questão 52

Questão
It is best practice to have a clustered index on a column against which range searches/scans are performed.
Responda
  • True
  • False

Questão 53

Questão
To improve performance of a view one can try to convert it into an indexed view.
Responda
  • True
  • False

Questão 54

Questão
A stale statistics can lead to the optimizer's not picking up an optimal query plan and underestimation of row counts.
Responda
  • True
  • False

Questão 55

Questão
Statistics can be created manually and automatically by SQL Server.
Responda
  • True
  • False

Questão 56

Questão
When a statistics is updated with the FULLSCAN option, it means that SQL Server will use data across all the rows to infer the distribution of values in the relevant column(s).
Responda
  • True
  • False

Questão 57

Questão
What is the outcome of the following query: SELECT 1 WHERE ( 1 = 0 )?
Responda
  • 1
  • 0
  • NULL
  • empty set (no rows)

Questão 58

Questão
Does the ORDER BY clause paired with TOP(100 PERCENT) used in a view guarantee the order of the returned rows?
Responda
  • YES
  • NO

Questão 59

Questão
If you use ORDER BY in a query, what you really get is not a relational set but a cursor.
Responda
  • True
  • False

Questão 60

Questão
It is best practice to use UNION ALL wherever possible instead of UNION due to performance reasons.
Responda
  • True
  • False

Questão 61

Questão
A deadlock can happen if two pieces of code access the same objects in reverse order at the same time.
Responda
  • True
  • False

Questão 62

Questão
Deadlock is a blocking situation but a blocking situation doesn't necessarily have to be a deadlock.
Responda
  • True
  • False

Questão 63

Questão
It is best practice to always use UNICODE data types (for textual values) regardless of whether the data comes from a UNICODE source or not.
Responda
  • True
  • False

Questão 64

Questão
It is best practice to always store integers as BIGINTs because this frees the developer from thinking about the smallest data type there could be to accommodate all the anticipated values.
Responda
  • True
  • False

Questão 65

Questão
The XML data type in SQL Server can be tied to an XML schema but this is not required.
Responda
  • True
  • False

Questão 66

Questão
The EXCEPT operator removes all duplicates from the result set and treats two NULL values as being equal.
Responda
  • True
  • False

Questão 67

Questão
In the new error-handling construct, TRY...CATCH, it is possible to use the FINALLY block known from other languages.
Responda
  • True
  • False

Questão 68

Questão
What does the SET XACT_ABORT ON; directive do?
Responda
  • It ensures that the isolation level of the code following it cannot be changed without raising an error.
  • It ensures that the developer must handle any rollbacks manually.
  • It ensures that a transaction is aborted without a rollback when an error is encountered and SQL Server raises error 825 (written to the error log).
  • It ensures that a transaction is automatically rolled back if an error occurs.

Questão 69

Questão
A table-valued variable can be used as an argument to a stored procedure only if it matches a user-defined table type and is marked as READONLY.
Responda
  • True
  • False

Questão 70

Questão
A subquery can contain an ORDER BY clause.
Responda
  • True
  • False

Questão 71

Questão
To return de-normalized data from a table/tables one can use the PIVOT operator.
Responda
  • True
  • False

Questão 72

Questão
To how many levels can you nest stored procedures (and managed code)?
Responda
  • 16
  • 32
  • 64
  • limited only by the memory of the system

Questão 73

Questão
You can only have one PRIMARY filegroup per database but as many user-defined filegroups as you want.
Responda
  • True
  • False

Questão 74

Questão
It is best practice to only have one log file per database.
Responda
  • True
  • False

Questão 75

Questão
Data is written to a log file in a sequential manner.
Responda
  • True
  • False

Questão 76

Questão
Log files can be placed into filegroups in much the same way as data files can.
Responda
  • True
  • False

Questão 77

Questão
It is best practice to always qualify the name of any object by the containing schema because this saves SQL Server the time it needs to look for this object otherwise.
Responda
  • True
  • False

Questão 78

Questão
One can put a non-clustered index an a heap or on a clustered table.
Responda
  • True
  • False

Questão 79

Questão
PowerShell cannot be used to change the collation of a server.
Responda
  • True
  • False

Questão 80

Questão
PowerShell can execute any SQL query against a SQL Server database.
Responda
  • True
  • False

Questão 81

Questão
It is best practice to prefer using ORs to ANDs when building queries.
Responda
  • True
  • False

Questão 82

Questão
One can configure log-shipping in such a way that the database to which logs are being shipped is usable for reporting purposes.
Responda
  • True
  • False

Questão 83

Questão
What's the outcome of the following: IF ( SELECT 1/0 WHERE ( 1 = 0 ) ) IS NULL PRINT 'A' ELSE PRINT 'B'; ?
Responda
  • error is raised
  • B
  • A

Questão 84

Questão
Temporary tables can have indexes defined on them and SQL Server can create statistics on them when it deems it appropriate.
Responda
  • True
  • False

Questão 85

Questão
A table variable can be pushed out to tempdb.
Responda
  • True
  • False

Questão 86

Questão
Parallel query execution plans are always better in terms of performance than single-threaded plans.
Responda
  • True
  • False

Questão 87

Questão
SQL Server supports directly a many-to-many relationship between tables.
Responda
  • True
  • False

Questão 88

Questão
CHECKPOINTS truncate the log when the database is in the FULL recovery model.
Responda
  • True
  • False

Questão 89

Questão
SQL Server supports regular expressions out-of-the-box.
Responda
  • True
  • False

Questão 90

Questão
Cardinality issues stem from the fact that statistics are stale and they almost always lead to the optimizer choosing suboptimal query execution plan.
Responda
  • True
  • False

Questão 91

Questão
A non-clustered index and tempdb can be created on a separate (physical) drive to improve performance.
Responda
  • True
  • False

Questão 92

Questão
Which aggregate function(s) do(es) ignore NULLs?
Responda
  • AVG( [ColumnName] )
  • SUM( [ColumnName] )
  • COUNT(*)
  • COUNT( [ColumnName] )
  • MAX( [ColumnName] )
  • COUNT_BIG( [ColumnName] )

Questão 93

Questão
Do you have to take a database offline to change the physical location of one of its files?
Responda
  • YES
  • NO

Questão 94

Questão
Can we insert data into a table on which the clustered index has been disabled?
Responda
  • YES
  • NO

Questão 95

Questão
It is best practice to use the WITH RECOMPILE directive for a stored procedure that will be executed infrequently and the data distribution in the table(s) it uses is very different for different parameters.
Responda
  • True
  • False

Questão 96

Questão
Which is the preferred way of checking if a table is not empty: 1) ( SELECT COUNT(*) FROM dbo.Table ) > 0 2) EXISTS ( SELECT * FROM dbo.Table ) 3) ( SELECT MAX( [ColumnName] FROM dbo.Table ) IS NOT NULL
Responda
  • 1)
  • 2)
  • 3)

Questão 97

Questão
SELECT...INTO will never lock system objects.
Responda
  • True
  • False

Questão 98

Questão
Does the order of columns in UPDATE statements matter in any way?
Responda
  • NO
  • YES

Questão 99

Questão
What are the special memory resident tables available when dealing with triggers?
Responda
  • DELETED
  • UPDATED
  • INSERTED

Questão 100

Questão
User-defined functions can raise errors inside their bodies the same way stored procedures can by calling the RAISERROR function.
Responda
  • True
  • False

Questão 101

Questão
In which database is the metadata about SQL Server Agent jobs stored?
Responda
  • master
  • tempdb
  • msdb
  • resource
  • model

Questão 102

Questão
Which database(s) should a DBA back up on a regular schedule?
Responda
  • master
  • msdb
  • tempdb

Questão 103

Questão
The fastest way to improve a performance of a SELECT query is to add a covering index to the table(s).
Responda
  • True
  • False

Questão 104

Questão
Transactions can span multiple batches, that is, pieces of code separated by GO.
Responda
  • True
  • False

Questão 105

Questão
Activity Monitor lets you see in real-time the most expensive queries executing on the machine.
Responda
  • True
  • False

Questão 106

Questão
It is best practice not to use Common Table Expressions as they usually perform much worse than plain subqueries.
Responda
  • True
  • False

Questão 107

Questão
Which function returns data with greater resolution?
Responda
  • GETDATE
  • SYSDATETIME

Questão 108

Questão
Is it true that errors whose severity level is below 11 cannot be handled by the TRY...CATCH construct?
Responda
  • YES
  • NO

Questão 109

Questão
Can the TRY...CATCH block catch object name resolution errors?
Responda
  • NO
  • YES

Questão 110

Questão
Does SELECT...INTO transfer indexes to the new table?
Responda
  • NO
  • YES

Questão 111

Questão
Is it true that each and every user in a database is automatically a member of the public role?
Responda
  • YES
  • NO

Questão 112

Questão
Can the dbo user in a database be denied access to a table?
Responda
  • NO
  • YES

Questão 113

Questão
When data is deleted from a table, SQL Server immediately reduces the size of the table.
Responda
  • True
  • False

Questão 114

Questão
Which functions operate on the XML data type in SQL Server?
Responda
  • query()
  • value()
  • exists()
  • is()
  • modify()
  • nodes()
  • length()
  • datatype()

Questão 115

Questão
In which system database are usernames and passwords (if any) stored?
Responda
  • model
  • msdb
  • master
  • distribution

Questão 116

Questão
Which are good properties of a clustered index?
Responda
  • Static
  • Narrow
  • Ever-increasing
  • Random

Questão 117

Questão
It is best practice to shrink log files on a regular basis.
Responda
  • True
  • False

Questão 118

Questão
Only a log backup can clear the log of inactive transactions and make space inside it reusable when the recovery model of a database is FULL or BULK_LOGGED.
Responda
  • True
  • False

Questão 119

Questão
How many different database recovery models does SQL Server support?
Responda
  • 1
  • 2
  • 3
  • 4
  • 19

Questão 120

Questão
Online index rebuilds are available in all editions of SQL Server except the Express one.
Responda
  • True
  • False

Questão 121

Questão
What's the outcome of the query: SELECT COALESCE(NULLIF(1, 1), 'A')?
Responda
  • A
  • NULL
  • conversion error

Questão 122

Questão
Which process is the CXPACKET wait type associated with?
Responda
  • Reading data from disk to cache
  • Executing parallel query plans
  • Flushing dirty pages to disk
  • Receiving asynchronous messages via SQL Server Broker

Questão 123

Questão
It is best practice to not create indexes on foreign key columns.
Responda
  • True
  • False

Questão 124

Questão
It is best practice not to give objects names that contain special characters or spaces.
Responda
  • True
  • False

Questão 125

Questão
It is best practice to turn off the AUTO CREATE and AUTO UPDATE of statistics and take care of them manually.
Responda
  • True
  • False

Questão 126

Questão
Which one is the preferred way of capturing the last inserted identity value in a session?
Responda
  • @@Indentity
  • SCOPE_IDENTITY()

Semelhante

70-458
Ben Odunjo
SQL Azure Identity Jumping
Mary Macdonald
Managing Master Data
wynand.coetzee77
Data Quality project to clean data
wynand.coetzee77
Deploy package to file system
wynand.coetzee77
Package Properties at Run Time
wynand.coetzee77
Script Components
wynand.coetzee77
DQS Permissions
wynand.coetzee77
BASES DE DATOS
Hernando Castro
INTELIGENCIAS MÚLTIPLES
Nadia Salazar
BASES DE DATOS
Shanella Percel