public.payment
Documentation | Pagila |
Schema | public |
Name | payment |
Module | Business |
The payment table records each payment made by a customer, with information such as the amount and the rental being paid for (when applicable).
The payment table refers to the customer, rental, and staff tables.
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | payment_id | integer | Default: nextval('payment_payment_id_seq'::regclass) | A surrogate primary key used to uniquely identify each payment. | ||||
A surrogate primary key used to uniquely identify each payment. Default: nextval('payment_payment_id_seq'::regclass) |
||||||||
2 | customer_id | smallint | public.customer | The customer whose balance the payment is being applied to. This is a foreign key reference to the customer table. | ||||
The customer whose balance the payment is being applied to. This is a foreign key reference to the customer table. References: public.customer |
||||||||
3 | staff_id | smallint | public.staff | The staff member who processed the payment. This is a foreign key reference to the staff table. | ||||
The staff member who processed the payment. This is a foreign key reference to the staff table. References: public.staff |
||||||||
4 | rental_id | integer | public.rental | The rental that the payment is being applied to. This is optional because some payments are for outstanding fees and may not be directly related to a rental. | ||||
The rental that the payment is being applied to. This is optional because some payments are for outstanding fees and may not be directly related to a rental. References: public.rental |
||||||||
5 | amount | numeric(5, 2) | The amount of the payment. | |||||
The amount of the payment. |
||||||||
6 | payment_date | timestamp without time zone(6) | The date the payment was processed. | |||||
The date the payment was processed. |
Relations
Foreign table | Primary table | Join | Title / Name / Description | |
---|---|---|---|---|
public.payment | public.customer | public.payment.customer_id = public.customer.customer_id | payment_customer_id_fkey Foreign key constraint referencing customer.customer_id |
|
public.payment.customer_id = public.customer.customer_id Name: payment_customer_id_fkeyForeign key constraint referencing customer.customer_id |
||||
public.payment | public.rental | public.payment.rental_id = public.rental.rental_id | payment_rental_id_fkey Foreign key constraint referencing rental.rental_id |
|
public.payment.rental_id = public.rental.rental_id Name: payment_rental_id_fkeyForeign key constraint referencing rental.rental_id |
||||
public.payment | public.staff | public.payment.staff_id = public.staff.staff_id | payment_staff_id_fkey Foreign key constraint referencing staff.staff_id |
|
public.payment.staff_id = public.staff.staff_id Name: payment_staff_id_fkeyForeign key constraint referencing staff.staff_id |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
payment_pkey | payment_id | Primary key. | |
Primary key. |
Uses
Name |
---|
public.payment
|
Used by
Name |
---|
public.payment
|
Exported: 2018-10-12 17:07, Last imported: 2018-08-06 09:25