Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 451–475 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 |
|---|---|---|---|---|---|---|---|---|
| 451 | 3721 | D172H109Q6717T56 | 2117 | en | 2 | 2017-04-29 12:37:04 | 1 | 2017-04-29 13:35:58 |
| 452 | 3722 | D438U949Y7280M45 | 2118 | en | 2 | 2017-04-29 12:41:17 | 1 | 2017-04-29 14:21:21 |
| 453 | 3866 | D843X661P8223W21 | 2121 | pt | 3 | 2017-04-30 12:36:07 | 1 | 2017-04-30 14:59:27 |
| 454 | 3879 | D166C398W2353J43 | 2129 | es | 1 | 2017-05-02 10:41:56 | 1 | 2017-05-02 13:09:58 |
| 455 | 3883 | D424A043K7283P36 | 2137 | it | 3 | 2017-05-06 09:45:48 | 2 | 2017-05-06 10:40:38 |
| 456 | 3919 | D080D377C3402T31 | 2151 | pt | 2 | 2017-05-11 10:58:08 | 2 | 2017-05-11 12:55:03 |
| 457 | 3929 | D586V966T0652S73 | 2157 | en | 2 | 2017-05-12 09:28:47 | 3 | 2017-05-12 10:53:55 |
| 458 | 3935 | D072X344L7834Y11 | 2160 | fr | 2 | 2017-05-12 14:28:47 | 3 | 2017-05-12 17:52:04 |
| 459 | 3939 | D611Q961Z6085N96 | 2163 | es | 2 | 2017-05-13 15:51:15 | 2 | 2017-05-13 17:04:31 |
| 460 | 3868 | D597Q906D6251W67 | 2177 | en | 2 | 2017-05-20 13:27:38 | 3 | 2017-05-20 14:48:17 |
| 461 | 3896 | D547F386X8659H60 | 2184 | en | 2 | 2017-05-23 12:52:22 | 2 | 2017-05-23 14:31:07 |
| 462 | 3959 | D607F479P4765P37 | 2187 | fr | 2 | 2017-05-27 15:19:46 | 2 | 2017-05-27 16:22:33 |
| 463 | 3972 | D130X023V8765P41 | 2191 | zh | 1 | 2017-05-28 11:18:45 | 3 | 2017-05-28 13:17:57 |
| 464 | 3977 | D724L458C1162U17 | 2195 | en | 1 | 2017-05-29 15:27:38 | 1 | 2017-05-29 18:10:00 |
| 465 | 3980 | D611Q961Z6085N96 | 2208 | en | 1 | 2017-06-04 10:32:13 | 3 | 2017-06-04 12:00:47 |
| 466 | 3945 | D034Y265X8016K49 | 2213 | fr | 1 | 2017-06-05 10:40:57 | 1 | 2017-06-05 12:04:41 |
| 467 | 3993 | D547F386X8659H60 | 2214 | fr | 2 | 2017-06-05 10:58:50 | 3 | 2017-06-05 12:49:59 |
| 468 | 3999 | D948A201L8911R06 | 2217 | en | 2 | 2017-06-06 09:28:53 | 2 | 2017-06-06 11:00:06 |
| 469 | 4001 | D080D377C3402T31 | 2219 | fr | 2 | 2017-06-06 10:28:44 | 3 | 2017-06-06 12:11:33 |
| 470 | 4000 | D347R255R5948E69 | 2220 | fr | 2 | 2017-06-06 10:33:09 | 2 | 2017-06-06 11:58:04 |
| 471 | 3984 | D080D377C3402T31 | 2223 | it | 2 | 2017-06-06 13:07:19 | 2 | 2017-06-06 15:00:44 |
| 472 | 3985 | D332R599Y1992N37 | 2224 | en | 2 | 2017-06-06 13:13:49 | 2 | 2017-06-06 14:27:49 |
| 473 | 4009 | D332R599Y1992N37 | 2229 | en | 1 | 2017-06-08 12:14:12 | 1 | 2017-06-08 14:58:02 |
| 474 | 4011 | D843X661P8223W21 | 2231 | en | 1 | 2017-06-08 13:07:59 | 1 | 2017-06-08 13:48:45 |
| 475 | 4026 | D558F571V1033X91 | 2237 | fr | 2 | 2017-06-11 09:25:01 | 1 | 2017-06-11 10:53:26 |
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;