Question 9
In the office table, the city column is structured as shown:
Mysql> show columns from office like ‘city’\G
---------------------------------------------------1. row ---------------------__________________
Field: city
Type: enum(‘paris’.’Amsterdam’.’New York’.’Tokyo’)
Null: Yes
Key:
Default:NULL
Extra:
Consider the output of the SELECT query executed on the office table:
Mysql> SELECT DISTINCT city FROM office ORDER BY city:
If the query is written as:
SELECT DISTINCT city FROM office ORDER BY CAST(city AS CHAR)
In what order are the rows returned?
Paris, Amsterdam. New York, Tokyo
Tokyo, New York, Amsterdam, Paris
Amsterdam, New York, Paris, Tokyo
Tokyo, Paris, New York, Amsterdam
Correct answer: C