-
Replication Overview
Explain the Replication overview?
-
Memory Pools
What are the memory pools?
-
Data Reader or Dataset
If you are doing website project, which one is used dataset or data reader? Why?
-
Transaction Isolation Level
What is a transaction isolation level and What is the advantage of it? What are different options that we set for a transaction isolation level?
Transaction isolation levels are used when we go for transactions in stored procedures used in Transact SQL. -
-
SQL Server Transactions
Why Transactions are needed in SQL Server?
-
Fetching records from attributes
How will you fetch records having underscore ( _ ) in the middle of of strings, from columns having attributes as "amit_6", "t_mit06", "am_06", "m_t", "j_x_t" ?
-
Stored Procedure Performance Tuning
How can we improve stored procedure performance? Explain the performance tuning techniques.
-
-
-
Sending Mail
How to send mail from SQL Server?
-
SQL Server Insert and Delete
1. how to insert five rows in a table using single query(in ms-sql or oracle)2.how to delete duplicate values in a table. for example, the table containing five duplicate values(like name rani). i would like to delete all four rows in a table. but not the one row.
-
No Lock
What is 'no lock' term in SQL, like "select * from table a (no lock)". What is its purpose?
-
Call Specific Index in Query
If a table has more than one index, how will you call a specific index in query?
-
Join same fields
How to join same fields of four tables at SQL Server?
-
a. SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC
b. SELECT * FROM Persons SORT REVERSE 'FirstName'
c. SELECT * FROM Persons ORDER BY -'FirstName'
d. SELECT * FROM Persons ORDER BY FirstName DESC
SELECT * FROM Persons ORDER BY DESC FirstName
3)What is the correct SQL syntax for selecting all the columns where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?
a. SELECT * FROM Persons WHERE LastName > 'Hansen', LastName < 'Pettersen'
b. SELECT LastName > 'Hansen' AND LastName < 'Pettersen' FROM Persons
c. SELECT * FROM customers WHERE LastName > 'Hansen' AND LastName > 'Pettersen'
d. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
4)Consider the following queries:
1. select * from employee where department LIKE "[^F-M]%";
2. select * from employee where department = "[^F-M]%";
Select the correct option:
a. Query 2 will return an error
b. Both the queries will return the same set of records
c. Query 2 is perfectly correct
d.Query 2 would return one record less than Query 1
5)Which of the following is not a global variable?
a. @@colcount
b. @@error
c. @@rowcount
d. @@version
e. All are valid global variables
Consider the following two tables:
1. customers( customer_id, customer_name)
2. branch ( branch_id, branch_name )
6)What will be the output if the following query is executed:
Select * branch_name from customers,branch
a. It will return the fields customer_id, customer_name, branch_name
b. It will return the fields customer_id, customer_name, branch_id, branch_name
c. It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name
d. It will return an empty set since the two tables do not have any common field name
e. It will return an error since * is used alone for one table only
7)Which of the following is not a valid Numeric datatypes in SQL Server?
a. INT
b. SMALLINT
c. TINYINT
d. BIGINT
e. MONEY
8)Which of the following datatypes is not supported by SQL-Server?
a. Character
b. Binary
c. Logical
d. Date
e. Numeric
f. All are supported
9)Which of the following are false for batches (batch commands)?
a. Statements in a batch are parsed, compiled and executed as a group
b. None of the statements in the batch is executed if there are any syntax errors in the batch
c. None of the statements in the batch is executed if there are any parsing errors in the batch
d. None of the statements in the batch is executed if there are any fatal errors
in the batch
10) Select the correct option:
a. Optimistic locking is a locking scheme handled by the server, whereas pessimistic locking is handled by the application developer
b. Pessimistic locking is a locking scheme handled by the server, whereas optimistic locking is handled by the application developer
11) How can you view the structure of a table named "myTable" in SQL Server?
a. desc myTable
b. desc table myTable
c. sp_columns myTable
d. None of the above
e. Using either option a or c
12) Which of the following is not a valid binary datatype in SQL Server?
a. BINARY
b. VARBINARY
c. BIT
d. IMAGE
e. TESTAMP
13) Which of the following is false with regards to sp_help?
a. When a procedure name is passed to sp_help, it shows the parameters
b. When a table name is passed to sp_help, it shows the structure of the table
c. When no parameter is passed, it provides a list of all objects and user-defined datatypes in a database
d. All of the above are true
14)Which of the following are false for batches (batch commands)?
a. Statements in a batch are parsed, compiled and executed as a group
b. None of the statements in the batch is executed if there are any syntax errors in the batch
c. None of the statements in the batch is executed if there are any parsing errors in the batch
d. None of the statements in the batch is executed if there are any fatal errors
in the batch
">1)What is the maximum value that can be stored for a datetime field? a. Dec 31, 9999 b. Jun 6, 2079 c. Jan 1, 2753 d. Jan 1, 2100 2)What is the correct SQL syntax for returning all the columns from a table named "Persons" sorted REVERSE alphabetically by "FirstName"? a. SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC b. SELECT * FROM Persons SORT REVERSE 'FirstName' c. SELECT * FROM Persons ORDER BY -'FirstName' d. SELECT * FROM Persons ORDER BY FirstName DESC SELECT * FROM Persons ORDER BY DESC FirstName 3)What is the correct SQL syntax for selecting all the columns where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"? a. SELECT * FROM Persons WHERE LastName > 'Hansen', LastName < 'Pettersen' b. SELECT LastName > 'Hansen' AND LastName < 'Pettersen' FROM Persons c. SELECT * FROM customers WHERE LastName > 'Hansen' AND LastName > 'Pettersen' d. SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen' 4)Consider the following queries:1. select * from employee where department LIKE "[^F-M]%";2. select * from employee where department = "[^F-M]%";Select the correct option: a. Query 2 will return an error b. Both the queries will return the same set of records c. Query 2 is perfectly correct d.Query 2 would return one record less than Query 1 5)Which of the following is not a global variable? a. @@colcount b. @@error c. @@rowcount d. @@version e. All are valid global variables Consider the following two tables:1. customers( customer_id, customer_name)2. branch ( branch_id, branch_name )6)What will be the output if the following query is executed: Select * branch_name from customers,branch a. It will return the fields customer_id, customer_name, branch_name b. It will return the fields customer_id, customer_name, branch_id, branch_name c. It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name d. It will return an empty set since the two tables do not have any common field name e. It will return an error since * is used alone for one table only 7)Which of the following is not a valid Numeric datatypes in SQL Server? a. INT b. SMALLINT c. TINYINT d. BIGINT e. MONEY 8)Which of the following datatypes is not supported by SQL-Server? a. Character b. Binary c. Logical d. Date e. Numeric f. All are supported 9)Which of the following are false for batches (batch commands)? a. Statements in a batch are parsed, compiled and executed as a group b. None of the statements in the batch is executed if there are any syntax errors in the batch c. None of the statements in the batch is executed if there are any parsing errors in the batch d. None of the statements in the batch is executed if there are any fatal errorsin the batch 10) Select the correct option: a. Optimistic locking is a locking scheme handled by the server, whereas pessimistic locking is handled by the application developer b. Pessimistic locking is a locking scheme handled by the server, whereas optimistic locking is handled by the application developer 11) How can you view the structure of a table named "myTable" in SQL Server?a. desc myTable b. desc table myTable c. sp_columns myTable d. None of the above e. Using either option a or c12) Which of the following is not a valid binary datatype in SQL Server?a. BINARY b. VARBINARY c. BIT d. IMAGEe. TESTAMP13) Which of the following is false with regards to sp_help?a. When a procedure name is passed to sp_help, it shows the parameters b. When a table name is passed to sp_help, it shows the structure of the tablec. When no parameter is passed, it provides a list of all objects and user-defined datatypes in a database d. All of the above are true14)Which of the following are false for batches (batch commands)?a. Statements in a batch are parsed, compiled and executed as a group b. None of the statements in the batch is executed if there are any syntax errors in the batch c. None of the statements in the batch is executed if there are any parsing errors in the batchd. None of the statements in the batch is executed if there are any fatal errorsin the batch
-
-
-
-
After trigger
Is there any reason for which we cannot use After trigger with a view?
SQL Server Interview Questions
Ans