Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 826–850 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 |
|---|---|---|---|---|---|---|---|---|
| 826 | 7361 | D724L458C1162U17 | 4024 | en | 2 | 2019-01-04 11:01:21 | 2 | 2019-01-04 13:10:13 |
| 827 | 7331 | D597Q906D6251W67 | 4025 | en | 3 | 2019-01-04 13:09:47 | 3 | 2019-01-04 14:54:23 |
| 828 | 7374 | D500A274G0533N08 | 4033 | sv | 3 | 2019-01-08 15:31:19 | 2 | 2019-01-08 17:04:24 |
| 829 | 7381 | D034Y265X8016K49 | 4035 | fr | 1 | 2019-01-09 10:14:13 | 1 | 2019-01-09 14:03:20 |
| 830 | 7352 | D424A043K7283P36 | 4036 | pt | 2 | 2019-01-09 13:09:17 | 3 | 2019-01-09 14:46:55 |
| 831 | 7355 | D724L458C1162U17 | 4037 | pt | 2 | 2019-01-09 13:15:52 | 3 | 2019-01-09 14:35:13 |
| 832 | 7456 | D191E591F4947H41 | 4054 | en | 2 | 2019-01-19 09:21:55 | NULL | NULL |
| 833 | 7205 | D724L458C1162U17 | 4058 | fr | 2 | 2019-01-20 09:50:47 | 2 | 2019-01-20 12:09:29 |
| 834 | 7471 | D597Q906D6251W67 | 4066 | zh | 2 | 2019-01-24 15:19:42 | 1 | 2019-01-24 16:41:25 |
| 835 | 7466 | D547F386X8659H60 | 4068 | en | 2 | 2019-01-25 17:02:14 | 1 | 2019-01-25 18:10:00 |
| 836 | 7579 | D432J989K2788F27 | 4083 | es | 2 | 2019-02-02 16:14:44 | 1 | 2019-02-02 18:05:37 |
| 837 | 7530 | D324Z884K8486X42 | 4086 | en | 2 | 2019-02-03 12:18:36 | 1 | 2019-02-03 13:47:08 |
| 838 | 7634 | D767Q927C0149V09 | 4115 | en | 3 | 2019-02-12 11:15:46 | 1 | 2019-02-12 13:24:12 |
| 839 | 7639 | D332R599Y1992N37 | 4118 | fr | 2 | 2019-02-12 14:49:43 | 3 | 2019-02-12 16:42:49 |
| 840 | 7448 | D388J554M7671Q58 | 4121 | en | 2 | 2019-02-14 10:47:31 | 3 | 2019-02-14 12:19:32 |
| 841 | 7593 | D561K998R8427R26 | 4123 | it | 2 | 2019-02-15 15:31:53 | 1 | 2019-02-15 18:07:43 |
| 842 | 7592 | D034Y265X8016K49 | 4124 | it | 2 | 2019-02-15 15:36:21 | 2 | 2019-02-15 17:39:19 |
| 843 | 7712 | D388J554M7671Q58 | 4144 | fr | 1 | 2019-02-22 11:40:29 | 2 | 2019-02-22 13:03:32 |
| 844 | 7745 | D558F571V1033X91 | 4162 | zh | 1 | 2019-03-02 10:48:38 | 3 | 2019-03-02 11:45:24 |
| 845 | 7742 | D130X023V8765P41 | 4163 | fr | 2 | 2019-03-02 10:49:06 | 2 | 2019-03-02 11:35:14 |
| 846 | 7717 | D438U949Y7280M45 | 4166 | en | 2 | 2019-03-03 12:51:49 | 1 | 2019-03-03 15:06:44 |
| 847 | 7785 | D034Y265X8016K49 | 4182 | en | 2 | 2019-03-09 12:07:34 | 2 | 2019-03-09 14:34:25 |
| 848 | 7613 | D438U949Y7280M45 | 4184 | zh | 2 | 2019-03-10 12:45:43 | 2 | 2019-03-10 14:26:47 |
| 849 | 7615 | D597Q906D6251W67 | 4185 | zh | 2 | 2019-03-10 12:54:35 | 2 | 2019-03-10 15:09:38 |
| 850 | 7806 | D324Z884K8486X42 | 4200 | en | 2 | 2019-03-14 12:14:43 | 3 | 2019-03-14 13:53:38 |
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;