home / sakila

rental

29 rows where customer_id = 592

✎ View and edit SQL

This data as json, xlsx, CSV (advanced)

Suggested facets: staff_id, last_update, rental_date (date), return_date (date), last_update (date)

rental_id ▼ rental_date inventory_id customer_id return_date staff_id last_update
1163 2005-06-14 23:12:46.000 4209 4209 592 592 2005-06-23 21:53:46.000 1 1 2020-12-23 07:15:35
1423 2005-06-15 18:08:12.000 1396 1396 592 592 2005-06-24 19:13:12.000 1 1 2020-12-23 07:15:39
1479 2005-06-15 21:13:38.000 172 172 592 592 2005-06-17 01:26:38.000 2 2 2020-12-23 07:15:39
2627 2005-06-19 08:32:00.000 2779 2779 592 592 2005-06-24 04:31:00.000 2 2 2020-12-23 07:15:56
3158 2005-06-20 21:08:19.000 3461 3461 592 592 2005-06-29 18:59:19.000 1 1 2020-12-23 07:16:03
3560 2005-07-06 02:51:37.000 888 888 592 592 2005-07-10 01:35:37.000 2 2 2020-12-23 07:16:09
3973 2005-07-06 22:58:31.000 2625 2625 592 592 2005-07-16 03:27:31.000 2 2 2020-12-23 07:16:15
4129 2005-07-07 07:37:03.000 1413 1413 592 592 2005-07-14 13:31:03.000 1 1 2020-12-23 07:16:17
4145 2005-07-07 08:26:39.000 3050 3050 592 592 2005-07-16 12:54:39.000 2 2 2020-12-23 07:16:18
4460 2005-07-07 23:50:14.000 4121 4121 592 592 2005-07-09 21:55:14.000 1 1 2020-12-23 07:16:22
4518 2005-07-08 02:48:36.000 697 697 592 592 2005-07-13 04:53:36.000 2 2 2020-12-23 07:16:23
6937 2005-07-26 23:15:50.000 1768 1768 592 592 2005-07-27 19:14:50.000 1 1 2020-12-23 07:16:59
7173 2005-07-27 07:59:24.000 177 177 592 592 2005-07-28 02:23:24.000 2 2 2020-12-23 07:17:02
7278 2005-07-27 11:50:34.000 531 531 592 592 2005-08-01 10:22:34.000 1 1 2020-12-23 07:17:04
7364 2005-07-27 14:58:40.000 3046 3046 592 592 2005-08-03 09:01:40.000 2 2 2020-12-23 07:17:05
8730 2005-07-29 18:23:34.000 4191 4191 592 592 2005-08-01 19:56:34.000 1 1 2020-12-23 07:17:25
8773 2005-07-29 19:55:34.000 131 131 592 592 2005-07-30 14:11:34.000 1 1 2020-12-23 07:17:26
9268 2005-07-30 15:02:30.000 3593 3593 592 592 2005-08-05 12:50:30.000 1 1 2020-12-23 07:17:33
9437 2005-07-30 21:36:04.000 1230 1230 592 592 2005-08-08 01:26:04.000 1 1 2020-12-23 07:17:36
9666 2005-07-31 06:20:58.000 4318 4318 592 592 2005-08-06 06:09:58.000 2 2 2020-12-23 07:17:39
10383 2005-08-01 06:37:16.000 4166 4166 592 592 2005-08-03 07:36:16.000 2 2 2020-12-23 07:17:49
10634 2005-08-01 15:37:48.000 445 445 592 592 2005-08-02 12:11:48.000 2 2 2020-12-23 07:17:53
11410 2005-08-02 19:29:01.000 692 692 592 592 2005-08-11 16:50:01.000 1 1 2020-12-23 07:18:03
12043 2005-08-17 20:38:21.000 3706 3706 592 592 2005-08-22 16:52:21.000 2 2 2020-12-23 07:18:12
12619 2005-08-18 17:24:15.000 980 980 592 592 2005-08-21 15:56:15.000 1 1 2020-12-23 07:18:19
12976 2005-08-19 06:52:58.000 66 66 592 592 2005-08-26 11:23:58.000 2 2 2020-12-23 07:18:25
13157 2005-08-19 13:12:28.000 4391 4391 592 592 2005-08-20 10:41:28.000 1 1 2020-12-23 07:18:28
13662 2005-08-20 08:11:58.000 3880 3880 592 592 2005-08-26 13:34:58.000 1 1 2020-12-23 07:18:35
14606 2006-02-14 15:16:03.000 2291 2291 592 592   2 2 2020-12-23 07:18:49

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE rental (
  rental_id INT NOT NULL,
  rental_date TIMESTAMP NOT NULL,
  inventory_id INT  NOT NULL,
  customer_id INT  NOT NULL,
  return_date TIMESTAMP DEFAULT NULL,
  staff_id SMALLINT  NOT NULL,
  last_update TIMESTAMP NOT NULL,
  PRIMARY KEY (rental_id),
  CONSTRAINT fk_rental_staff FOREIGN KEY (staff_id) REFERENCES staff (staff_id) ,
  CONSTRAINT fk_rental_inventory FOREIGN KEY (inventory_id) REFERENCES inventory (inventory_id) ,
  CONSTRAINT fk_rental_customer FOREIGN KEY (customer_id) REFERENCES customer (customer_id)
);
CREATE INDEX idx_rental_fk_inventory_id ON rental(inventory_id)
;
CREATE INDEX idx_rental_fk_customer_id ON rental(customer_id)
;
CREATE INDEX idx_rental_fk_staff_id ON rental(staff_id)
;
CREATE UNIQUE INDEX idx_rental_uq  ON rental (rental_date,inventory_id,customer_id)
;
Powered by Datasette · Queries took 19.563ms