NEW
Font size
WorksheetsSQLServer_ADO
Total questions: 40
Worksheet time: 14mins
Which of the following is not a aggregate function ?
Avg
Sum
With
Min
Which of the following SQL clauses is used to DELETE record from a database table ?
DELETE
REMOVE
DROP
CLEAR
Which of the following is one of the basic approaches for joining tables?
Subqueries
Union Join
Natural join
All of the Mentioned
Which of the following constraint does not enforce uniqueness ?
UNIQUE
Primary key
Foreign key
None of the mentioned
Select * from employee where salary>10000 and dept_id=101; Which of the following fields are displayed as output?
Salary, dept_id
Employee
Salary
All the field of employee relation
Purpose of foreign key constraint in SQL Server is :
FOREIGN KEY constraints identify and enforce the relationships between tables
A foreign key in one table points to a candidate key in another table
You cannot insert a row with a foreign key value, except NULL, if there is no candidate key with that value
None of the mentioned
What is the full form of SQL
Structured Query Language
Structured Query List
Simple Query Language
None of these
Which is the subset of SQL commands used to manipulate database structures, including tables?
Data Definition Language(DDL)
Data Manipulation Language(DML)
Both of above
None
Which operator performs pattern matching?
BETWEEN operator
LIKE operator
EXISTS operator
None of these
What operator tests column for the absence of data?
EXISTS operator
NOT operator
IS NULL operator
None of these
In SQL, which command(s) is(are) used to change a table's storage characteristics?
ALTER TABLE
MODIFY TABLE
CHANGE TABLE
All of the above
In SQL, which command is used to SELECT only one copy of each set of duplicable rows
SELECT DISTINCT
SELECT UNIQUE
SELECT DIFFERENT
All of the above
Which of the SQL statements is correct?
SELECT Username, Password FROM Users
SELECT Username AND Password FROM Users
SELECT Username, Password WHERE Username = 'user1'
None of these
The FROM SQL clause is used to...
specify range for search condition
specify search condition
specify what table we are selecting or deleting data FROM
None of these
Which SQL keyword is used to retrieve a maximum value?
TOP
MOST
UPPER
MAX
Which of the following is a SQL aggregate function?
LEFT
AVG
JOIN
LEN
Which SQL keyword is used to sort the result-set?
SORT BY
ORDER
ORDER BY
SORT
Find all the cities whose humidity is 89
SELECT city WHERE humidity = 89;
SELECT city FROM weather WHERE humidity = 89;
SELECT humidity = 89 FROM weather;
SELECT city FROM weather;
Find the temperature in increasing order of all cities
SELECT city FROM weather ORDER BY temperature;
SELECT city, temperature FROM weather;
SELECT city, temperature FROM weather ORDER BY temperature;
SELECT city, temperature FROM weather ORDER BY city;
What is the meaning of LIKE '%0%0%'
Feature begins with two 0's
Feature ends with two 0's
Feature has more than two 0's
Feature has two 0's in it, at any position
To use the .NET Framework Data Provider for SQL Server, an application must reference the _____________ namespace.
System.Data.Client
System.Data.SqlClient
System.Data.Sql
None of the mentioned
Valid Code for Creating a SqlConnection Object would be ____________
SqlConnection conn = new SqlConnection(
"Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI");
SqlConnect conn = new SqlConnection(
"Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI");
SqlConnection conn = new SqlConnect(
"Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI");
All of the mentioned
Syntax for closing and opening the connection in ADO.net is _______________
sqlConn.Open() and sqlConn.close()
sqlConn.open() and sqlConn.Close()
sqlConn.Open() and sqlConn.Close()
none of the mentioned
__________object is used to fill a DataSet/DataTable with query results in ADO.net.
Dataset
DataAdapter
DataTables
DataReader
If you are using the DataSet and you have to display the data in sorted order what will you do?
Use Sort method of DataTable
Use Sort method of DataSet
Use DataView object with each sort
Use datapaging and sort the data.
Which of the following is true?
DataTable object contain DataRow and DataColoumn objects
DataSet and DataTable can be binary serialized
DataSet and DataTable can be XML serialized
All of the above
How do you execute multiple SQL statements using a DataReader?
Call the ExecuteReadermethod of two Command objects and assign the results tothe same instance of a DataReader.
Call the ExecuteReadermethod of a single Command object twice.
Set the Command.CommandTextproperty to multiple SQL statements delimited by a semicolon.
Set the Command.CommandTypeproperty to multiple result sets.
What happens when you call the Close method of a connection object?
1) The connection is destroyed
2) The connection is returned to the connection pool.
3) The StateChangeevent is fired.
4) All non - committed pending transactions are rolled back.
1, 2
1,3
2, 3, 4
All of the above
Which SqlCommand execution returns the number of effected records in the table?
ExecuteNonQuery
ExecuteReader
ExecuteXmlReader
ExecuteScalar
Which SqlCommand execution returns the value of the first column of the first row from a table?
ExecuteNonQuery
ExecuteReader
ExecuteXmlReader
ExecuteScalar
Which data provider gives the maximum performance from a connection to SQL Server?
The OLE DB data provider.
The JDBC data provider.
The SqlClient data provider.
The Oracle data provider
What datatype is returned when calling the ExecuteScalar method of a command object?
System.Int32
Object
No. of effected records
None of the above
What are the minimum attribute is required to create a connection string using SqlConnection object?
Data Source, Initial Catalog, Integrated security=true
Server, Database, Integrated security=true
Option 1 and 2 both are correct
None of the above
What are the Command Object Methods?
ExecuteNonQuery
ExecuteReader
ExecuteScalar
All of the above
Choose the correct option about DataSet object.
Provides Disconnected mode
Can store multiple table simultaneously
Both option 1 & 2 are correct
None of the above
Choose the correct option about DataReader object.
DataReader object is a forward-only object.
It provides connection oriented environment.
DataReader is read only object.
All of the above
The three statements are given below about DataSet and DataReader, choose the correct option according to the statement.
Statement 1: DataSet Provides Disconnected environment but DataReader provides Connected environment.
Statement 2: DataSet Provides Connected environment but DataReader provides Disconnected environment.
Statement 3: DataSet Can store multiple table simultaneously but DataReader Supports a single table based on a single SQL query.
Only Statement 1 is correct.
Statement 1 and 2 is correct.
Statement 2 and 3 is correct.
Statement 1 and 3 is correct.
Which ADO.NET class provide Connected Environment?
DataReader
DataSet
Command
None of the above
Which ADO.NET class provide Disconnected Environment?
DataReader
DataSet
Command
None of the above.
What are the three main objects of DataSet?
DataTable, DataColumn, and type.
DataTable, DataRelation, and DataAdapter.
DataTable, DataColumn, and DataRelation.
DataReader,DataAdapter, and Command.
