Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 851–875 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 |
|---|---|---|---|---|---|---|---|---|
| 851 | 7713 | D547F386X8659H60 | 4204 | en | 3 | 2019-03-15 09:23:11 | 2 | 2019-03-15 11:36:43 |
| 852 | 7776 | D767Q927C0149V09 | 4206 | fr | 2 | 2019-03-15 17:20:15 | 2 | 2019-03-15 18:10:00 |
| 853 | 7812 | D186L149Z2216U43 | 4223 | fr | 2 | 2019-03-19 15:06:35 | 3 | 2019-03-19 16:56:46 |
| 854 | 7797 | D500A274G0533N08 | 4226 | fr | 1 | 2019-03-20 11:45:17 | 3 | 2019-03-20 14:40:28 |
| 855 | 7885 | D843X661P8223W21 | 4228 | fi | 1 | 2019-03-20 14:46:27 | 3 | 2019-03-20 17:35:53 |
| 856 | 7884 | D462B968Z1112C56 | 4229 | fi | 1 | 2019-03-20 14:51:34 | 3 | 2019-03-20 16:08:46 |
| 857 | 7809 | D265V521D1968K75 | 4231 | en | 1 | 2019-03-21 11:57:56 | 1 | 2019-03-21 13:56:11 |
| 858 | 7888 | D570K624F8858E76 | 4233 | en | 2 | 2019-03-21 14:38:16 | 3 | 2019-03-21 18:10:00 |
| 859 | 7814 | D948A201L8911R06 | 4240 | en | 2 | 2019-03-25 10:35:25 | 2 | 2019-03-25 13:30:00 |
| 860 | 7914 | D948A201L8911R06 | 4252 | fr | 1 | 2019-03-30 10:04:40 | 3 | 2019-03-30 11:44:29 |
| 861 | 7925 | D843X661P8223W21 | 4257 | zh | 2 | 2019-03-31 10:07:12 | 2 | 2019-03-31 12:25:09 |
| 862 | 7919 | D581C144M4385J90 | 4260 | pt | 2 | 2019-04-02 10:15:41 | 1 | 2019-04-02 11:55:55 |
| 863 | 7973 | D561K998R8427R26 | 4266 | zh | 3 | 2019-04-03 16:05:33 | 2 | 2019-04-03 17:49:44 |
| 864 | 7926 | D004U524E2632P53 | 4269 | fr | 2 | 2019-04-04 12:05:13 | 3 | 2019-04-04 13:42:30 |
| 865 | 7988 | D665U414D8903Q14 | 4279 | en | 3 | 2019-04-06 09:51:43 | 1 | 2019-04-06 11:50:01 |
| 866 | 7990 | D207S645U1857P52 | 4282 | fr | 2 | 2019-04-07 10:14:36 | 2 | 2019-04-07 11:25:34 |
| 867 | 7978 | D388J554M7671Q58 | 4283 | en | 3 | 2019-04-07 11:26:23 | 2 | 2019-04-07 12:27:49 |
| 868 | 7994 | D511E829D1120P99 | 4290 | pt | 2 | 2019-04-08 09:53:38 | 1 | 2019-04-08 11:24:58 |
| 869 | 8050 | D347B753W8220U05 | 4301 | en | 2 | 2019-04-12 13:37:52 | 3 | 2019-04-12 14:54:11 |
| 870 | 7981 | D265V521D1968K75 | 4305 | en | 1 | 2019-04-13 10:35:50 | 3 | 2019-04-13 13:32:53 |
| 871 | 7912 | D611Q961Z6085N96 | 4310 | fr | 2 | 2019-04-14 10:47:46 | 2 | 2019-04-14 12:43:58 |
| 872 | 7993 | D581C144M4385J90 | 4320 | pt | 2 | 2019-04-16 09:33:55 | 3 | 2019-04-16 12:59:26 |
| 873 | 8108 | D831V786T8186E00 | 4340 | en | 2 | 2019-04-22 10:14:18 | 3 | 2019-04-22 11:58:04 |
| 874 | 8117 | D767Q927C0149V09 | 4346 | fr | 3 | 2019-04-23 11:54:46 | 1 | 2019-04-23 14:05:43 |
| 875 | 8098 | D130X023V8765P41 | 4352 | en | 1 | 2019-04-25 09:51:15 | 2 | 2019-04-25 11:46:34 |
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;