Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 76–100 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 |
|---|---|---|---|---|---|---|---|---|
| 76 | 707 | D547F386X8659H60 | 343 | es | 2 | 2015-06-24 10:03:18 | 1 | 2015-06-24 12:09:10 |
| 77 | 716 | D736D252Z3041D49 | 346 | it | 3 | 2015-06-25 09:27:24 | 3 | 2015-06-25 11:32:29 |
| 78 | 711 | D736D252Z3041D49 | 347 | en | 2 | 2015-06-26 09:30:51 | 2 | 2015-06-26 11:14:09 |
| 79 | 717 | D736D252Z3041D49 | 349 | en | 1 | 2015-06-26 14:38:58 | 3 | 2015-06-26 16:25:24 |
| 80 | 720 | D779R288A0500T96 | 354 | en | 2 | 2015-06-27 11:51:27 | 3 | 2015-06-27 13:29:06 |
| 81 | 737 | D166C398W2353J43 | 368 | fr | 2 | 2015-07-03 11:08:00 | 3 | 2015-07-03 12:28:13 |
| 82 | 760 | D072X344L7834Y11 | 384 | en | 2 | 2015-07-08 13:00:20 | 3 | 2015-07-08 14:47:57 |
| 83 | 762 | D948A201L8911R06 | 388 | en | 2 | 2015-07-09 11:16:03 | 1 | 2015-07-09 12:30:21 |
| 84 | 769 | D779R288A0500T96 | 392 | en | 2 | 2015-07-10 12:15:51 | 1 | 2015-07-10 13:33:46 |
| 85 | 772 | D841H941H0791Q12 | 395 | en | 2 | 2015-07-11 10:08:34 | 3 | 2015-07-11 12:10:23 |
| 86 | 774 | D767Q927C0149V09 | 397 | ru | 1 | 2015-07-11 11:46:52 | 2 | 2015-07-11 14:39:48 |
| 87 | 781 | D724L458C1162U17 | 403 | en | 2 | 2015-07-12 14:27:31 | 1 | 2015-07-12 15:31:10 |
| 88 | 784 | D186L149Z2216U43 | 404 | fr | 2 | 2015-07-12 14:48:10 | 2 | 2015-07-12 16:20:20 |
| 89 | 785 | D034Y265X8016K49 | 405 | fr | 2 | 2015-07-12 14:53:39 | 2 | 2015-07-12 16:27:00 |
| 90 | 794 | D779R288A0500T96 | 412 | en | 1 | 2015-07-15 14:02:12 | 2 | 2015-07-15 15:18:48 |
| 91 | 795 | D413Q817Y7694B71 | 414 | en | 1 | 2015-07-17 11:29:46 | 2 | 2015-07-17 12:53:29 |
| 92 | 754 | D080D377C3402T31 | 417 | es | 3 | 2015-07-18 10:40:00 | 3 | 2015-07-18 11:16:16 |
| 93 | 753 | D462B968Z1112C56 | 419 | es | 1 | 2015-07-18 10:47:06 | 1 | 2015-07-18 13:18:29 |
| 94 | 792 | D034Y265X8016K49 | 435 | fr | 2 | 2015-07-22 12:39:25 | 2 | 2015-07-22 14:25:45 |
| 95 | 832 | D547F386X8659H60 | 439 | fr | 1 | 2015-07-23 11:31:00 | 3 | 2015-07-23 15:37:10 |
| 96 | 845 | D462B968Z1112C56 | 447 | fr | 3 | 2015-07-24 09:22:07 | 2 | 2015-07-24 10:34:28 |
| 97 | 841 | D413Q817Y7694B71 | 449 | fr | 3 | 2015-07-24 11:40:08 | 3 | 2015-07-24 13:23:07 |
| 98 | 856 | D767Q927C0149V09 | 453 | fr | 2 | 2015-07-25 10:36:08 | 3 | 2015-07-25 12:18:17 |
| 99 | 857 | D191E591F4947H41 | 455 | es | 2 | 2015-07-25 15:03:31 | 3 | 2015-07-25 16:55:51 |
| 100 | 858 | D072X344L7834Y11 | 457 | en | 3 | 2015-07-25 15:32:08 | 2 | 2015-07-25 17:55:04 |
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;