Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 501–525 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 |
|---|---|---|---|---|---|---|---|---|
| 501 | 4241 | D424A043K7283P36 | 2353 | fr | 2 | 2017-07-14 11:11:36 | 1 | 2017-07-14 12:43:20 |
| 502 | 4251 | D265V521D1968K75 | 2355 | sv | 2 | 2017-07-14 12:26:37 | 1 | 2017-07-14 14:29:37 |
| 503 | 4255 | D166C398W2353J43 | 2360 | ko | 2 | 2017-07-16 11:05:25 | 2 | 2017-07-16 12:35:33 |
| 504 | 4258 | D736D252Z3041D49 | 2361 | ko | 2 | 2017-07-16 11:07:17 | 2 | 2017-07-16 12:00:02 |
| 505 | 4282 | D186L149Z2216U43 | 2371 | fr | 3 | 2017-07-18 16:51:13 | 3 | 2017-07-18 18:01:42 |
| 506 | 4246 | D663Z129H2049D24 | 2372 | it | 2 | 2017-07-19 11:33:12 | 2 | 2017-07-19 14:31:14 |
| 507 | 4294 | D611Q961Z6085N96 | 2377 | pl | 2 | 2017-07-20 15:03:58 | 2 | 2017-07-20 16:18:01 |
| 508 | 4265 | D432J989K2788F27 | 2379 | it | 1 | 2017-07-22 12:37:29 | 3 | 2017-07-22 14:15:48 |
| 509 | 4264 | D172H109Q6717T56 | 2380 | it | 1 | 2017-07-22 12:42:42 | 1 | 2017-07-22 14:04:50 |
| 510 | 4298 | D347R255R5948E69 | 2383 | sv | 2 | 2017-07-23 11:13:36 | 3 | 2017-07-23 13:13:37 |
| 511 | 4287 | D424A043K7283P36 | 2385 | zh | 2 | 2017-07-24 11:36:26 | 1 | 2017-07-24 13:28:45 |
| 512 | 4312 | D767Q927C0149V09 | 2394 | en | 2 | 2017-07-28 11:52:19 | 2 | 2017-07-28 13:04:12 |
| 513 | 4311 | D561K998R8427R26 | 2395 | en | 2 | 2017-07-28 11:54:27 | 1 | 2017-07-28 13:22:26 |
| 514 | 4302 | D843X661P8223W21 | 2399 | ko | 2 | 2017-07-30 10:43:07 | 3 | 2017-07-30 12:09:09 |
| 515 | 4317 | D558F571V1033X91 | 2405 | zh | 1 | 2017-07-31 14:09:50 | 3 | 2017-07-31 15:49:24 |
| 516 | 4318 | D080D377C3402T31 | 2406 | zh | 1 | 2017-07-31 14:23:18 | 2 | 2017-07-31 16:14:04 |
| 517 | 4332 | D586V966T0652S73 | 2411 | en | 2 | 2017-08-02 16:06:07 | 1 | 2017-08-02 17:45:41 |
| 518 | 4368 | D611Q961Z6085N96 | 2437 | pl | 1 | 2017-08-10 15:14:15 | 1 | 2017-08-10 17:23:01 |
| 519 | 4367 | D034Y265X8016K49 | 2438 | pl | 1 | 2017-08-10 15:17:16 | 1 | 2017-08-10 18:10:00 |
| 520 | 4300 | D547F386X8659H60 | 2443 | fr | 2 | 2017-08-12 11:58:27 | 1 | 2017-08-12 13:12:28 |
| 521 | 4340 | D767Q927C0149V09 | 2445 | en | 2 | 2017-08-13 10:54:21 | 3 | 2017-08-13 13:01:28 |
| 522 | 4342 | D948A201L8911R06 | 2447 | en | 2 | 2017-08-13 14:03:00 | 2 | 2017-08-13 15:53:07 |
| 523 | 4381 | D607F479P4765P37 | 2449 | ko | 2 | 2017-08-13 17:02:33 | 3 | 2017-08-13 18:10:00 |
| 524 | 4388 | D500A274G0533N08 | 2454 | en | 2 | 2017-08-14 14:42:31 | 3 | 2017-08-14 16:08:07 |
| 525 | 4400 | D438U949Y7280M45 | 2463 | fr | 2 | 2017-08-16 09:47:09 | 1 | 2017-08-16 11:44:33 |
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;