CJCoding With Joseph
15free / daySign inCreate account

Second-Floor Offices and Monthly Pay

Office codes are a letter, a dash and a room number whose first digit is the floor, but the number is not always three digits long (K-1502, S-12). Return first_name, last_name, office and monthly_pay (the salary divided by 12, rounded to 2 decimals) for instructors whose office is a three-digit room on floor 2, using a LIKE pattern in which _ pins down each character position. Sort by monthly_pay, highest first.

Expected result:

+------------+-----------+--------+-------------+
| first_name | last_name | office | monthly_pay |
+------------+-----------+--------+-------------+
| Grace      | Okafor    | T-210  |     8208.33 |
| Mei        | Chen      | T-218  |     7333.33 |
| Daniel     | Reyes     | T-214  |     6833.33 |
+------------+-----------+--------+-------------+
3 rows
Hints4 available
Topics:
SELECT Basics
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)

Results

Run your SQL to see every statement's output here, then how it compares with the expected answer.

Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns — or open the database browser on the left.