In the airport information desk the flight departure schedule is kept for the next day. For each flight, the flight number, type of aircraft, destination, time of departure. Print all flight numbers, types of aircraft and time of departure to a given destination in ascending order of departure time.
- 2Olga, indicate: language, platform, development environment, what you yourself have done, what difficulties, what you do not understand. And also: nobody will write the whole program for you here. Only for prepayment. - skegg
|
1 answer
If you use a database with a SQL standard, something like this should come up:
List of flights to Moscow:
SELECT * FROM air_shedule WHERE destination="Moscow" ORDER BY start_time ASC;
All flight numbers:
SELECT DISTINCT race_number FROM air_shedule WHERE 1;
All types of aircraft:
SELECT DISTINCT plane_type FROM air_shedule WHERE 1;
- And the words "WHERE 1" why need? - avp
- Well, the WHERE block seems to be set in syntax, not all databases accept queries without WHERE. Specifically, WHERE 1 is a condition that is simply always met, i.e. select all entries. - hakimovis
- Then why in the first (with ORDER BY) forgot WHERE? - avp
- This is where the ORDER BY is WHERE destination = "Moscow"? - hakimovis
- In fact, I didn’t notice the elephant ... --- In fact, the WHERE block with SQL syntax is not at all mandatory. - avp
|