Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 276–300 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 |
|---|---|---|---|---|---|---|---|---|
| 276 | 2354 | D166C398W2353J43 | 1299 | fr | 2 | 2016-06-09 12:00:14 | 3 | 2016-06-09 15:04:51 |
| 277 | 2380 | D561K998R8427R26 | 1315 | fr | 2 | 2016-06-16 16:48:08 | 2 | 2016-06-16 18:04:12 |
| 278 | 2382 | D767Q927C0149V09 | 1317 | en | 1 | 2016-06-17 10:40:21 | 2 | 2016-06-17 11:59:23 |
| 279 | 2395 | D191E591F4947H41 | 1323 | fr | 3 | 2016-06-20 10:54:05 | 1 | 2016-06-20 13:19:02 |
| 280 | 2333 | D413Q817Y7694B71 | 1326 | fr | 1 | 2016-06-23 09:42:35 | 2 | 2016-06-23 11:32:38 |
| 281 | 2400 | D841H941H0791Q12 | 1328 | en | 2 | 2016-06-23 13:58:07 | 2 | 2016-06-23 16:09:18 |
| 282 | 2375 | D424A043K7283P36 | 1330 | fr | 2 | 2016-06-24 09:25:18 | 3 | 2016-06-24 11:13:54 |
| 283 | 2348 | D724L458C1162U17 | 1333 | nl | 2 | 2016-06-24 11:41:49 | 2 | 2016-06-24 13:20:00 |
| 284 | 2349 | D424A043K7283P36 | 1334 | nl | 2 | 2016-06-24 11:51:46 | 2 | 2016-06-24 14:45:52 |
| 285 | 2405 | D127T102L7940A93 | 1335 | en | 2 | 2016-06-24 13:28:53 | 2 | 2016-06-24 14:35:37 |
| 286 | 2417 | D547F386X8659H60 | 1341 | sv | 1 | 2016-06-26 12:14:04 | 1 | 2016-06-26 13:11:27 |
| 287 | 2416 | D072X344L7834Y11 | 1342 | sv | 1 | 2016-06-26 12:15:51 | 1 | 2016-06-26 13:58:03 |
| 288 | 2430 | D413Q817Y7694B71 | 1352 | zh | 1 | 2016-06-30 14:02:39 | 1 | 2016-06-30 15:57:27 |
| 289 | 2432 | D767Q927C0149V09 | 1354 | fr | 2 | 2016-07-01 12:25:33 | 3 | 2016-07-01 14:11:22 |
| 290 | 2401 | D127T102L7940A93 | 1358 | fr | 2 | 2016-07-02 10:17:07 | 2 | 2016-07-02 11:19:32 |
| 291 | 2443 | D186L149Z2216U43 | 1360 | fr | 3 | 2016-07-02 11:03:38 | 1 | 2016-07-02 12:22:08 |
| 292 | 2452 | D186L149Z2216U43 | 1370 | en | 1 | 2016-07-06 10:29:36 | 2 | 2016-07-06 12:34:20 |
| 293 | 2449 | D736D252Z3041D49 | 1375 | en | 2 | 2016-07-07 11:40:51 | 3 | 2016-07-07 15:05:02 |
| 294 | 2465 | D724L458C1162U17 | 1383 | en | 2 | 2016-07-11 11:29:37 | 1 | 2016-07-11 13:16:42 |
| 295 | 2493 | D191E591F4947H41 | 1397 | pt | 1 | 2016-07-15 10:26:14 | 1 | 2016-07-15 13:23:39 |
| 296 | 2481 | D597Q906D6251W67 | 1398 | it | 3 | 2016-07-15 15:00:38 | 1 | 2016-07-15 16:57:15 |
| 297 | 2506 | D586V966T0652S73 | 1403 | fr | 3 | 2016-07-16 14:23:12 | 3 | 2016-07-16 16:22:20 |
| 298 | 2503 | D166C398W2353J43 | 1404 | fr | 2 | 2016-07-16 14:51:27 | 2 | 2016-07-16 16:45:04 |
| 299 | 2483 | D191E591F4947H41 | 1407 | nl | 1 | 2016-07-17 10:07:58 | 3 | 2016-07-17 12:01:37 |
| 300 | 2462 | D413Q817Y7694B71 | 1411 | ru | 2 | 2016-07-18 15:29:10 | 1 | 2016-07-18 16:36:31 |
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;