Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 176–200 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 |
|---|---|---|---|---|---|---|---|---|
| 176 | 1432 | D767Q927C0149V09 | 808 | fr | 2 | 2015-11-19 13:27:49 | 2 | 2015-11-19 15:06:58 |
| 177 | 1429 | D736D252Z3041D49 | 814 | fr | 1 | 2015-11-21 13:17:25 | 1 | 2015-11-21 15:08:45 |
| 178 | 1505 | D841H941H0791Q12 | 817 | en | 2 | 2015-11-22 15:10:03 | 2 | 2015-11-22 17:56:28 |
| 179 | 1509 | D127T102L7940A93 | 819 | en | 1 | 2015-11-24 12:07:10 | 1 | 2015-11-24 13:28:53 |
| 180 | 1512 | D347R255R5948E69 | 821 | es | 2 | 2015-11-24 14:13:52 | 3 | 2015-11-24 15:35:03 |
| 181 | 1524 | D767Q927C0149V09 | 828 | en | 2 | 2015-11-28 16:02:00 | 2 | 2015-11-28 17:05:32 |
| 182 | 1529 | D724L458C1162U17 | 832 | pt | 2 | 2015-11-29 11:25:30 | 2 | 2015-11-29 14:28:05 |
| 183 | 1419 | D724L458C1162U17 | 843 | en | 1 | 2015-12-04 10:12:26 | 1 | 2015-12-04 12:35:50 |
| 184 | 1418 | D779R288A0500T96 | 844 | en | 1 | 2015-12-04 10:14:54 | 3 | 2015-12-04 12:16:19 |
| 185 | 1554 | D347R255R5948E69 | 849 | en | 3 | 2015-12-05 12:01:13 | 1 | 2015-12-05 14:35:58 |
| 186 | 1454 | D034Y265X8016K49 | 853 | fr | 2 | 2015-12-06 12:02:00 | 2 | 2015-12-06 13:17:00 |
| 187 | 1561 | D413Q817Y7694B71 | 855 | en | 3 | 2015-12-06 14:51:30 | 2 | 2015-12-06 16:50:22 |
| 188 | 1578 | D080D377C3402T31 | 870 | fr | 3 | 2015-12-11 12:47:14 | 2 | 2015-12-11 14:30:48 |
| 189 | 1581 | D166C398W2353J43 | 874 | fr | 2 | 2015-12-12 15:29:53 | 1 | 2015-12-12 18:10:00 |
| 190 | 1586 | D841H941H0791Q12 | 879 | en | 2 | 2015-12-15 11:03:28 | 3 | 2015-12-15 14:03:45 |
| 191 | 1548 | D586V966T0652S73 | 886 | ru | 3 | 2015-12-18 16:37:03 | 1 | 2015-12-18 18:10:00 |
| 192 | 1604 | D413Q817Y7694B71 | 890 | es | 3 | 2015-12-19 15:48:56 | 3 | 2015-12-19 17:34:04 |
| 193 | 1625 | D034Y265X8016K49 | 904 | fr | 2 | 2015-12-22 15:42:06 | 1 | 2015-12-22 17:16:20 |
| 194 | 1643 | D080D377C3402T31 | 918 | zh | 3 | 2015-12-27 11:40:29 | 3 | 2015-12-27 13:25:32 |
| 195 | 1658 | D779R288A0500T96 | 929 | it | 3 | 2015-12-31 12:58:27 | 2 | 2015-12-31 15:52:23 |
| 196 | 1583 | D127T102L7940A93 | 936 | en | 1 | 2016-01-03 12:46:50 | 1 | 2016-01-03 13:43:28 |
| 197 | 1681 | D424A043K7283P36 | 940 | es | 1 | 2016-01-05 11:24:15 | 2 | 2016-01-05 13:56:48 |
| 198 | 1682 | D034Y265X8016K49 | 941 | es | 1 | 2016-01-05 11:25:50 | 2 | 2016-01-05 14:15:35 |
| 199 | 1661 | D597Q906D6251W67 | 950 | en | 2 | 2016-01-12 12:02:18 | 3 | 2016-01-12 13:48:45 |
| 200 | 1609 | D080D377C3402T31 | 952 | en | 2 | 2016-01-15 15:17:38 | 2 | 2016-01-15 17:06:22 |
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;