← Back to SELECT Basics
Question 41
Second-Floor Offices and Monthly Pay
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). Returnfirst_name,last_name,officeandmonthly_pay(thesalarydivided by 12, rounded to 2 decimals) for instructors whose office is a three-digit room on floor 2, using aLIKEpattern in which_pins down each character position. Sort bymonthly_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
Sign in to use hintsTopics:
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.