Junior
Таблица PERSON ID NAME 1 alice 2 john 3 bill 4 mike 5 sara 6 helen 7 steven 8 garry 9 kile 10 liza Таблица PHONE ID PERSON_ID NUMBER [phone] select NAME, NUMBER from PERSON p left join PHONE ph on p.ID=ph.PERSON_ID
sobes.tech AI
Answer from AI
This SQL query selects names from the PERSON table and corresponding phone numbers from the PHONE table using a LEFT JOIN. This means that all people from PERSON will be shown, even if they do not have a phone number (in which case the NUMBER field will be NULL).
Example result:
| NAME | NUMBER |
|---|---|
| alice | 123-456-7890 |
| john | NULL |
| bill | 987-654-3210 |
If a person has multiple numbers, there will be a separate row for each number with their name.