public.sales
| Documentation | Tickit | 
| Name | sales | 
| Module | Tickit diagram | 
Each row represents a sale of one or more tickets for a specific event, as offered in a specific listing.
Columns
            | Key | Name | Data type | Null | Attributes | References | Description | ||
|---|---|---|---|---|---|---|---|---|
| 1 | salesid | integer | Primary key, a unique ID value for each row. Each row represents a sale of one or more tickets for a specific event, as offered in a specific listing. | |||||
| Primary key, a unique ID value for each row. Each row represents a sale of one or more tickets for a specific event, as offered in a specific listing. | 
                  ||||||||
| 2 | listid | integer | Foreign-key reference to the LISTING table | |||||
| Foreign-key reference to the LISTING table | 
                  ||||||||
| 3 | sellerid | integer | public.users | Foreign-key reference to the USERS table (the user who sold the tickets). | ||||
| Foreign-key reference to the USERS table (the user who sold the tickets). References: public.users  | 
                  ||||||||
| 4 | buyerid | integer | public.users | Foreign-key reference to the USERS table (the user who bought the tickets). | ||||
| Foreign-key reference to the USERS table (the user who bought the tickets).  References: public.users  | 
                  ||||||||
| 5 | eventid | integer | public.event | Foreign-key reference to the EVENT table. | ||||
| Foreign-key reference to the EVENT table.  References: public.event  | 
                  ||||||||
| 6 | dateid | smallint | Foreign-key reference to the DATE table. | |||||
| Foreign-key reference to the DATE table. | 
                  ||||||||
| 7 | qtysold | smallint | The number of tickets that were sold, from 1 to 8. (A maximum of 8 tickets can be sold in a single transaction.) | |||||
| The number of tickets that were sold, from 1 to 8. (A maximum of 8 tickets can be sold in a single transaction.)  | 
                  ||||||||
| 8 | pricepaid | numeric | The total price paid for the tickets, such as 75.00 or 488.00. The individual price of a ticket is PRICEPAID/QTYSOLD. | |||||
| The total price paid for the tickets, such as 75.00 or 488.00. The individual price of a ticket is PRICEPAID/QTYSOLD. | 
                  ||||||||
| 9 | commission | numeric | The 15% commission that the business collects from the sale, such as 11.25 or 73.20. The seller receives 85% of the PRICEPAID value. | |||||
| The 15% commission that the business collects from the sale, such as 11.25 or 73.20. The seller receives 85% of the PRICEPAID value. | 
                  ||||||||
| 10 | saletime | timestamp without time zone | The full date and time when the sale was completed, such as 2008-05-24 06:21:47. | |||||
| The full date and time when the sale was completed, such as 2008-05-24 06:21:47. | 
                  ||||||||
Relations
            | Foreign table | Primary table | Join | Title / Name / Description | |
|---|---|---|---|---|
| public.sales | public.event | public.sales.eventid = public.event.eventid | fk_event_sales | |
| 
                       public.sales.eventid = public.event.eventid Name: fk_event_sales | 
                  ||||
| public.sales | public.users | public.sales.sellerid = public.users.userid | fk_users_sales | |
| 
                       public.sales.sellerid = public.users.userid Name: fk_users_sales | 
                  ||||
| public.sales | public.users | public.sales.buyerid = public.users.userid | fk_users_sales | |
| 
                       public.sales.buyerid = public.users.userid Name: fk_users_sales | 
                  ||||
| public.date | public.sales | public.date.dateid = public.sales.dateid | fk_date_sales | |
| 
                       public.date.dateid = public.sales.dateid Name: fk_date_sales | 
                  ||||
| public.listing | public.sales | public.listing.listid = public.sales.listid | fk_listing_sales | |
| 
                       public.listing.listid = public.sales.listid Name: fk_listing_sales | 
                  ||||
Unique keys
            | Key name | Columns | Description | |
|---|---|---|---|
| pk_sales | salesid | 
Uses
            | Name | 
|---|
| 
                       public.sales 
                       | 
                  
Used by
            | Name | 
|---|
| 
                       public.sales 
                       | 
                  
        Exported: 2018-10-12 23:27, Last imported: 2018-10-01 10:44
