Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 26–50 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 |
|---|---|---|---|---|---|---|---|---|
| 26 | 284 | D779R288A0500T96 | 136 | zh | 2 | 2015-04-17 12:41:21 | 3 | 2015-04-17 14:09:18 |
| 27 | 253 | D034Y265X8016K49 | 137 | en | 3 | 2015-04-17 17:13:43 | 3 | 2015-04-17 18:10:00 |
| 28 | 323 | D547F386X8659H60 | 160 | zh | 1 | 2015-04-24 16:31:56 | 2 | 2015-04-24 18:10:00 |
| 29 | 307 | D072X344L7834Y11 | 164 | fr | 1 | 2015-04-26 11:07:15 | 2 | 2015-04-26 14:04:21 |
| 30 | 331 | D127T102L7940A93 | 166 | es | 2 | 2015-04-26 13:32:43 | 3 | 2015-04-26 15:18:10 |
| 31 | 348 | D843X661P8223W21 | 175 | en | 3 | 2015-04-29 12:27:36 | 1 | 2015-04-29 13:59:05 |
| 32 | 360 | D948A201L8911R06 | 181 | zh | 2 | 2015-05-01 10:31:45 | 3 | 2015-05-01 11:59:05 |
| 33 | 359 | D736D252Z3041D49 | 182 | zh | 2 | 2015-05-01 10:32:22 | 2 | 2015-05-01 11:39:17 |
| 34 | 357 | D841H941H0791Q12 | 184 | en | 2 | 2015-05-01 11:54:50 | 2 | 2015-05-01 13:02:43 |
| 35 | 309 | D191E591F4947H41 | 185 | en | 2 | 2015-05-01 13:46:53 | 1 | 2015-05-01 15:32:16 |
| 36 | 336 | D166C398W2353J43 | 187 | zh | 2 | 2015-05-02 11:38:45 | 3 | 2015-05-02 14:17:44 |
| 37 | 426 | D413Q817Y7694B71 | 191 | en | 1 | 2015-05-03 10:10:19 | 2 | 2015-05-03 11:15:05 |
| 38 | 425 | D127T102L7940A93 | 192 | fr | 2 | 2015-05-03 10:19:41 | 1 | 2015-05-03 12:41:10 |
| 39 | 294 | D186L149Z2216U43 | 195 | fi | 2 | 2015-05-04 09:44:14 | 1 | 2015-05-04 11:02:03 |
| 40 | 436 | D547F386X8659H60 | 198 | en | 1 | 2015-05-05 10:40:51 | 1 | 2015-05-05 13:34:12 |
| 41 | 346 | D265V521D1968K75 | 204 | fr | 2 | 2015-05-07 11:09:39 | 1 | 2015-05-07 12:46:04 |
| 42 | 350 | D462B968Z1112C56 | 216 | fr | 2 | 2015-05-12 11:19:02 | 3 | 2015-05-12 12:51:39 |
| 43 | 512 | D347R255R5948E69 | 220 | zh | 3 | 2015-05-13 15:01:18 | 2 | 2015-05-13 17:07:59 |
| 44 | 535 | D127T102L7940A93 | 229 | en | 2 | 2015-05-16 09:58:12 | 2 | 2015-05-16 11:17:44 |
| 45 | 541 | D767Q927C0149V09 | 237 | zh | 2 | 2015-05-18 10:35:31 | 2 | 2015-05-18 12:46:30 |
| 46 | 542 | D347R255R5948E69 | 238 | zh | 1 | 2015-05-18 10:36:49 | 1 | 2015-05-18 12:32:37 |
| 47 | 550 | D724L458C1162U17 | 245 | en | 3 | 2015-05-20 15:56:28 | 3 | 2015-05-20 16:47:36 |
| 48 | 601 | D586V966T0652S73 | 251 | zh | 2 | 2015-05-21 14:20:00 | 3 | 2015-05-21 16:07:01 |
| 49 | 602 | D948A201L8911R06 | 253 | fr | 2 | 2015-05-22 10:15:37 | 3 | 2015-05-22 12:12:39 |
| 50 | 320 | D191E591F4947H41 | 254 | it | 2 | 2015-05-22 10:59:42 | 2 | 2015-05-22 12:27:49 |
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;