1. Which of the following statements using GROUP BY clause are allowed in SQL Server 2008?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
BCC CHECKIDENT (‘table_name’, RESEED, new_reseed_value)
Answers:
Answers:
Answers:
Answers:
Answers:
USE demodb
GO
DECLARE @a TABLE (ID int, Value int);
DECLARE @b TABLE (ID int, Value int);
INSERT @a VALUES (1, 10), (2, 20);
INSERT @b VALUES (1, 100),(2, 200);
WITH cte AS (SELECT * FROM @a)
UPDATE cte
SET Value = b.Value
FROM cte AS a
INNER JOIN @b AS b ON b.ID = a.ID
SELECT * FROM @a
GO
What Will be the output of the above code?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
DECLARE @myTime TIME(4) = ’02:02:02.234567 +01:01′
SELECT @myTime AS ‘@myTime’
What is the output of the above code?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
-o “C:Folder<file_name>”
Which of the following statements is true if a file with the file name specified in the above command already exists?
Answers:
Answers:
Answers:
SELECT Name
FROM person.employees
WHERE Name LIKE ‘[_]n’
GO
Which of the following values will be returned by the above code?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
DECLARE @myDate DATETIME2
SELECT @myDate = ‘2009/10/08 12:35:29.2348 +12:15’
SELECT @myDate AS ‘@myDate’
What is the output of the above code?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
1.ALTER permission on the database.
2.CONTROL permission in the database.
3.ALTER ANY SCHEMA permission and CREATE XML SCHEMA COLLECTION permission in the database.
Which of the above permissions is/are required to create an XML SCHEMA COLLECTION?
Answers:
Answers:
Answers:
Answers:
CREATE PROCEDURE Person.GetEmployees
@LastName nvarchar(50),
@FirstName nvarchar(50)
AS
SET NOCOUNT ON
SELECT FirstName, LastName, JobTitle, Department
FROM Person.EmployeeDepartment
WHERE FirstName = @FirstName AND LastName = @LastName
GO
Which of the following is a valid code to execute the GetEmployees stored procedure?
Answers:
1. >, >=, <, <=
2. <>
3. =
4. LIKE
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
1.The SQL Server system data type.
2.The default schema of the current user in the current database.
3.The dbo schema in the current database.
In which order does the SQL Server Database Engine refer to type_name when a type_schema_name is NOT specified while creating a table in SQL Server 2008?
Answers:
Answers:
Answers:
Answers:
USE Person
GO
DECLARE @p AS int
SELECT @p=10
SELECT TOP(@p)
FROM Employee
GO
What Will be the output of the above code?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
1.xml
2.text
3.bigint
4.image
5.float
6.datetime
Answers:
Answers:
- SELECT Column1 + Column2 FROM Table GROUP BY Column1, Column2
- SELECT Column1, Column2 FROM Table GROUP BY Column1 + Column2
- SELECT Column1 + constant + Column2 FROM Table GROUP BY Column1 + Column2
- SELECT Column1 + Column2 FROM Table GROUP BY Column1 + Column2
Answers:
- It checks the allocation of all the objects in the specified database.
- It checks the structural integrity of all the objects in the specified database.
- It checks for consistency in and between system tables in the specified database.
- It checks the consistency of disk space allocation structures of a specified database.
Answers:
- Row-level compression
- Page-level compression
- Data file level compression
- Backup level compression
Answers:
- The number of columns must be same in all queries.
- The order of columns must be same in all queries.
- The data types of the columns of the queries must be compatible.
- There should be at least one common column in the tables which are part of the UNION operation.
Answers:
- DELETE To
- MERGE To
- CREATE INDEX To
- INSERT To
- UPDATE To
Answers:
- Page
- Table
- Row
- Column
Answers:
- ENABLE
- AUTO
- DISABLE
- TABLE
- DEFAULT
Answers:
- date
- datetime
- datetime1
- datetime2
- datetimeoffset
Answers:
- IGNORE_DUP_KEY cannot be set to ON for XML indexes.
- IGNORE_DUP_KEY can be set to ON for spatial indexes.
- IGNORE_DUP_KEY can be set to ON for filtered indexes.
- IGNORE_DUP_KEY can be set to ON for XML indexes.
- IGNORE_DUP_KEY cannot be set to ON for indexes created on a view.
Answers:
- When a table or index is created, data compression is set to NONE, unless otherwise specified.
- Nonclustered indexes inherit the compression property of the table.
- New pages allocated in a heap as part of DML operations will not use PAGE compression until the heap is rebuilt.
- When you are compressing indexes, leaf-level pages can be compressed with only page compression.
Answers:
- Extensible Key Management
- SOAP Security
- Hashing
- Transparent Data Encryption
Answers:
- Tiny Encryption Algorithm
- Advanced Encryption Standard(AES)
- Blowfish
- Triple Data Encryption Standard(3DES)
Answers:
- Integer
- Binary
- Decimal
- Hexadecimal
Answers:
- SYSDATE()
- SYSTIME()
- SYSDATETIME()
- SYSUTCDATETIME()
Answers:
- Page compression attempts/sec
- Row compression/sec
- Pages compressed/min
- Pages compressed/sec
- Rows compressed/min
Answers:
- If a table contains FILESTREAM data and the table is partitioned, the FILESTREAM_ON clause must be included.
- The FILESTREAM column can be partitioned even if a table is not partitioned.
- There may not be a FILESTREAM filegroup if a table is not partitioned and the FILESTREAM_ON clause is not specified.
- The filegroup in the FILESTREAM_ON <filegroup>> clause must have one file defined for the filegroup.
Answers:
- Geography
- Longitude
- Altitude
- Geometry
- Latitude
BCC CHECKIDENT (‘table_name’, RESEED, new_reseed_value)
Answers:
- It checks the current iDentity fielD value of the specifieD table.
- It sets the identity field value to the new reseed value.
- It sets the identity field value to 1.
- All of the above.
Answers:
- Transact-SQL can be used to SELECT, INSERT, UPDATE, DELETE FILESTREAM data.
- The size of the stored data is limited to 2 GB.
- You cannot take backup of a database without the FILESTREAM data.
- FILESTREAM storage is best used when the BLOB file sizes average 1MB or higher.
Answers:
- CREATE VIEW permission in database
- ALTER permission on schema
- CONTROL permission on object
Answers:
- text
- int
- varchar
- bigint
Answers:
- PRIMARY KEY
- UNIQUE
- IDENTITY
- FOREIGN KEY
USE demodb
GO
DECLARE @a TABLE (ID int, Value int);
DECLARE @b TABLE (ID int, Value int);
INSERT @a VALUES (1, 10), (2, 20);
INSERT @b VALUES (1, 100),(2, 200);
WITH cte AS (SELECT * FROM @a)
UPDATE cte
SET Value = b.Value
FROM cte AS a
INNER JOIN @b AS b ON b.ID = a.ID
SELECT * FROM @a
GO
What Will be the output of the above code?
Answers:
- ID Value —– —– 1 100 2 200
- ID Value —– —– 1 10 2 100
- ID Value —– —– 1 10 2 200
- ID Value —– —– 1 100 2 100
Answers:
- One-to-one
- One-to-many
- Many-to-one
- Many-to-many
Answers:
- 50
- 75
- 100
- 150
- 200
Answers:
- At sign(@)
- Double number(##)
- Underscore(_)
- None of the above
Answers:
- System stored procedures
- Triggers
- SQL DDL syntax
- None of the above
Answers:
- It returns the first expression.
- It returns the second expression.
- It returns a null value.
- It returns an error.
Answers:
- True
- False
Answers:
- sqlcmd -S instanceName -o C:new.txt
- sqlcmd -S instanceName -i C:myScript.sql -o C:new.txt
- sqlcmd -S myServerinstanceName -o C:new.txt
- sqlcmd -S myServerinstanceName -i C:myScript.sql -o C:new.txt
DECLARE @myTime TIME(4) = ’02:02:02.234567 +01:01′
SELECT @myTime AS ‘@myTime’
What is the output of the above code?
Answers:
- 02:02:02.2345
- 02:02:02
- 02:02:02.2346
- An error is displayed
Answers:
- sqlcmd
- Microsoft .NET Framework SqlClient
- OLE DB provider
- None of the above
Answers:
- ON
- OFF
- TRUE
- FALSE
Answers:
- Multiple UNIQUE constraints can be defined on a table.
- When using the UNIQUE constraint, only one null value is allowed per column.
- UNIQUE constraint cannot be referenced by a FOREIGN KEY constraint
Answers:
- -p
- -P
- -z
- -Z
Answers:
- 1 to 116
- 1 to 127
- 1 to 128
- 1 to 512
Answers:
- On demand
- On change: prevent
- On change: log only
- On schedule
Answers:
- The table is created successfully with the FOREIGN KEY constraint.
- The table is not created and no message is returned.
- The table is created without the FOREIGN KEY constraint and a warning message is returned.
- The table is not created and an error message is displayed.
Answers:
- Data Compression
- Resource Governor
- Policy-Based Management
- Auditing
Answers:
- n (n= number of expressions in the element list passed to CUBE)
- n+1 (n= number of expressions in the element list passed to CUBE)
- 2^n (n= number of expressions in the element list passed to CUBE)
- 2^n+1 (n= number of expressions in the element list passed to CUBE)
Answers:
- Server Audit object
- Server Audit Specification object
- Database Audit Specification object
Answers:
- True
- False
Answers:
- ALTER TABLE Production.ProductCost DROP CONSTRAINT PK_Product WITH (ONLINE = ON) GO
- ALTER TABLE Production.ProductCostHistory DROP CONSTRAINT PK_Product DROP INDEX Index_Product WITH (ONLINE = ON) GO
- DROP INDEX Index_Product ON Production.ProductCost GO
Answers:
- 5 seconds
- 8 seconds
- 10 seconds
- 15 seconds
- 1 minute
Answers:
- 4 digits
- 6 digits
- 8 digits
- 10 digits
Answers:
- 3 bytes
- 5 bytes
- 6 bytes
- 8 bytes
Answers:
- Clustered
- Nonclustered
- None of the above
Answers:
- ALTER INDEX Index_Product ON Table1 WITH ( DATA_COMPRESSION = PAGE ) GO
- ALTER INDEX Index_Product ON Table1 SET ( DATA_COMPRESSION = PAGE ) GO
- ALTER INDEX Index_Product ON Table1 REBUILD WITH ( DATA_COMPRESSION = PAGE ) GO
- ALTER INDEX Index_Product ON Table1 REBUILD SET ( DATA_COMPRESSION = PAGE ) GO
Answers:
- datetime
- date
- int
- tinyint
Answers:
- Hot Add CPU
- Dynamic management views
- Resource Governor
- Backup Compression
Answers:
- real
- rowversion
- type_var
- sql_variant
- monetary
-o “C:Folder<file_name>”
Which of the following statements is true if a file with the file name specified in the above command already exists?
Answers:
- An error is generated.
- The file is overwritten.
- None of the above.
Answers:
- True
- False
Answers:
- 58
- 116
- 128
- 512
SELECT Name
FROM person.employees
WHERE Name LIKE ‘[_]n’
GO
Which of the following values will be returned by the above code?
Answers:
- in
- sin
- _n
- All of the above
Answers:
- Windows Authentication
- SQL Server Authentication
- IIS Authentication
- Digest Authentication
Answers:
- True
- False
Answers:
- core.sp_delete_data
- core.sp_purge_data
- core.sp_remove_data
- None of the above
Answers:
- 32 processors
- 50 processors
- 64 processors
- 75 processors
Answers:
- Initial_file_name
- File_pattern
- Audit_file_offset
- None of the above
DECLARE @myDate DATETIME2
SELECT @myDate = ‘2009/10/08 12:35:29.2348 +12:15’
SELECT @myDate AS ‘@myDate’
What is the output of the above code?
Answers:
- 2009-10-08 12:35:29
- 2009/10/08 12:35:29.2348000
- 2009-10-08 12:35:29.2348000
- 2009/10/08 12:35:29
Answers:
- The Full-Text Catalog is an index for searching specific keywords.
- The Full-Text Catalog is a file which contains full-text indexes.
- The Full-Text Catalog is an inbuilt function for validating text data.
- The Full-Text Catalog is a system trigger for checking text validation.
Answers:
- IDENTITY
- SPARSE
- NOT FOR REPLICATION
- COLLATE
Answers:
- ServerGroupReaderRole
- ServerGroupAdministratorRole
- PolicyAdministratorRole
- db_ssisoperator
Answers:
- 00:00:00.0000000 through 23:59:59.9999999
- 00:00:00.0000000 through 24:00:00.0000000
- 00:00:00.0000000 through 23:59:00.0000000
- 00:00:00.0000000 through 23:59:59.0000000
Answers:
- ALTER SERVER AUDIT <audit_name> WITH (ENABLE=TRUE)
- ALTER SERVER AUDIT <audit_name> SET (ENABLE=TRUE)
- ALTER SERVER AUDIT <audit_name> WITH (STATE=ON)
- ALTER SERVER AUDIT <audit_name> SET (STATE=ON)
Answers:
- sqlinst
- sqlcmd
- sqlexpress
- sqldef
1.ALTER permission on the database.
2.CONTROL permission in the database.
3.ALTER ANY SCHEMA permission and CREATE XML SCHEMA COLLECTION permission in the database.
Which of the above permissions is/are required to create an XML SCHEMA COLLECTION?
Answers:
- 1 and 2
- 2 and 3
- 1 and 3
- 1 or 2 or 3
- 1 and 2 and 3
Answers:
- Modifications made in a table will be faster if the number of indexes is more.
- Modifications made in a table will be slower if the number of indexes is more.
- The number of indexes does not affect the modification process of a table.
Answers:
- 25
- 30
- 35
- 40
Answers:
- image
- text
- nchar
- geography
CREATE PROCEDURE Person.GetEmployees
@LastName nvarchar(50),
@FirstName nvarchar(50)
AS
SET NOCOUNT ON
SELECT FirstName, LastName, JobTitle, Department
FROM Person.EmployeeDepartment
WHERE FirstName = @FirstName AND LastName = @LastName
GO
Which of the following is a valid code to execute the GetEmployees stored procedure?
Answers:
- EXECUTE Person.GetEmployees N’John’, N’Miller’
- EXEC Person.GetEmployees @LastName = N’Miller’, @FirstName = N’John’
- EXECUTE Person.GetEmployees @FirstName = N’John’, @LastName = N’Miller’
- All of the above
1. >, >=, <, <=
2. <>
3. =
4. LIKE
Answers:
- 1,4,3,2
- 4,1,2,3
- 3,2,1,4
- 2,4,1,3
Answers:
- 16
- 18
- 38
- 48
Answers:
- 8
- 16
- 32
- 64
Answers:
- DEFAULT
- CONTENT
- DOCUMENT
- FILESTREAM
Answers:
- 1. Create a database encryption key. 2. Create or obtain a certificate protected by the encryption key. 3. Create a master key and protect it by the certificate. 4. Set the database to use encryption.
- 1. Create a database encryption key. 2. Create a master key. 3. Create or obtain a certificate protected by the master key. 4. Set the database to use encryption.
- 1. Create a master key. 2. Create or obtain a certificate protected by the master key. 3. Create a database encryption key and protect it by the certificate. 4. Set the database to use encryption.
Answers:
- ALTER Resource Governor Enable
- ALTER Resource Governor Reconfigure
- ALTER Resource Governor Set
- None of the above
Answers:
- sqlcmd -C myServerinstanceName
- sqlcmd -S instanceName
- sqlcmd -C instanceName
- sqlcmd -S myServerinstanceName
Answers:
- sqlcmd -S myServerinstanceName -i C:newScript.sql
- sqlcmd -S instanceName -o C:newScript.sql
- sqlcmd -S myServerinstanceName -r C:newScript.sql
- sqlcmd -S instanceName -i C:newScript.sql
Answers:
- 5 digits
- 6 digits
- 7 digits
- 10 digits
Answers:
- SELECT permission on the schema
- ALTER permission on the schema
- CONTROL permission on the procedure
- Both a and b
- Either b or c
- Both b and c
Answers:
- 0 and 66020
- 1 and 65530
- 0 and 65534
- 1 and 65535
Answers:
- Only SELECT
- Only SELECT and INSERT
- Only SELECT, INSERT, UPDATE, DELETE
- Only SELECT, INSERT, UPDATE, MERGE, DELETE
Answers:
- 0000
- NULL
- 1234
- None of the above
Answers:
- Microsoft.SqlServer.Management.Smo
- Microsoft.SqlServer.Server
- Microsoft.sqlserver.management.common
- Microsoft.sqlserver.connectioninfo
Answers:
- The server blocks any new activity to be performed to the SQL Server instance.
- Audit events are buffered in memory until they can be flushed to the target.
- The audit is automatically disabled.
- An error is displayed.
Answers:
- ALTER TABLE Table1 REBUILD WITH (DATA_COMPRESSION = PAGE)
- ALTER TABLE Table1 REBUILD PARTITION = 1 WITH (DATA_COMPRESSION = NONE) GO
- ALTER TABLE Table1 REBUILD PARTITION ALL WITH (DATA_COMPRESSION = PAGE ON PARTITIONS(1) )
- All of the above
1.The SQL Server system data type.
2.The default schema of the current user in the current database.
3.The dbo schema in the current database.
In which order does the SQL Server Database Engine refer to type_name when a type_schema_name is NOT specified while creating a table in SQL Server 2008?
Answers:
- 3,2,1
- 2,3,1
- 3,1,2
- 1,2,3
- Any order
Answers:
- CASCADE
- DELETE
- SET NULL
- SET DEFAULT
Answers:
- The prefix will speed up the execution of the stored procedure.
- The prefix will slow down the execution of the stored procedure.
- The performance of the stored procedure is not affected.
Answers:
- 777
- 888
- 999
- 1000
USE Person
GO
DECLARE @p AS int
SELECT @p=10
SELECT TOP(@p)
FROM Employee
GO
What Will be the output of the above code?
Answers:
- No output is displayed.
- A list of first 10 employees is displayed from the Person database.
- An incorrect syntax error is displayed.
- None of the above.
Answers:
- ALTER DATABASE DROP ENCRYPTION KEY
- DROP DATABASE ENCRYPTION KEY
- ALTER DATABASE REMOVE ENCRYPTION KEY
- REMOVE DATABASE ENCRYPTION KEY
Answers:
- ON
- WRITE
- PERSISTED
Answers:
- varchar
- boolean
- int
- tinyint
Answers:
- varchar
- nvarchar
- int
- bigint
Answers:
- sp_renamedb oldname,newname
- sp_renamedb newname,oldname
- sp_dbrename oldname,newname
- sp_rename oldname,newname
1.xml
2.text
3.bigint
4.image
5.float
6.datetime
Answers:
- 1,2,3,4,5,6
- 6,5,4,3,2,1
- 1,6,5,3,2,4
- 1,4,2,3,6,5
No comments:
Post a Comment