Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 51–75 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 |
|---|---|---|---|---|---|---|---|---|
| 51 | 446 | D843X661P8223W21 | 256 | en | 2 | 2015-05-22 14:15:40 | 2 | 2015-05-22 15:07:52 |
| 52 | 451 | D948A201L8911R06 | 262 | nl | 2 | 2015-05-25 11:13:52 | 1 | 2015-05-25 12:59:29 |
| 53 | 447 | D547F386X8659H60 | 263 | nl | 2 | 2015-05-25 11:19:14 | 1 | 2015-05-25 14:16:16 |
| 54 | 618 | D462B968Z1112C56 | 271 | en | 2 | 2015-05-29 11:05:49 | 3 | 2015-05-29 13:43:04 |
| 55 | 600 | D413Q817Y7694B71 | 272 | fr | 2 | 2015-05-31 16:12:36 | 2 | 2015-05-31 18:10:00 |
| 56 | 633 | D597Q906D6251W67 | 282 | fr | 3 | 2015-06-06 10:45:14 | 3 | 2015-06-06 12:50:33 |
| 57 | 637 | D265V521D1968K75 | 284 | it | 2 | 2015-06-06 11:24:40 | 3 | 2015-06-06 13:28:25 |
| 58 | 514 | D597Q906D6251W67 | 286 | es | 2 | 2015-06-06 14:05:27 | 2 | 2015-06-06 16:01:07 |
| 59 | 641 | D127T102L7940A93 | 291 | es | 2 | 2015-06-08 11:14:53 | 2 | 2015-06-08 12:51:21 |
| 60 | 647 | D597Q906D6251W67 | 292 | fr | 2 | 2015-06-08 11:39:10 | 2 | 2015-06-08 13:00:51 |
| 61 | 624 | D843X661P8223W21 | 299 | ru | 3 | 2015-06-10 15:24:25 | 2 | 2015-06-10 17:03:01 |
| 62 | 632 | D177W168C4167Y04 | 302 | en | 1 | 2015-06-11 09:23:14 | 3 | 2015-06-11 11:11:42 |
| 63 | 657 | D547F386X8659H60 | 303 | en | 2 | 2015-06-11 09:33:34 | 3 | 2015-06-11 10:54:39 |
| 64 | 661 | D948A201L8911R06 | 305 | fr | 2 | 2015-06-11 13:18:08 | 1 | 2015-06-11 15:13:42 |
| 65 | 660 | D779R288A0500T96 | 306 | fr | 2 | 2015-06-11 13:20:26 | 2 | 2015-06-11 14:42:25 |
| 66 | 654 | D166C398W2353J43 | 307 | en | 3 | 2015-06-11 17:03:44 | 3 | 2015-06-11 18:10:00 |
| 67 | 655 | D561K998R8427R26 | 309 | fr | 2 | 2015-06-12 11:03:58 | 2 | 2015-06-12 13:19:36 |
| 68 | 675 | D166C398W2353J43 | 313 | it | 2 | 2015-06-13 14:56:58 | 3 | 2015-06-13 16:30:44 |
| 69 | 653 | D597Q906D6251W67 | 316 | en | 2 | 2015-06-14 09:33:51 | 2 | 2015-06-14 11:34:40 |
| 70 | 684 | D080D377C3402T31 | 323 | en | 2 | 2015-06-16 15:39:32 | 3 | 2015-06-16 17:02:07 |
| 71 | 686 | D841H941H0791Q12 | 325 | zh | 2 | 2015-06-17 13:55:39 | 1 | 2015-06-17 16:31:24 |
| 72 | 687 | D072X344L7834Y11 | 326 | zh | 2 | 2015-06-17 13:59:28 | 1 | 2015-06-17 16:04:07 |
| 73 | 695 | D191E591F4947H41 | 332 | fr | 2 | 2015-06-20 10:32:20 | 2 | 2015-06-20 13:23:22 |
| 74 | 712 | D724L458C1162U17 | 340 | it | 2 | 2015-06-23 09:58:45 | 3 | 2015-06-23 12:35:26 |
| 75 | 714 | D424A043K7283P36 | 342 | fr | 2 | 2015-06-23 11:23:45 | 2 | 2015-06-23 12:58:51 |
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;