It's me again - I have a new homework and I don't get any further.
The task is:
Find out the date of flight(DATE_FLY), flight number(FLY_NR), manufacturer(MANUF), type (TYP) and serial number (SER_NR) of all flights that fly from Frankfurt to Dallas between 10.11.2013 and 20.11.2013.
This is the departure_table:
| DATE_FLY | FLY_NR | MANUF | TYP | PER_NR | SER_NR | TIME_START |
|---|---|---|---|---|---|---|
| 06.07.13 | LH-888 | Boeing | B747 | 9fg-he-ztu8 | 10010071 | 11.23 |
| 08.10.13 | LH-238 | Airbus | A320 | z3et-bwe7 | 10010072 | 22.06 |
| 13.11.13 | LH-341 | Boeing | B737 | ba23-0012 | 10010001 | 10.23 |
| 14.11.13 | LH-358 | Boeing | B737 | ba23-0012 | 10010001 | 8.17 |
| 13.11.13 | LH-553 | Boeing | B777 | xv23-0889 | 10010002 | 16.53 |
| 15.11.13 | LH-421 | Boeing | B777 | xv56-3142 | 10010002 | 14.45 |
| 17.11.13 | LH-789 | Airbus | A330 | 45-6789 | 10010003 | 8.11 |
| 14.11.13 | LH-112 | Boeing | B737 | ba23-0034 | 10010001 | 8.14 |
| 17.11.13 | LH-421 | Boeing | B777 | xv23-0889 | 10010002 | 16.26 |
| 18.11.13 | LH-223 | Airbus | A380 | ab-45-6xf | 10010004 | 9.45 |
| 19.11.13 | LH-634 | Airbus | A350 | 5478-awe3 | 10010005 | 20.25 |
| 18.02.14 | LH-238 | Airbus | A320 | z3et-bwe7 | 10010072 | 23.06 |
And this is the fly_table that I need to join:
| FLY_NR | START_FLY | DEST_FLY | TIME_FLY | KM |
|---|---|---|---|---|
| LH-341 | Saarbruecken | Hamburg | 1.2 | 490 |
| LH-358 | Saarbruecken | Leipzig | 1.1 | 430 |
| LH-553 | Leipzig | Hamburg | .5 | 290 |
| LH-112 | Luxemburg | London | 1.1 | 480 |
| LH-421 | Luxemburg | Ankara | 2.5 | 2300 |
| LH-789 | Luxemburg | New-York | 3.5 | 8300 |
| LH-223 | Frankfurt | Dallas | 3.9 | 8600 |
| LH-634 | Frankfurt | Moskau | 2.3 | 2020 |
| LH-888 | Frankfurt | Peking | 9.5 | 7780 |
| LH-238 | Muenchen | Berlin | 1.1 | 479 |
I wrote the following query but it showed me "no data found":
select
dp.date_fly, dp.fly_nr, dp.manuf, dp.typ, dp.ser_nr
from
departure_table dp, fly_table fl
where
dp.fly_nr = fl.fly_nr
and start_fly = 'Frankfurt'
and dest_fly = 'Dallas'
and dp.date_fly between 10.11.2013 and 20.11.2013;
I've tried a simple join but I still only got the message "no data found":
select
dp.date_fly, dp.fly_nr, dp.manuf, dp.typ, dp.ser_nr
from
departure_table dp, fly_table fl
where
dp.fly_nr = fl.fly_nr;
I don't know what am I doing wrong... I would be very thankful if somebody could help to solve this problem with the join function.
I need to get this result:
| DATE_FLY | FLY_NR | MANUF | TYP | SER_NR |
|---|---|---|---|---|
| 18-NOV-13 | LH-223 | Airbus | A380 | 10010004 |
Thank you!