Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 126–150 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 |
|---|---|---|---|---|---|---|---|---|
| 126 | 1051 | D127T102L7940A93 | 592 | en | 3 | 2015-08-29 16:48:50 | 2 | 2015-08-29 18:10:00 |
| 127 | 1050 | D597Q906D6251W67 | 593 | en | 3 | 2015-08-29 16:52:27 | 2 | 2015-08-29 18:10:00 |
| 128 | 1032 | D424A043K7283P36 | 594 | fr | 2 | 2015-08-30 11:12:54 | 1 | 2015-08-30 13:33:56 |
| 129 | 988 | D547F386X8659H60 | 595 | en | 2 | 2015-08-30 13:09:54 | 2 | 2015-08-30 14:15:22 |
| 130 | 1055 | D413Q817Y7694B71 | 599 | it | 2 | 2015-08-31 10:11:50 | 3 | 2015-08-31 11:14:06 |
| 131 | 1054 | D586V966T0652S73 | 605 | pl | 3 | 2015-09-02 16:42:54 | 1 | 2015-09-02 18:10:00 |
| 132 | 1006 | D561K998R8427R26 | 606 | en | 3 | 2015-09-03 11:04:24 | 1 | 2015-09-03 12:24:36 |
| 133 | 1007 | D166C398W2353J43 | 607 | en | 3 | 2015-09-03 11:08:33 | 3 | 2015-09-03 12:54:04 |
| 134 | 1067 | D724L458C1162U17 | 610 | zh | 1 | 2015-09-04 10:19:22 | 1 | 2015-09-04 11:28:16 |
| 135 | 1062 | D166C398W2353J43 | 611 | en | 1 | 2015-09-04 12:01:06 | 3 | 2015-09-04 14:03:04 |
| 136 | 1024 | D597Q906D6251W67 | 614 | en | 1 | 2015-09-05 14:12:23 | 1 | 2015-09-05 16:33:43 |
| 137 | 1023 | D547F386X8659H60 | 615 | en | 2 | 2015-09-05 14:23:22 | 1 | 2015-09-05 15:53:27 |
| 138 | 1073 | D841H941H0791Q12 | 618 | sv | 1 | 2015-09-07 14:57:36 | 1 | 2015-09-07 16:56:34 |
| 139 | 1020 | D547F386X8659H60 | 619 | pl | 2 | 2015-09-08 15:01:35 | 2 | 2015-09-08 16:22:06 |
| 140 | 1083 | D547F386X8659H60 | 626 | zh | 2 | 2015-09-11 12:28:10 | 1 | 2015-09-11 13:49:09 |
| 141 | 1084 | D034Y265X8016K49 | 627 | zh | 2 | 2015-09-11 12:34:59 | 1 | 2015-09-11 14:09:52 |
| 142 | 1085 | D736D252Z3041D49 | 628 | zh | 1 | 2015-09-11 12:45:55 | 3 | 2015-09-11 15:40:06 |
| 143 | 1087 | D080D377C3402T31 | 632 | en | 1 | 2015-09-13 10:49:12 | 2 | 2015-09-13 13:39:03 |
| 144 | 1132 | D166C398W2353J43 | 640 | ko | 1 | 2015-09-16 12:01:23 | 2 | 2015-09-16 13:12:17 |
| 145 | 1185 | D547F386X8659H60 | 651 | en | 2 | 2015-09-20 12:33:09 | 1 | 2015-09-20 14:59:42 |
| 146 | 1190 | D767Q927C0149V09 | 656 | en | 1 | 2015-09-22 11:45:41 | 3 | 2015-09-22 14:23:54 |
| 147 | 1194 | D736D252Z3041D49 | 660 | zh | 2 | 2015-09-23 10:31:33 | 2 | 2015-09-23 12:01:13 |
| 148 | 1199 | D127T102L7940A93 | 662 | zh | 2 | 2015-09-23 11:45:29 | 1 | 2015-09-23 14:31:45 |
| 149 | 1200 | D424A043K7283P36 | 664 | ru | 2 | 2015-09-23 12:59:17 | 2 | 2015-09-23 13:59:37 |
| 150 | 1193 | D597Q906D6251W67 | 667 | fr | 2 | 2015-09-24 10:34:39 | 3 | 2015-09-24 12:34:28 |
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;