Tags
Advanced SQL tutorial pdf, Count puzzle, Count(*) VS Count(ColumnName) VS Count(1), Define below transformation in DFD?, Difference between Cached Report and Snapshot Report, Download SQL Questions, Download SQL Server Interview Question in PDF, Download SQL SERVER Interview questions, Download SQL Server Interview questions and answers, download sql server interview questions and answers pdf, download sql server interview questions by Pawan Khowal, download sql server interview questions by Pawan Kumar, download sql server interview questions by Pawan Kumar Khowal, Download T-SQL Interview Questions, Free Download SQL SERVER Interview questions, How to make connection with a FTP server?, How to show "No Data Found" Message to end user?, SQL, sql - Count(*) vs Count(1), sql - COUNT(*) vs. COUNT(1) vs. COUNT(pk): which is better?, SQL Best Practice: count(1) or count(*), SQL Common Interview Questions, SQL Common Interview Questions and answers, SQL count puzzle, SQL FAQ, SQL FAQs, SQL Interview Q & A, SQL Interview Questions, SQL Queries asked in interviews, SQL Questions, SQL Server - General Interview Questions and Answers, SQL Server developer Interview questions and answers, SQL Server developer Interview questions with answers, SQL SERVER Indexes, SQL SERVER Interview questions, SQL SERVER Interview questions & Answers, SQL Server Interview questions and answers, SQL Server Interview Questions and Answers - Free PDF, sql server interview questions and answers for net developers, SQL SERVER Tips, SQL Tips & Tricks, SQL Tips and Tricks, SQL Tricks, T-SQL Output Query | [ The Count Puzzle ], T-SQL Server Interview Questions
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
You must be logged in to post a comment.