Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 801–825 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 |
|---|---|---|---|---|---|---|---|---|
| 801 | 7190 | D597Q906D6251W67 | 3908 | fr | 2 | 2018-11-26 10:59:57 | 2 | 2018-11-26 12:40:05 |
| 802 | 7193 | D332R599Y1992N37 | 3910 | en | 2 | 2018-11-26 12:27:57 | 3 | 2018-11-26 14:40:13 |
| 803 | 7203 | D831V786T8186E00 | 3917 | fr | 2 | 2018-11-28 11:11:03 | 3 | 2018-11-28 12:26:26 |
| 804 | 7199 | D561K998R8427R26 | 3919 | es | 3 | 2018-11-29 10:32:11 | 2 | 2018-11-29 11:50:00 |
| 805 | 7208 | D462B968Z1112C56 | 3924 | ru | 2 | 2018-11-30 09:26:17 | 2 | 2018-11-30 11:35:24 |
| 806 | 7185 | D736D252Z3041D49 | 3931 | fr | 2 | 2018-12-02 09:25:36 | 3 | 2018-12-02 11:52:47 |
| 807 | 7062 | D570K624F8858E76 | 3934 | es | 3 | 2018-12-02 11:22:30 | 1 | 2018-12-02 13:15:47 |
| 808 | 7220 | D767Q927C0149V09 | 3935 | en | 3 | 2018-12-02 11:29:17 | 3 | 2018-12-02 12:37:08 |
| 809 | 7241 | D547F386X8659H60 | 3949 | fr | 2 | 2018-12-07 09:33:14 | 1 | 2018-12-07 11:23:48 |
| 810 | 7245 | D413Q817Y7694B71 | 3950 | en | 1 | 2018-12-07 09:49:04 | 2 | 2018-12-07 11:50:55 |
| 811 | 7252 | D186L149Z2216U43 | 3960 | it | 2 | 2018-12-11 09:49:45 | 1 | 2018-12-11 11:47:30 |
| 812 | 7259 | D034Y265X8016K49 | 3965 | en | 2 | 2018-12-12 12:16:25 | 2 | 2018-12-12 14:48:52 |
| 813 | 7269 | D072X344L7834Y11 | 3970 | zh | 3 | 2018-12-14 11:08:07 | 3 | 2018-12-14 12:48:21 |
| 814 | 7270 | D191E591F4947H41 | 3972 | fr | 2 | 2018-12-14 12:06:07 | 2 | 2018-12-14 13:48:33 |
| 815 | 7183 | D432J989K2788F27 | 3979 | en | 1 | 2018-12-16 10:28:54 | 3 | 2018-12-16 11:55:52 |
| 816 | 7276 | D080D377C3402T31 | 3980 | zh | 2 | 2018-12-16 13:05:44 | 2 | 2018-12-16 16:09:40 |
| 817 | 7198 | D072X344L7834Y11 | 3985 | pt | 2 | 2018-12-18 09:55:39 | 3 | 2018-12-18 12:55:53 |
| 818 | 7279 | D843X661P8223W21 | 3989 | en | 2 | 2018-12-19 12:51:30 | 1 | 2018-12-19 14:31:16 |
| 819 | 7290 | D767Q927C0149V09 | 3995 | fr | 2 | 2018-12-20 09:57:16 | 2 | 2018-12-20 13:06:55 |
| 820 | 7338 | D034Y265X8016K49 | 3999 | zh | 1 | 2018-12-22 10:38:26 | 2 | 2018-12-22 12:46:42 |
| 821 | 7240 | D831V786T8186E00 | 4000 | en | 2 | 2018-12-22 11:31:15 | 1 | 2018-12-22 13:17:13 |
| 822 | 7341 | D130X023V8765P41 | 4002 | ko | 2 | 2018-12-23 13:45:03 | 2 | 2018-12-23 16:24:03 |
| 823 | 7332 | D080D377C3402T31 | 4006 | en | 2 | 2018-12-25 14:43:10 | 2 | 2018-12-25 15:39:43 |
| 824 | 7360 | D265V521D1968K75 | 4014 | fr | 2 | 2018-12-28 10:54:28 | 2 | 2018-12-28 12:17:44 |
| 825 | 7365 | D172H109Q6717T56 | 4018 | pt | 3 | 2018-12-29 11:24:16 | 3 | 2018-12-29 13:23:39 |
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;