Thursday, July 22, 2010

Basic questions on SELECT statement

1. Which of the following data types cannot be used with ORDER BY clause.

(a) Text
(b) ntext
(c) Image
(d) xml


2. Which of the following can’t be used in an indexed view?

(a) Getdate()
(b) DateDiff()
(c) HOUR()
(d) MINUTE()

3. To get cartesian product from two tables, what type of join you will use.

(a) Outer Join
(b) Full Join
(c) Cross Join
(d) Self-Join

4. What data type allows you to use upto 2 GB and allow you to use operators and functions.

(a) Binary
(b) Varbinary
(c) Varchar
(d) Varchar(max)

5. Select EmployeeID,
convert (Varchar, DateOfJoining, 101) AS DateOfJoining
FROM Employee
ORDER BY DateOfJoining


When executing the above query, if dates considered were 07/01/2010 and 08/01/2009, which date will appear first.

(a) 08/01/2009
(b) 07/01/2010

6. Select EmployeeID,
convert (Varchar, DateOfJoining, 101) AS [Date Of Joining]
FROM Employee
ORDER BY DateOfJoining


When executing the above query, if dates considered were 07/01/2010 and 08/01/2009, which date will appear first.

(a) 08/01/2009
(b) 07/01/2010

Show Answers:

2 comments: