Tags

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,


T-SQL Output Query | [ The Count Puzzle ]

Please go through the sample data and underline queries. You have to provide outputs of the queries.

--

CREATE TABLE testCounts
(
	ID INT
)
GO

INSERT INTO testCounts VALUES ( 100 )
GO 10000

--

In the above statements I have created a table and inserted 10000 rows into it. Now I have written SQL statements to fetch total number of rows from the table.

--

SELECT COUNT(1) FROM dbo.testCounts

SELECT COUNT(-1) FROM dbo.testCounts

SELECT COUNT(*) FROM dbo.testCounts

SELECT COUNT(100) FROM dbo.testCounts

SELECT COUNT(10001) FROM dbo.testCounts

SELECT COUNT('Pawan') FROM dbo.testCounts

SELECT COUNT(' ') FROM dbo.testCounts

--

Provide output of all the queries given above ! All the best !!

Enjoy! Cheers

Pawan Kumar Khowal

MSBISKills.com

Advertisements