What will be the result of the following statement?
Question:-SELECT ROUND(689.89, -1, 1)
A. 680.00
B. 680.90
C. 689.90
D. 690.00
Question:-SELECT ROUND(123.89, 0, 2)
A. 120.90
B. 123.00
C. 123.90
D. 124.00
Question:-Which of the following is a reserved keyword in SQL Server 2000 and therefore cannot be used as an object name or as a column name in a table unless delimited?
A. ADD
B. SUBTRACT
C. MINUS
D. MULTIPLY
E. DIVIDE
F. None of the above is a reserved keyword in SQL Server 2000.
Question:-Which of the following fixed server roles can manage linked servers?
A. processadmin
B. setupadmin
C. securityadmin
D. serveradmin
Question:-What's the maximum number of parameters can a SQL Server 2000 stored procedure have?
A. 128
B. 256
C. 512
D. 1,024
Question:-SELECT CAST(-1 AS DATETIME)
A. 1900-01-01 00:00:00.000
B. 1899-01-01 00:00:00.000
C. 1899-12-31 00:00:00.000
D. 1752-01-01 00:00:00.000
E. 1752-12-31 00:00:00.000
F. The statement will generate an error. Only positive integer values can be converted to a DATETIME data type.
Question:-What's the earliest date that can be stored in a DATETIME data type?
A. January 1, 1643
B. January 1, 1753
C. January 1, 1863
D. January 1, 1700
E. January 1, 1800
F. January 1, 1900
Question:-View text definitions are stored in which system table?
A. sysobjects
B. syscolumns
C. syscomments
D. sysviews
Question:-Which of the following is NOT a valid description of the public role?
A. The public role captures all default permissions for users in a database.
B. The public role cannot be dropped.
C. The public role is contained in every database, including msdb, tempdb, model, and all user databases except in the master database for security purposes.
D. The public role cannot have users, groups, or roles assigned to it.
Your Answer : B
Question:-What's the maximum number of columns can you include in a SELECT statement?
A. 512
B. 1,024
C. 2,048
D. 4,096
Question:-Which of the following is NOT true about the PRIMARY KEY constraint?
A. Can be of more than 1 column.
B. Always created as CLUSTERED.
C. Enforces data uniqueness by creating a unique index for the primary key columns.
D. Column that participates in the PRIMARY KEY constraint cannot accept NULL values
Question:-Which of the following statements is the correct syntax for adding a new column called Gender into a table called dbo.Employees that already contains data?
A. ALTER TABLE dbo.Employees ADD COLUMN Gender CHAR(1) NOT NULL
B. ALTER TABLE dbo.Employees ADD COLUMN GENDER CHAR(1) NULL
C. ALTER TABLE dbo.Employees ADD Gender CHAR(1) NOT NULL
D. ALTER TABLE dbo.Employees ADD Gender CHAR(1) NULL
Question:-What will be the output of the following statement?
SELECT CHARINDEX('is','Missississippi', -1)
A. 0
B. 2
C. 8
D. -1
E. NULL
F. Statement will generate an error. Only positive integer values are allowed.
Question:-SELECT ROUND(123.89, -1)
A. 120.00
B. 123.00
C. 123.90
D. 124.00
Question:-To identify records that were updated in a table from a trigger, which of the following tables need to be investigated?
A. Inserted system table
B. Updated system table
C. Deleted system table
D. Inserted and Deleted system tables
Question:-What will be the result of the following SELECT statement?
SELECT 7/3
A. 2.333333
B. 2.3334
C. 2.334
D. 2
Question:-DECLARE @Bit BIT
SET @Bit = -1
A. -1
B. 0
C. 1
D. An error will be encountered. Only 1, 0 and NULL values are allowed for a bit data type.
Question:-What will be the result of the following statement?
SELECT CAST(-1 AS SMALLDATETIME)
A. 1900-01-01 00:00:00.000
B. 1899-01-01 00:00:00.000
C. 1899-12-31 00:00:00.000
D. 1752-01-01 00:00:00.000
E. 1752-12-31 00:00:00.000
F. The system will generate an error. Only positive integer values can be converted to a SMALLDATETIME data type.
Question:-Which of the following is NOT a valid description of the setupadmin fixed server role?
A. Configures server-wide settings.
B. Can mark a stored procedure as startup.
C. Adds, removes and configures linked servers.
D. Manages extended stored procedures
Question:-Which of the following is a reserved keyword in SQL Server 2000 and therefore cannot be used as an object name or as a column name in a table unless delimited?
A. DATE
B. DATETIME
C. SMALLDATETIME
D. CURRENT_DATE
E. TIMESTAMP
F. All of the above are reserved keywords in SQL Server 2000.
Question:-SELECT CAST(0 AS DATETIME)
A. 1900-01-01 00:00:00.000
B. 9999-12-31 00:00:00.000
C. 1753-01-01 00:00:00.000
D. 1800-01-01 00:00:00.000
E. 1853-01-01 00:00:00
F. The statement will generate an error. An integer value cannot be converted to a DATETIME data type.
Question:-Which of the following fixed server roles can manage linked servers?
A. processadmin
B. setupadmin
C. securityadmin
D. serveradmin
Question:-Which of the following statements will return a different value?
A. SELECT YEAR(GETDATE())
B. SELECT DATEPART(Y, GETDATE())
C. SELECT LEFT(CONVERT(VARCHAR(10), GETDATE(), 111), 4)
D. SELECT CONVERT(VARCHAR(4), GETDATE(), 120)
Question:-What is the best data type to store the birthdays of the US Presidents, starting with George Washington's birthday of February 22, 1732?
A. DATETIME
B. SMALLDATETIME
C. INT
D. VARCHAR
Question:-What will be the value of @TodaysDate in the following script?
DECLARE @TodaysDate VARCHAR(10)
SET @TodaysDate = '12/25/2005'
SET @TodaysDate = @TodaysDate + 5
A. 12/25/2010
B. 12/30/2005
C. 04/25/2006
D. An error is generated.
Question:-What line of code should you use to load the data from the database into the DataSet object?
dsHardware = sqlDataAdaptor1.Fill('Hardware')
sqlDataAdaptor1.Fill('dsHardware')
sqlDataAdaptor1.Fill( 'dsHardware', 'Hardware')
sqlDataAdaptor1.Fill(dsHardware, ‘Hardware’)
Question:-You have loaded several thousand records into a DataTable and you now want to filter those records by LastName = ‘Peter'. Which method of the DataTable class could you use?
Site
Select
DisplayExpression
Locale
Question:-The software development team leader has asked you to create a .NET class that reads data from a database. Inside this class you need to use a SqlDataReader to read back any records returned from the database. In some cases there might not be any results returned. What property of the DataReader should you check before attempting to read any records?
HasRows
Depth
FieldCount
RecordsAffected
Question:-As part of a new project for a leading music company, you have created several .NET classes that control database access. You have created a new SQLCommand object that reads the total count of users from the Users table. Which method of the SQLCommand object should you execute to get the result?
MyCommand.ExecuteScalar();
MyCommand.ExecuteReader();
MyCommand.ExecuteNonQuery();
MyCommand.ExecuteXmlReader();
Question:-An application written by your team requires some modifications. One of the modifications is to add an extra query that joins information from two tables. The two tables are; Persons and Addresses. However, you only want to join records if a matching row exists in the Addresses table. Part of the query is shown below:
Select * from Persons p ____ join Addresses a where p.PersonId = a.PersonId
Question:-Which type of join should you use to complete the blank?
Left
Outer
Right
Inner
Question:-You want to include a technique that will help improve the performance and scalability of your .NET application. Which one of the following techniques could help?
Connection Strings
SQL Injection
DataAdaptor
Connection Pooling
Question:-As part of a new .NET project you are required to use transactions to ensure data integrity. You have created a SQLTransaction object using the SQLConnection.BeginTransaction method. If an exception occurs whilst reading the data you want to cancel the transaction to make sure that no changes are committed. Which method of the transaction class should you use?
Cancel
Dispose
Commit
Rollback
Question:-Which of the following design principles is NOT a good practice when developing data driven applications?
Implement error handling
Execute SQL commands using the standard built in sa account
Open and close connections quickly
Follow stateless design practices
Question:-A ___ row is a row that doesn't appear in an initial read, but appears when the same data is read again during the same transaction.
Dirty
Phantom
None of these
Nonrepeatable
Question:-As part of a larger .NET application, you have been assigned with managing data access to and from external systems. To help make the application very responsive, you have decided to use Asynchronous data access. One particular method should retrieve all the sales records that occurred that day. Which method call of the SqlCommand class should you use?
BeginExecuteNonQuery
BeginExecuteReader
ExecuteNonQuery
ExecuteReader
Question:-Which ADO.NET class allows you to specify SQL text to execute, one or more parameters and also choose a specific SQL connection to run against?
SQLDataAdapter
SQLCommand
SQLTransaction
SQLDataReader
Question:-As part of a new .NET project for your company, you have created a data access class that uses a strongly typed dataset. This dataset is based on the Persons table in your database which has columns for FirstName and LastName. If you wanted to change the value of the first persons FirstName in the dataset called dataset1 to ‘Peter', which syntax would you use?
Dataset1.Rows[0][FirstName] = ‘Peter'
Dataset1.Rows[0].FirstName = ‘Peter'
Dataset1.FirstName[0] = ‘Peter'
Dataset1.Rows[0][‘FirstName'] = ‘Peter'
Question:-As part of a new in-house project, you have created several .NET classes that control database access. You have created a new SQLCommand object that reads a list of sales records from the Sales table. You want to read the results in a fast, forward only manner. Which method of the SQLCommand object should you execute?
MyCommand.ExecuteReader();
MyCommand.ExecuteNonQuery();
MyCommand.ExecuteScalar();
MyCommand.ExecuteXmlReader();
You are working on a new in-house project for your company. The project makes extensive use of the System.Data.SqlClient namespace to read and write data to a SQL Server database. You have created an SQLCommand object and set its CommandText property. What must you do before executing the SQLCommand object?
Set the commands timeout property
Set its Site property to the local SQLConnection
Set its Notification property to null
Open the connection for the SQLCommand
Question:-The in-house .NET software team are developing a new video sharing website and you have been assigned with creating the SQL queries. You want to allow users to search in a unique way and exclude patterns from their search results. For a particular search, you want to find all videos where the VideoTitle does NOT begin with the letter z.
Question:-Which SQL where clause should you use to satisfy the requirements?
VideoTitle like ‘[z]%'
VideoTitle like ‘_z%'
VideoTitle like ‘-z%'
VideoTitle like ‘[^z]%'
Asp.NetQuiz