public.customer_list
| Documentation | Pagila |
| Schema | public |
| Name | customer_list |
| Module | Views |
The customer_list view provides a list of customers, with first name and last name concatenated together and address information combined into a single view.
The customer_list view incorporates data from the customer, address, city, and country tables.
Columns
| Key | Name | Data type | Null | Attributes | References | Description | ||
|---|---|---|---|---|---|---|---|---|
| 1 | id | integer | The customer ID. | |||||
| The customer ID. |
||||||||
| 2 | name | text | The customer's full name. | |||||
| The customer's full name. |
||||||||
| 3 | address | character varying(50) | The customer's address. | |||||
| The customer's address. |
||||||||
| 4 | zip code | character varying(10) | The postal code or ZIP code of the address. | |||||
| The postal code or ZIP code of the address. |
||||||||
| 5 | phone | character varying(20) | The telephone number for the address. | |||||
| The telephone number for the address. |
||||||||
| 6 | city | character varying(50) | Name of the city. | |||||
| Name of the city. |
||||||||
| 7 | country | character varying(50) | The name of the country. | |||||
| The name of the country. |
||||||||
| 8 | notes | text | Indicates whether the customer is an active customer. | |||||
| Indicates whether the customer is an active customer. |
||||||||
| 9 | sid | smallint | The ID of customer's “home store.” | |||||
| The ID of customer's “home store.” |
||||||||
Uses
| Name |
|---|
|
public.customer_list
|
Script
SELECT cu.customer_id AS id, (((cu.first_name)::text || ' '::text) || (cu.last_name)::text) AS name, a.address, a.postal_code AS "zip code", a.phone, city.city, country.country, CASE WHEN cu.activebool THEN 'active'::text ELSE ''::text END AS notes, cu.store_id AS sid FROM (((customer cu JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); |
Exported: 2018-10-12 17:07, Last imported: 2018-08-06 09:25
