Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 726–750 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 |
|---|---|---|---|---|---|---|---|---|
| 726 | 6412 | D186L149Z2216U43 | 3536 | fr | 3 | 2018-08-07 11:04:29 | 1 | 2018-08-07 12:27:28 |
| 727 | 6432 | D166C398W2353J43 | 3546 | fr | 2 | 2018-08-09 13:48:53 | 1 | 2018-08-09 15:09:58 |
| 728 | 6356 | D177W168C4167Y04 | 3555 | en | 2 | 2018-08-10 13:57:45 | 2 | 2018-08-10 15:36:29 |
| 729 | 6408 | D663Z129H2049D24 | 3560 | pl | 2 | 2018-08-11 11:08:09 | 1 | 2018-08-11 13:46:56 |
| 730 | 6453 | D072X344L7834Y11 | 3562 | fi | 2 | 2018-08-11 11:54:54 | 1 | 2018-08-11 13:34:36 |
| 731 | 6449 | D191E591F4947H41 | 3567 | en | 1 | 2018-08-12 13:55:11 | 3 | 2018-08-12 15:33:00 |
| 732 | 6443 | D597Q906D6251W67 | 3568 | it | 2 | 2018-08-12 15:19:57 | 3 | 2018-08-12 17:41:14 |
| 733 | 6436 | D432J989K2788F27 | 3569 | en | 2 | 2018-08-12 15:45:10 | 3 | 2018-08-12 17:10:04 |
| 734 | 6465 | D500A274G0533N08 | 3573 | zh | 3 | 2018-08-13 11:58:18 | 1 | 2018-08-13 13:32:59 |
| 735 | 6467 | D570K624F8858E76 | 3576 | en | 3 | 2018-08-14 11:39:05 | 3 | 2018-08-14 14:29:07 |
| 736 | 6478 | D080D377C3402T31 | 3582 | es | 2 | 2018-08-17 10:14:57 | 1 | 2018-08-17 11:32:28 |
| 737 | 6487 | D843X661P8223W21 | 3587 | it | 2 | 2018-08-18 10:51:01 | 3 | 2018-08-18 13:01:17 |
| 738 | 6332 | D127T102L7940A93 | 3594 | fr | 1 | 2018-08-19 15:40:21 | 1 | 2018-08-19 16:30:26 |
| 739 | 6462 | D736D252Z3041D49 | 3595 | ko | 2 | 2018-08-19 15:52:09 | 1 | 2018-08-19 17:07:25 |
| 740 | 6466 | D172H109Q6717T56 | 3603 | it | 2 | 2018-08-22 09:59:27 | 2 | 2018-08-22 11:06:48 |
| 741 | 6515 | D265V521D1968K75 | 3607 | en | 1 | 2018-08-23 09:50:22 | 1 | 2018-08-23 11:38:43 |
| 742 | 6417 | D561K998R8427R26 | 3614 | en | 3 | 2018-08-25 10:34:15 | 3 | 2018-08-25 12:33:41 |
| 743 | 6561 | D172H109Q6717T56 | 3617 | en | 2 | 2018-08-25 16:11:48 | 3 | 2018-08-25 18:10:00 |
| 744 | 6437 | D767Q927C0149V09 | 3618 | en | 3 | 2018-08-26 14:32:22 | 2 | 2018-08-26 16:26:14 |
| 745 | 6566 | D547F386X8659H60 | 3621 | nl | 1 | 2018-08-27 10:40:16 | 3 | 2018-08-27 12:03:07 |
| 746 | 6602 | D166C398W2353J43 | 3638 | zh | 2 | 2018-09-02 10:18:12 | 1 | 2018-09-02 11:49:01 |
| 747 | 6618 | D127T102L7940A93 | 3646 | en | 2 | 2018-09-05 11:50:51 | 2 | 2018-09-05 12:44:59 |
| 748 | 6620 | D724L458C1162U17 | 3649 | en | 2 | 2018-09-06 14:49:29 | 2 | 2018-09-06 16:11:18 |
| 749 | 6694 | D611Q961Z6085N96 | 3659 | en | 2 | 2018-09-12 11:42:57 | 3 | 2018-09-12 13:30:46 |
| 750 | 6574 | D558F571V1033X91 | 3663 | en | 3 | 2018-09-14 10:20:46 | 3 | 2018-09-14 11:43:01 |
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;