SQL Queries

JKSSB Sub-Inspector (Telecommunication) · Database Management Systems · 21 practice questions with answers and explanations: 13 Easy, 8 Medium, 0 Hard.

Sample questions

Sample Easy question 1

Which SQL clause sorts the rows of a result?

  1. SORT BY
  2. GROUP BY
  3. ORDER BY
  4. ARRANGE
Show answer

Answer: C. ORDER BY sorts the output, ascending by default.

Sample Easy question 2

Which SQL keyword removes duplicate rows from a SELECT result?

  1. DISTINCT
  2. NODUP
  3. UNIQUE ROWS
  4. SINGLE
Show answer

Answer: A. SELECT DISTINCT returns each different row once.

Sample Easy question 3

Which function returns the number of rows selected by a query?

  1. TOTAL(*)
  2. SUM(*)
  3. LENGTH(*)
  4. COUNT(*)
Show answer

Answer: D. COUNT(*) counts rows, including those with NULL values.

Sample Medium question 4

Which clause filters groups after GROUP BY has formed them?

  1. HAVING
  2. FILTER
  3. WHERE
  4. LIMIT
Show answer

Answer: A. WHERE filters rows before grouping; HAVING filters groups afterwards, so it can use aggregates.

Sample Medium question 5

Which join returns only the rows that have matching values in both tables?

  1. LEFT JOIN
  2. CROSS JOIN
  3. INNER JOIN
  4. FULL OUTER JOIN
Show answer

Answer: C. INNER JOIN keeps matched rows only.

Sample Medium question 6

What does a LEFT JOIN return?

  1. All rows of the left table and the matching rows of the right table
  2. The rows that match in both tables alone
  3. All rows of the right table alone
  4. The Cartesian product of both tables
Show answer

Answer: A. Unmatched left rows appear with NULLs in the right table's columns.

More Database Management Systems topics for JKSSB Sub-Inspector (Telecommunication)

Related articles