home / sakila

rental

26 rows where customer_id = 240

✎ 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
246 2005-05-26 13:57:07.000 2829 2829 240 240 2005-05-29 10:12:07.000 2 2 2020-12-23 07:15:23
460 2005-05-27 20:02:03.000 4238 4238 240 240 2005-05-28 16:14:03.000 1 1 2020-12-23 07:15:26
643 2005-05-28 18:52:11.000 3105 3105 240 240 2005-05-31 15:15:11.000 2 2 2020-12-23 07:15:28
2196 2005-06-18 01:47:07.000 1925 1925 240 240 2005-06-26 03:18:07.000 2 2 2020-12-23 07:15:50
2264 2005-06-18 05:58:45.000 150 150 240 240 2005-06-19 00:57:45.000 1 1 2020-12-23 07:15:51
2872 2005-06-20 00:38:21.000 3779 3779 240 240 2005-06-26 19:56:21.000 1 1 2020-12-23 07:15:59
4305 2005-07-07 17:07:11.000 3926 3926 240 240 2005-07-08 16:15:11.000 2 2 2020-12-23 07:16:20
5262 2005-07-09 14:08:01.000 1092 1092 240 240 2005-07-12 16:48:01.000 1 1 2020-12-23 07:16:34
5596 2005-07-10 04:43:14.000 1662 1662 240 240 2005-07-11 22:58:14.000 2 2 2020-12-23 07:16:39
6272 2005-07-11 16:03:49.000 3103 3103 240 240 2005-07-15 19:54:49.000 1 1 2020-12-23 07:16:49
6470 2005-07-12 01:29:41.000 1680 1680 240 240 2005-07-15 21:33:41.000 2 2 2020-12-23 07:16:52
6956 2005-07-26 23:55:57.000 2499 2499 240 240 2005-08-03 21:41:57.000 1 1 2020-12-23 07:16:59
7001 2005-07-27 01:25:34.000 1460 1460 240 240 2005-07-31 23:30:34.000 2 2 2020-12-23 07:17:00
7467 2005-07-27 18:51:54.000 3869 3869 240 240 2005-08-03 23:27:54.000 2 2 2020-12-23 07:17:07
7481 2005-07-27 19:20:25.000 1804 1804 240 240 2005-07-29 19:07:25.000 2 2 2020-12-23 07:17:07
7870 2005-07-28 10:16:03.000 970 970 240 240 2005-07-31 16:06:03.000 1 1 2020-12-23 07:17:13
8503 2005-07-29 09:16:50.000 1164 1164 240 240 2005-08-04 11:34:50.000 2 2 2020-12-23 07:17:22
8905 2005-07-30 01:11:11.000 2154 2154 240 240 2005-08-04 22:39:11.000 1 1 2020-12-23 07:17:28
10308 2005-08-01 04:22:49.000 588 588 240 240 2005-08-09 04:39:49.000 2 2 2020-12-23 07:17:48
11745 2005-08-17 09:00:01.000 4018 4018 240 240 2005-08-26 14:29:01.000 2 2 2020-12-23 07:18:08
12283 2005-08-18 04:54:25.000 574 574 240 240 2005-08-23 04:02:25.000 1 1 2020-12-23 07:18:15
13030 2005-08-19 08:28:11.000 2614 2614 240 240 2005-08-24 07:20:11.000 1 1 2020-12-23 07:18:26
13119 2005-08-19 11:44:59.000 1401 1401 240 240 2005-08-20 12:30:59.000 2 2 2020-12-23 07:18:27
13663 2005-08-20 08:12:33.000 3969 3969 240 240 2005-08-27 03:23:33.000 2 2 2020-12-23 07:18:35
14573 2005-08-21 16:44:32.000 2423 2423 240 240 2005-08-23 14:01:32.000 2 2 2020-12-23 07:18:49
15641 2005-08-23 08:06:49.000 3126 3126 240 240 2005-08-24 13:17:49.000 1 1 2020-12-23 07:19:04

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