SQL Functions & CASE · Question 6 · Easy

Which standard SQL function converts a value from one data type to another, for example the text '2026' to a number?

  1. CAST
  2. COALESCE
  3. TRIM
  4. ROUND
Answer and explanation

Answer: A. CAST

Explanation: CAST(value AS type) changes the data type of a value. COALESCE replaces NULLs, TRIM removes spaces and ROUND changes the number of decimal places.

Previous: The string literal below has two spaces before Pune and two spaces after it… · Next: What does this query return?

Practise sql functions & case

Try a fresh set of sql functions & case questions with an explanation after every answer, free and without signing up: SQL Functions & CASE practice. Or sit a full placement mock test.

More sql functions & case questions

More sql practice

UNION, INTERSECT & EXCEPT · Tables, Keys & Constraints · DML & Transactions · SELECT, WHERE & ORDER BY · SQL Joins · Aggregates & GROUP BY · Subqueries & CTEs · Window Functions

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge