Hi! Could we please enable some services and cookies to improve your experience and our website?
Privacy & Cookie Policy.Greetings, SQL lovers!
I am writing to you today because I need your help.
SQLtest.online is a free platform designed to help people of all levels master SQL.How you can help:
The more people use the platform, the better it will become. We'll be able to add more content, improve features, and create a better community for SQL enthusiasts.
Thanks for your help!
Command SQLtest.online
Find the median booking amount in July 2017, according to the total_amount column of the bookings table. Display the result in the median_amount column. The median is the value such that half of the records have an amount lower than the specified value and the other half have an amount higher than it.
Use PostgreSQL syntax to write your answer. Descriptions of tables are provided in the right pane.
Write your request in the field below and click the "Check it!" button.
Telegram
💡 Channel for database developers: Oracle, PostgreSQL
📌 Tasks, code, best practices, architecture, optimization
🔄 Join the community — grow with us!
ER diagram of the Bookings database
| aircraft_code | model | range | |
|---|---|---|---|
| 1 | 773 | {"en": "Boeing 777-300", "ru": "Боинг 777-300"} | 11100 |
| airport_code | airport_name | city | coordinates | timezone | |
|---|---|---|---|---|---|
| 1 | YKS | {"en": "Yakutsk Airport", "ru": "Якутск"} | {"en": "Yakutsk", "ru": "Якутск"} | (129.77099609375,62.0932998657227) | Asia/Yakutsk |
| ticket_no | flight_id | boarding_no | seat_no | |
|---|---|---|---|---|
| 1 | 0005435212351 | 30625 | 1 | 2D |
| book_ref | book_date | total_amount | |
|---|---|---|---|
| 1 | 00000F | 2017-07-05 00:12:00+00 | 265700.00 |
| flight_id | flight_no | scheduled_departure | scheduled_arrival | departure_airport | arrival_airport | status | aircraft_code | actual_departure | actual_arrival | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1185 | PG0134 | 2017-09-10 06:50:00+00 | 2017-09-10 11:55:00+00 | DME | BTK | Scheduled | 319 |
| aircraft_code | seat_no | fare_conditions | |
|---|---|---|---|
| 1 | 319 | 2A | Business |
| ticket_no | flight_id | fare_conditions | amount | |
|---|---|---|---|---|
| 1 | 0005432159776 | 30625 | Business | 42100.00 |
| ticket_no | book_ref | passenger_id | passenger_name | contact_data | |
|---|---|---|---|---|---|
| 1 | 0005432000987 | 06B046 | 8149 604011 | VALERIY TIKHONOV | {"phone": "+70127117011"} |