Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 951–975 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 |
|---|---|---|---|---|---|---|---|---|
| 951 | 8696 | D665U414D8903Q14 | 4730 | en | 1 | 2019-08-05 13:45:55 | 2 | 2019-08-05 15:35:06 |
| 952 | 8652 | D952G324M2778N96 | 4734 | ko | 2 | 2019-08-06 09:30:55 | 1 | 2019-08-06 11:19:09 |
| 953 | 8590 | D207S645U1857P52 | 4735 | fr | 2 | 2019-08-06 12:09:03 | 3 | 2019-08-06 13:52:39 |
| 954 | 8714 | D004U524E2632P53 | 4737 | it | 2 | 2019-08-06 13:21:58 | 3 | 2019-08-06 14:46:12 |
| 955 | 8707 | D831V786T8186E00 | 4738 | en | 2 | 2019-08-06 14:41:49 | 1 | 2019-08-06 16:20:14 |
| 956 | 8637 | D004U524E2632P53 | 4739 | en | 2 | 2019-08-06 15:11:15 | 2 | 2019-08-06 16:23:12 |
| 957 | 8718 | D952G324M2778N96 | 4744 | en | 1 | 2019-08-07 10:42:35 | 3 | 2019-08-07 12:02:29 |
| 958 | 8734 | D413Q817Y7694B71 | 4753 | fr | 2 | 2019-08-09 09:17:22 | 3 | 2019-08-09 11:47:29 |
| 959 | 8738 | D424A043K7283P36 | 4756 | en | 1 | 2019-08-09 10:57:53 | 1 | 2019-08-09 12:11:51 |
| 960 | 8743 | D119M445Z8873B29 | 4759 | pt | 3 | 2019-08-10 11:49:26 | 3 | 2019-08-10 13:18:47 |
| 961 | 8744 | D910N244E8046F15 | 4760 | pt | 3 | 2019-08-10 11:52:23 | 3 | 2019-08-10 15:33:19 |
| 962 | 8693 | D611Q961Z6085N96 | 4762 | no | 2 | 2019-08-10 14:41:50 | 3 | 2019-08-10 16:35:13 |
| 963 | 8690 | D845W425F3685F62 | 4779 | en | 2 | 2019-08-16 14:28:34 | 3 | 2019-08-16 16:13:45 |
| 964 | 8770 | D710U525C8071V72 | 4782 | en | 1 | 2019-08-18 10:59:19 | 3 | 2019-08-18 12:28:48 |
| 965 | 8761 | D207S645U1857P52 | 4791 | en | 1 | 2019-08-21 10:24:17 | 3 | 2019-08-21 12:41:33 |
| 966 | 8820 | D570K624F8858E76 | 4809 | en | 3 | 2019-08-25 14:33:59 | 3 | 2019-08-25 15:45:48 |
| 967 | 8835 | D004U524E2632P53 | 4821 | en | 1 | 2019-08-27 10:36:27 | 1 | 2019-08-27 13:17:11 |
| 968 | 8822 | D952G324M2778N96 | 4822 | it | 1 | 2019-08-28 09:37:26 | 3 | 2019-08-28 11:23:46 |
| 969 | 8844 | D767Q927C0149V09 | 4825 | fr | 3 | 2019-08-28 11:13:48 | 2 | 2019-08-28 14:41:10 |
| 970 | 8788 | D710U525C8071V72 | 4829 | en | 2 | 2019-08-29 11:10:30 | 2 | 2019-08-29 13:05:13 |
| 971 | 8857 | D438U949Y7280M45 | 4833 | pt | 2 | 2019-08-30 10:47:06 | 1 | 2019-08-30 12:34:04 |
| 972 | 8827 | D952G324M2778N96 | 4838 | zh | 1 | 2019-08-31 10:43:01 | 3 | 2019-08-31 13:53:24 |
| 973 | 8811 | D592Z759N4619V32 | 4839 | fr | 3 | 2019-08-31 13:19:56 | 2 | 2019-08-31 14:42:39 |
| 974 | 8882 | D845W425F3685F62 | 4849 | en | 2 | 2019-09-04 16:05:16 | 2 | 2019-09-04 17:01:56 |
| 975 | 8799 | D186L149Z2216U43 | 4855 | en | 3 | 2019-09-05 12:24:47 | 2 | 2019-09-05 13:30:29 |
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;