Northwind › Views
Customer and Suppliers by City view
120 rows. A view stores a SELECT statement, not rows: each time you open it, SQLite runs the query again.
Columns
| # | Name | Type | Not null | Default | Key | References |
|---|---|---|---|---|---|---|
| 0 | City |
TEXT |
no | — | ||
| 1 | CompanyName |
TEXT |
no | — | ||
| 2 | ContactName |
TEXT |
no | — | ||
| 3 | Relationship |
(none) | no | — |
Definition
CREATE VIEW "Customer and Suppliers by City" AS
SELECT City, CompanyName, ContactName, 'Customers' AS Relationship FROM Customers
UNION
SELECT City, CompanyName, ContactName, 'Suppliers' FROM Suppliers