Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 376–400 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 |
|---|---|---|---|---|---|---|---|---|
| 376 | 3305 | D736D252Z3041D49 | 1801 | en | 1 | 2016-12-25 12:45:03 | 2 | 2016-12-25 14:30:15 |
| 377 | 3153 | D767Q927C0149V09 | 1802 | en | 1 | 2016-12-25 13:39:55 | 2 | 2016-12-25 15:41:54 |
| 378 | 3152 | D948A201L8911R06 | 1803 | en | 3 | 2016-12-25 13:51:07 | 3 | 2016-12-25 17:02:36 |
| 379 | 3080 | D186L149Z2216U43 | 1807 | nl | 2 | 2016-12-27 10:51:25 | 2 | 2016-12-27 13:18:25 |
| 380 | 3079 | D413Q817Y7694B71 | 1808 | nl | 2 | 2016-12-27 10:59:46 | 2 | 2016-12-27 12:28:18 |
| 381 | 3319 | D347R255R5948E69 | 1814 | fr | 1 | 2016-12-28 09:31:15 | 1 | 2016-12-28 10:38:42 |
| 382 | 3302 | D547F386X8659H60 | 1816 | en | 1 | 2016-12-28 11:13:47 | 1 | 2016-12-28 12:21:43 |
| 383 | 3015 | D462B968Z1112C56 | 1817 | zh | 2 | 2016-12-28 14:43:53 | 2 | 2016-12-28 15:56:32 |
| 384 | 3324 | D841H941H0791Q12 | 1821 | en | 3 | 2016-12-29 11:52:25 | 2 | 2016-12-29 13:23:29 |
| 385 | 3325 | D597Q906D6251W67 | 1828 | en | 3 | 2016-12-31 13:08:54 | 2 | 2016-12-31 14:48:22 |
| 386 | 3329 | D347R255R5948E69 | 1829 | en | 2 | 2016-12-31 13:16:05 | 2 | 2016-12-31 14:37:57 |
| 387 | 3335 | D072X344L7834Y11 | 1839 | fr | 1 | 2017-01-07 09:35:31 | 2 | 2017-01-07 10:59:40 |
| 388 | 3340 | D072X344L7834Y11 | 1840 | en | 3 | 2017-01-07 11:20:18 | 3 | 2017-01-07 14:13:17 |
| 389 | 3337 | D547F386X8659H60 | 1846 | fr | 3 | 2017-01-10 12:10:21 | 3 | 2017-01-10 14:50:35 |
| 390 | 3395 | D166C398W2353J43 | 1853 | en | 2 | 2017-01-12 15:07:22 | 2 | 2017-01-12 18:04:37 |
| 391 | 3403 | D166C398W2353J43 | 1857 | no | 2 | 2017-01-14 16:08:26 | 1 | 2017-01-14 16:57:18 |
| 392 | 3407 | D186L149Z2216U43 | 1863 | fr | 1 | 2017-01-16 11:15:57 | 1 | 2017-01-16 12:28:38 |
| 393 | 3421 | D413Q817Y7694B71 | 1872 | pt | 1 | 2017-01-20 14:44:08 | 2 | 2017-01-20 16:25:15 |
| 394 | 3405 | D034Y265X8016K49 | 1873 | pt | 2 | 2017-01-21 10:16:12 | 1 | 2017-01-21 11:44:39 |
| 395 | 3414 | D462B968Z1112C56 | 1884 | en | 2 | 2017-01-26 10:53:56 | 1 | 2017-01-26 12:17:44 |
| 396 | 3416 | D547F386X8659H60 | 1885 | en | 2 | 2017-01-26 11:12:58 | 3 | 2017-01-26 13:49:46 |
| 397 | 3419 | D186L149Z2216U43 | 1886 | en | 2 | 2017-01-26 11:15:49 | 3 | 2017-01-26 13:27:29 |
| 398 | 3484 | D413Q817Y7694B71 | 1889 | fr | 2 | 2017-01-27 09:34:44 | 3 | 2017-01-27 11:46:29 |
| 399 | 3485 | D166C398W2353J43 | 1892 | en | 1 | 2017-01-27 10:28:55 | 3 | 2017-01-27 12:10:59 |
| 400 | 3479 | D424A043K7283P36 | 1894 | zh | 2 | 2017-01-27 13:43:41 | 1 | 2017-01-27 14:45:34 |
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;