What is the result of following SQL Query?

Answers (b) and (d) are totally wrong. The query won’t return any rows from TableA. If there are any matching rows are found in TableA, those rows get excluded by the condition in the WHERE clause. (Note that any value of columnName that satisfies the equality comparison in the ON clause will be non-NULL, and … Read more

How can I round a value in SQL

ROUND documentation on MSDN select [raw] = 555.81, [rounded] = round(555.81, 0), [truncated] = round(555.81, 0, 1) Result: | raw | rounded | truncated | |——–|———|———–| | 555.81 | 556 | 555 | SQL Fiddle: http://sqlfiddle.com/#!6/9eecb7db59d16c80417c72d1/5290

How to get percentages of maximum counts?

SELECT TeamName, Count(TeamName) AS Count FROM table GROUP BY TeamName You need to use the Count Function – To count the team name And you need to use group by to determine how you want the counts to be grouped Edited Answer. SELECT TeamName, Count(DISTINCT CASE WHEN WorkInfo = 1 THEN SlNo end) AS Count1 … Read more