home / sakila

rental

28 rows where customer_id = 145

✎ 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
500 2005-05-28 01:05:25.000 4500 4500 145 145 2005-05-31 20:04:25.000 1 1 2020-12-23 07:15:26
2271 2005-06-18 06:29:52.000 2416 2416 145 145 2005-06-21 09:46:52.000 2 2 2020-12-23 07:15:51
2614 2005-06-19 07:28:11.000 4147 4147 145 145 2005-06-22 12:33:11.000 1 1 2020-12-23 07:15:56
3647 2005-07-06 07:29:17.000 3762 3762 145 145 2005-07-13 08:32:17.000 1 1 2020-12-23 07:16:10
4201 2005-07-07 11:19:51.000 3682 3682 145 145 2005-07-16 08:48:51.000 1 1 2020-12-23 07:16:19
4364 2005-07-07 19:46:51.000 10 10 145 145 2005-07-08 21:55:51.000 1 1 2020-12-23 07:16:21
4405 2005-07-07 21:33:16.000 2102 2102 145 145 2005-07-15 00:33:16.000 2 2 2020-12-23 07:16:22
4470 2005-07-08 00:20:57.000 3605 3605 145 145 2005-07-10 02:31:57.000 1 1 2020-12-23 07:16:23
4817 2005-07-08 17:17:31.000 1608 1608 145 145 2005-07-09 22:32:31.000 2 2 2020-12-23 07:16:28
6056 2005-07-11 04:01:27.000 3069 3069 145 145 2005-07-12 04:14:27.000 1 1 2020-12-23 07:16:46
6339 2005-07-11 19:45:32.000 2401 2401 145 145 2005-07-18 22:34:32.000 2 2 2020-12-23 07:16:50
6378 2005-07-11 21:45:23.000 3170 3170 145 145 2005-07-14 16:56:23.000 1 1 2020-12-23 07:16:50
7061 2005-07-27 03:51:10.000 880 880 145 145 2005-07-31 05:36:10.000 1 1 2020-12-23 07:17:01
7529 2005-07-27 21:18:08.000 3644 3644 145 145 2005-08-06 00:59:08.000 1 1 2020-12-23 07:17:08
7954 2005-07-28 13:25:05.000 3735 3735 145 145 2005-07-29 18:50:05.000 2 2 2020-12-23 07:17:14
8380 2005-07-29 05:31:29.000 2279 2279 145 145 2005-08-02 01:27:29.000 1 1 2020-12-23 07:17:20
9156 2005-07-30 11:04:55.000 1747 1747 145 145 2005-07-31 14:10:55.000 2 2 2020-12-23 07:17:31
9576 2005-07-31 02:52:59.000 3327 3327 145 145 2005-08-05 23:35:59.000 2 2 2020-12-23 07:17:37
10799 2005-08-01 22:03:31.000 3282 3282 145 145 2005-08-06 20:19:31.000 2 2 2020-12-23 07:17:55
11904 2005-08-17 15:39:26.000 2846 2846 145 145 2005-08-21 18:24:26.000 2 2 2020-12-23 07:18:10
11954 2005-08-17 17:18:36.000 220 220 145 145 2005-08-18 19:49:36.000 1 1 2020-12-23 07:18:11
12637 2005-08-18 18:06:53.000 4005 4005 145 145 2005-08-19 17:36:53.000 1 1 2020-12-23 07:18:20
12785 2005-08-19 00:05:49.000 4190 4190 145 145 2005-08-21 04:39:49.000 2 2 2020-12-23 07:18:22
13012 2005-08-19 07:54:59.000 1690 1690 145 145 2005-08-26 09:50:59.000 2 2 2020-12-23 07:18:25
13164 2005-08-19 13:30:55.000 1104 1104 145 145 2005-08-26 10:12:55.000 2 2 2020-12-23 07:18:28
13272 2005-08-19 17:49:13.000 2531 2531 145 145 2005-08-23 15:49:13.000 2 2 2020-12-23 07:18:29
14044 2005-08-20 21:48:38.000 1422 1422 145 145 2005-08-29 02:56:38.000 1 1 2020-12-23 07:18:41
14389 2005-08-21 10:15:20.000 2718 2718 145 145 2005-08-27 05:39:20.000 1 1 2020-12-23 07:18:46

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 11.267ms