staff_list (view)
2 rows
This data as json, xlsx, CSV (advanced)
| ID | name | address | zip_code | phone | city | country | SID |
|---|---|---|---|---|---|---|---|
| 1 | Mike Hillyer | 23 Workhaven Lane | Lethbridge | Canada | 1 | ||
| 2 | Jon Stephens | 1411 Lillydale Drive | Woodridge | Australia | 2 |
Advanced export
JSON shape: default, array, newline-delimited
CREATE VIEW staff_list
AS
SELECT s.staff_id AS ID,
s.first_name||' '||s.last_name AS name,
a.address AS address,
a.postal_code AS zip_code,
a.phone AS phone,
city.city AS city,
country.country AS country,
s.store_id AS SID
FROM staff AS s JOIN address AS a ON s.address_id = a.address_id JOIN city ON a.city_id = city.city_id
JOIN country ON city.country_id = country.country_id;