SQL Server TSQLquiz - 8

10 Questions | Total Attempts: 197

SettingsSettingsSettings
Please wait...
SQL Server TSQLquiz - 8

This is your description.


Questions and Answers
  • 1. 
    I have a table, Sales, with the Notes field having the Filestream attribute. I run this query: select  salesmen, notes  into #salestemp  from Sales What is the data type of the Notes field in the temporary table?  
    • A. 

      Varchar(max)

    • B. 

      Varchar(max) with the filestream attribute

    • C. 

      Varbinary(max)

    • D. 

      Varbinary(max) with filestream attribute

  • 2. 
    True or False: sparse Columns can have the Filestream attribute defined on them?
    • A. 

      True

    • B. 

      False

  • 3. 
    What technique is used by the SQL Server to maintain Durability of Transactions?
    • A. 

      BEGIN...END Block

    • B. 

      Write Ahead Logging

    • C. 

      Locking

    • D. 

      AutoCommit Transactions

  • 4. 
    What is the difference between the following 2 queries:    -- 1 SELECT ROW_NUMBER() OVER (ORDER BY NEWID())  FROM sys.all_columns   -- 2 SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NEWID()))  FROM sys.all_columns  
    • A. 

      The first query returns an error and the second returns a Tally table.

    • B. 

      The first query returns a Tally table and the second returns the same row count and numbers but in a randomized order. The first query returns a Tally table and the second returns the same row count and numbers but in a randomized order. The first query returns a Tally table and the second returns the same row count and numbers but in a randomized order.

    • C. 

      The second query returns a Tally table and the first returns the same row count and numbers but in a randomized order.

    • D. 

      No difference

  • 5. 
    What will be the values returned by the COUNT(*) statements ? (select the answer that show the 3 values in correct order) CREATE TABLE #TempTable (RowID INT) CREATE TABLE UserTable (RowID INT)     BEGIN TRAN  INSERT UserTable (RowID) VALUES (1) ROLLBACK   INSERT UserTable (RowID) VALUES (2)   BEGIN TRAN  INSERT #TempTable (RowID) VALUES (1) ROLLBACK   INSERT #TempTable (RowID) VALUES (2)   DECLARE @TableVariable TABLE (RowID INT)   BEGIN TRAN  INSERT @TableVariable (RowID) VALUES (1) ROLLBACK   INSERT @TableVariable (RowID) VALUES (2)   SELECT COUNT(*) FROM UserTable  SELECT COUNT(*) FROM #TempTable SELECT COUNT(*) FROM @TableVariable   DROP TABLE #TempTable DROP TABLE UserTable
    • A. 

      1,1,1

    • B. 

      1,1,2

    • C. 

      1,2,2

    • D. 

      2,2,2

  • 6. 
    You wish to enable xp_cmdshell. You run the following code:   EXECUTE sys.sp_configure      @configname = 'show advanced options'     ,@configvalue = 1 GO RECONFIGURE GO EXECUTE sys.sp_configure      @configname = 'dsh'     ,@configvalue = 1 GO RECONFIGURE GO
    • A. 

      The first call to sp_configure succeeds

    • B. 

      The second call to sp_configure fails

    • C. 

      The second call to sp_configure succeeds

  • 7. 
    What is a table called, if it does not have either aClustered or a nonclustered index?
    • A. 

      Heap

    • B. 

      Temporary table

    • C. 

      Partitioned table

    • D. 

      Unclustered table

  • 8. 
    NTILE returns what?
    • A. 

      The sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition.

    • B. 

      The rank of each row within the partition of a result set. After a tie there will numeric gaps in the next ranked number

    • C. 

      The rows in an ordered partition into a specified number of groups.

    • D. 

      The rank of rows within the partition of a result set, without any gaps in the ranking

  • 9. 
    What will be the output of these SELECT queries? DECLARE @var money = 123457756 Declare @dec decimal =12345 Declare @dec1 Decimal(10,2) = 12345   --Select 1 SELECT LEN(@var)   --Select 2 SELECT LEN(@dec)   --Select 3 SELECT LEN(@dec1)
    • A. 

      12,5,8

    • B. 

      9,5,5

    • C. 

      12,8,8

    • D. 

      9,8,5

  • 10. 
    Declare @value int set @value = 5555555 PRINT CONVERT(varchar(6), @value)  What will be the output?  
    • A. 

      Arithmetic overflow error converting expression to data type varchar.

    • B. 

      *

    • C. 

      555555

    • D. 

      5555555

Related Topics
Back to Top Back to top