Table
audio_guide_hire
Each hire: ticket, device, language, issuing and returning wing, times and payment.
Replaces in 2020: Hired Audio Guide
Rows 576–600 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 |
|---|---|---|---|---|---|---|---|---|
| 576 | 4931 | D841H941H0791Q12 | 2751 | en | 2 | 2017-12-10 16:34:18 | 3 | 2017-12-10 17:32:46 |
| 577 | 4929 | D663Z129H2049D24 | 2752 | en | 2 | 2017-12-10 16:40:19 | 3 | 2017-12-10 18:10:00 |
| 578 | 4936 | D413Q817Y7694B71 | 2758 | fr | 1 | 2017-12-12 15:38:10 | 1 | 2017-12-12 18:08:09 |
| 579 | 4946 | D166C398W2353J43 | 2763 | es | 2 | 2017-12-15 12:05:58 | 1 | 2017-12-15 13:24:17 |
| 580 | 4916 | D388J554M7671Q58 | 2770 | en | 1 | 2017-12-18 10:01:28 | 3 | 2017-12-18 12:00:15 |
| 581 | 4964 | D724L458C1162U17 | 2772 | fr | 2 | 2017-12-18 12:44:34 | 3 | 2017-12-18 14:53:37 |
| 582 | 4976 | D547F386X8659H60 | 2783 | en | 2 | 2017-12-24 14:04:11 | 3 | 2017-12-24 15:29:33 |
| 583 | 4972 | D347R255R5948E69 | 2791 | en | 1 | 2017-12-30 12:09:29 | 2 | 2017-12-30 14:22:45 |
| 584 | 4973 | D477K685J7558W94 | 2792 | en | 1 | 2017-12-30 12:12:21 | 2 | 2017-12-30 13:39:34 |
| 585 | 5043 | D072X344L7834Y11 | 2801 | es | 1 | 2018-01-02 10:32:46 | 1 | 2018-01-02 11:51:22 |
| 586 | 5042 | D948A201L8911R06 | 2802 | es | 1 | 2018-01-02 10:36:55 | 3 | 2018-01-02 13:01:45 |
| 587 | 5057 | D130X023V8765P41 | 2810 | pl | 2 | 2018-01-05 12:10:45 | 3 | 2018-01-05 14:26:05 |
| 588 | 5037 | D186L149Z2216U43 | 2811 | en | 2 | 2018-01-06 11:28:35 | 3 | 2018-01-06 12:53:47 |
| 589 | 5053 | D597Q906D6251W67 | 2816 | fr | 2 | 2018-01-07 13:41:15 | 2 | 2018-01-07 16:13:48 |
| 590 | 5125 | D611Q961Z6085N96 | 2820 | en | 2 | 2018-01-09 11:51:41 | 2 | 2018-01-09 13:10:45 |
| 591 | 5126 | D510H421W1552A28 | 2822 | zh | 2 | 2018-01-10 10:29:53 | 3 | 2018-01-10 12:38:25 |
| 592 | 5129 | D332R599Y1992N37 | 2829 | en | 2 | 2018-01-11 12:12:01 | 2 | 2018-01-11 13:42:22 |
| 593 | 5140 | D191E591F4947H41 | 2835 | en | 2 | 2018-01-12 15:03:34 | 3 | 2018-01-12 16:50:32 |
| 594 | 5143 | D332R599Y1992N37 | 2841 | zh | 1 | 2018-01-15 10:43:12 | 2 | 2018-01-15 11:54:51 |
| 595 | 5044 | D586V966T0652S73 | 2844 | fr | 3 | 2018-01-16 13:27:05 | 2 | 2018-01-16 14:42:45 |
| 596 | 4862 | D130X023V8765P41 | 2848 | en | 2 | 2018-01-18 12:06:35 | 1 | 2018-01-18 14:37:14 |
| 597 | 4861 | D177W168C4167Y04 | 2849 | en | 2 | 2018-01-18 12:10:47 | 1 | 2018-01-18 13:40:32 |
| 598 | 5134 | D332R599Y1992N37 | 2856 | en | 2 | 2018-01-20 11:08:55 | 3 | 2018-01-20 13:03:10 |
| 599 | 5211 | D191E591F4947H41 | 2862 | ru | 2 | 2018-01-22 12:49:00 | 2 | 2018-01-22 14:05:37 |
| 600 | 5210 | D034Y265X8016K49 | 2863 | en | 2 | 2018-01-22 12:50:36 | 3 | 2018-01-22 14:56:19 |
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;