Thanks so much guys! That solved my problem..
I have another question..
Find the names of all restaurants together with the names of diners who visit the restaurants on 24 April 2011. IF no diner visited a restaurant on the day, include a name of restaurant with no value in column DINER. Order the output by the name of the restaurant.
SQL> select * from foodorders;
DINER RESTAURANT ODATE FOOD
------------------------------ ------------------------------ --------- ------------------------------
JAMES LONGEST BEACH 29-APR-11 GRILLED FISH
JAMES LONGEST BEACH 29-APR-11 BUTTER LOBSTER
JAMES LONGEST BEACH 29-APR-11 CHILI CRAB
JAMES BY THE BEACH 19-APR-11 GRILLED FISH
JAMES BY THE BEACH 19-APR-11 BAKED SALMON
JAMES BY THE BEACH 19-APR-11 BUTTER LOBSTER
JAMES BY THE BEACH 19-APR-11 CHILI CRAB
ROBERT BEST FOOD 01-MAY-11 GRILLED FISH
ROBERT BEST FOOD 01-MAY-11 CHICKEN CHOP
ROBERT BEST FOOD 01-MAY-11 PORK CHOP
ALICE LONGEST BEACH 29-APR-11 BAKED SALMON
DINER RESTAURANT ODATE FOOD
------------------------------ ------------------------------ --------- ------------------------------
ALICE LONGEST BEACH 29-APR-11 PEPPER CRAB
ROBERT BY THE BEACH 29-APR-11 BAKED SALMON
BOB BY THE BEACH 29-APR-11 BAKED SALMON
BOB BY THE BEACH 29-APR-11 CHILI CRAB
CHALIE BY THE BEACH 29-APR-11 GRILLED FISH
CHALIE BY THE BEACH 29-APR-11 GRILLED FISH
DONNY BY THE BEACH 29-APR-11 PEPPER CRAB
DONNY BY THE BEACH 29-APR-11 CHILI CRAB
PETER LONGEST BEACH 28-APR-11 BAKED SALMON
PETER LONGEST BEACH 28-APR-11 PEPPER CRAB
JANE LONGEST BEACH 28-APR-11 PEPPER CRAB
DINER RESTAURANT ODATE FOOD
------------------------------ ------------------------------ --------- ------------------------------
ALICE BEST FOOD 09-APR-11 BAKED SALMON
ALICE BEST FOOD 09-APR-11 GRILLED FISH
JAMES FANTASTIC CRAB 08-MAY-11 PEPPER CRAB
JAMES FANTASTIC CRAB 08-MAY-11 CHILI CRAB
LUKE ALL THE BEST 19-APR-11 HERBAL CHICKEN CHOP
LUKE ALL THE BEST 19-APR-11 LAMB CHOP
KATE ALL THE BEST 01-MAY-11 HERBAL CHICKEN CHOP
KATE ALL THE BEST 01-MAY-11 CHICKEN CHOP
KATE ALL THE BEST 01-MAY-11 PORK CHOP
ROBERT BY THE BEACH 28-APR-11 GRILLED FISH
BOBBY BY THE BEACH 28-APR-11 GRILLED FISH
DINER RESTAURANT ODATE FOOD
------------------------------ ------------------------------ --------- ------------------------------
BOBBY BY THE BEACH 28-APR-11 PEPPER CRAB
BOBBY BY THE BEACH 28-APR-11 BAKED SALMON
DAHLIA FANTASTIC CRAB 29-APR-11 PEPPER CRAB
DAHLIA FANTASTIC CRAB 29-APR-11 CHILI CRAB
DAHLIA FANTASTIC CRAB 29-APR-11 CHILI CRAB
38 rows selected.
Above is the full table contents.
I've done the first part of the query:
SQL> SELECT RESTAURANT, DINER
2 FROM FOODORDERS
3 WHERE ODATE='24-APR-2011'
4 ORDER BY RESTAURANT;
no rows selected
What does the IF part of the question there means?
How am I suppose to show something that don't exist??
Thanks in advance!