Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 201–225 of 1,085
| hire_idINTEGER | ticket_id→ ticket.ticket_id | serial_number→ audio_guide_device.serial_number | order_id→ purchase_order.order_id | language_code→ language.language_code | issued_wing_id→ wing.wing_id | issued_atTEXT | returned_wing_id→ wing.wing_id | returned_atTEXT |
|---|---|---|---|---|---|---|---|---|
| 201 | 1736 | D843X661P8223W21 | 957 | en | 2 | 2016-01-18 10:11:49 | 2 | 2016-01-18 12:33:09 |
| 202 | 1751 | D779R288A0500T96 | 962 | pt | 2 | 2016-01-22 10:47:26 | 1 | 2016-01-22 13:32:00 |
| 203 | 1753 | D586V966T0652S73 | 965 | en | 3 | 2016-01-23 09:32:43 | 1 | 2016-01-23 11:23:15 |
| 204 | 1757 | D265V521D1968K75 | 967 | en | 1 | 2016-01-23 11:30:58 | 1 | 2016-01-23 13:03:38 |
| 205 | 1760 | D767Q927C0149V09 | 969 | ru | 3 | 2016-01-23 12:22:56 | 1 | 2016-01-23 14:02:17 |
| 206 | 1772 | D767Q927C0149V09 | 982 | pl | 1 | 2016-02-04 12:41:47 | 1 | 2016-02-04 13:53:28 |
| 207 | 1780 | D424A043K7283P36 | 986 | fr | 2 | 2016-02-07 11:34:46 | 2 | 2016-02-07 13:54:37 |
| 208 | 1781 | D080D377C3402T31 | 988 | fr | 3 | 2016-02-07 13:42:58 | 2 | 2016-02-07 15:18:01 |
| 209 | 1783 | D586V966T0652S73 | 991 | en | 2 | 2016-02-09 12:43:07 | 1 | 2016-02-09 14:50:25 |
| 210 | 1782 | D736D252Z3041D49 | 992 | en | 2 | 2016-02-09 12:50:26 | 2 | 2016-02-09 13:44:39 |
| 211 | 1794 | D586V966T0652S73 | 999 | fr | 2 | 2016-02-14 16:31:58 | 2 | 2016-02-14 17:55:36 |
| 212 | 1796 | D547F386X8659H60 | 1000 | sv | 2 | 2016-02-14 16:38:16 | 1 | 2016-02-14 18:10:00 |
| 213 | 1800 | D186L149Z2216U43 | 1003 | en | 2 | 2016-02-16 09:55:13 | 3 | 2016-02-16 11:02:16 |
| 214 | 1813 | D724L458C1162U17 | 1009 | ru | 2 | 2016-02-18 11:53:57 | 1 | 2016-02-18 13:32:16 |
| 215 | 1778 | D424A043K7283P36 | 1010 | pt | 2 | 2016-02-18 13:42:53 | 3 | 2016-02-18 15:32:33 |
| 216 | 1831 | D843X661P8223W21 | 1022 | fr | 2 | 2016-02-25 13:54:54 | 3 | 2016-02-25 16:24:49 |
| 217 | 1773 | D424A043K7283P36 | 1023 | ko | 2 | 2016-02-26 11:07:28 | 1 | 2016-02-26 12:50:17 |
| 218 | 1824 | D177W168C4167Y04 | 1037 | fr | 2 | 2016-03-05 13:22:17 | 1 | 2016-03-05 16:05:43 |
| 219 | 1878 | D597Q906D6251W67 | 1048 | en | 3 | 2016-03-09 13:18:18 | 1 | 2016-03-09 15:30:28 |
| 220 | 1871 | D724L458C1162U17 | 1050 | en | 2 | 2016-03-10 12:51:27 | 2 | 2016-03-10 14:00:45 |
| 221 | 1889 | D948A201L8911R06 | 1054 | fr | 3 | 2016-03-12 17:08:53 | 1 | 2016-03-12 18:10:00 |
| 222 | 1882 | D413Q817Y7694B71 | 1060 | en | 2 | 2016-03-16 11:49:34 | 2 | 2016-03-16 13:33:25 |
| 223 | 1886 | D080D377C3402T31 | 1061 | en | 2 | 2016-03-16 12:07:25 | 2 | 2016-03-16 13:14:11 |
| 224 | 1874 | D597Q906D6251W67 | 1062 | ko | 3 | 2016-03-16 13:08:29 | 3 | 2016-03-16 14:21:16 |
| 225 | 1960 | D547F386X8659H60 | 1068 | en | 2 | 2016-03-19 15:31:19 | 3 | 2016-03-19 17:21:19 |
Table definition
CREATE TABLE audio_guide_hire (
hire_id INTEGER PRIMARY KEY,
ticket_id INTEGER NOT NULL REFERENCES ticket (ticket_id),
serial_number TEXT NOT NULL REFERENCES audio_guide_device (serial_number),
order_id INTEGER NOT NULL UNIQUE REFERENCES purchase_order (order_id),
language_code TEXT NOT NULL REFERENCES language (language_code),
issued_wing_id INTEGER NOT NULL REFERENCES wing (wing_id),
issued_at TEXT NOT NULL,
returned_wing_id INTEGER REFERENCES wing (wing_id),
returned_at TEXT,
CHECK ((returned_at IS NULL) = (returned_wing_id IS NULL)),
CHECK (returned_at IS NULL OR returned_at > issued_at)
) STRICT;