home / sakila

rental

32 rows where customer_id = 259

✎ View and edit SQL

This data as json, xlsx, CSV (advanced)

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

rental_id ▼ rental_date inventory_id customer_id return_date staff_id last_update
722 2005-05-29 05:30:31.000 4540 4540 259 259 2005-06-06 04:51:31.000 1 1 2020-12-23 07:15:29
901 2005-05-30 09:40:40.000 760 760 259 259 2005-06-02 10:32:40.000 1 1 2020-12-23 07:15:32
1147 2005-05-31 20:37:52.000 622 622 259 259 2005-06-06 19:23:52.000 2 2 2020-12-23 07:15:35
1641 2005-06-16 08:46:26.000 2925 2925 259 259 2005-06-24 14:39:26.000 2 2 2020-12-23 07:15:41
1723 2005-06-16 15:14:18.000 2417 2417 259 259 2005-06-23 15:45:18.000 2 2 2020-12-23 07:15:43
1813 2005-06-16 21:11:00.000 1236 1236 259 259 2005-06-24 15:30:00.000 1 1 2020-12-23 07:15:44
2375 2005-06-18 14:47:29.000 2175 2175 259 259 2005-06-26 13:52:29.000 2 2 2020-12-23 07:15:52
4199 2005-07-07 11:13:07.000 2120 2120 259 259 2005-07-11 07:17:07.000 1 1 2020-12-23 07:16:19
4489 2005-07-08 01:23:58.000 4306 4306 259 259 2005-07-09 01:35:58.000 2 2 2020-12-23 07:16:23
6074 2005-07-11 04:59:56.000 2876 2876 259 259 2005-07-13 23:31:56.000 1 1 2020-12-23 07:16:46
6539 2005-07-12 04:50:49.000 2275 2275 259 259 2005-07-19 03:23:49.000 1 1 2020-12-23 07:16:53
7188 2005-07-27 08:32:08.000 2199 2199 259 259 2005-07-28 08:02:08.000 1 1 2020-12-23 07:17:03
7774 2005-07-28 07:03:25.000 3483 3483 259 259 2005-08-03 02:05:25.000 1 1 2020-12-23 07:17:11
7817 2005-07-28 08:20:55.000 600 600 259 259 2005-07-30 11:55:55.000 1 1 2020-12-23 07:17:12
9205 2005-07-30 12:46:40.000 4165 4165 259 259 2005-08-08 14:58:40.000 1 1 2020-12-23 07:17:32
9282 2005-07-30 15:17:31.000 736 736 259 259 2005-08-07 20:46:31.000 1 1 2020-12-23 07:17:33
9444 2005-07-30 21:48:44.000 1134 1134 259 259 2005-08-08 22:36:44.000 2 2 2020-12-23 07:17:36
10510 2005-08-01 11:28:30.000 410 410 259 259 2005-08-07 11:37:30.000 1 1 2020-12-23 07:17:51
10781 2005-08-01 21:22:41.000 1321 1321 259 259 2005-08-06 01:02:41.000 1 1 2020-12-23 07:17:55
11184 2005-08-02 11:01:26.000 871 871 259 259 2005-08-11 06:29:26.000 1 1 2020-12-23 07:18:00
12680 2005-08-18 19:43:46.000 833 833 259 259 2005-08-27 00:08:46.000 2 2 2020-12-23 07:18:20
13109 2005-08-19 11:23:20.000 46 46 259 259 2005-08-25 17:05:20.000 1 1 2020-12-23 07:18:27
13112 2005-08-19 11:27:10.000 2074 2074 259 259 2005-08-22 05:32:10.000 1 1 2020-12-23 07:18:27
13366 2005-08-19 21:14:45.000 602 602 259 259 2005-08-21 03:06:45.000 1 1 2020-12-23 07:18:31
13598 2005-08-20 05:59:17.000 2803 2803 259 259 2005-08-29 01:02:17.000 1 1 2020-12-23 07:18:34
13649 2005-08-20 07:48:38.000 1495 1495 259 259 2005-08-23 07:43:38.000 2 2 2020-12-23 07:18:35
14067 2005-08-20 22:49:23.000 1376 1376 259 259 2005-08-29 22:28:23.000 2 2 2020-12-23 07:18:42
14170 2005-08-21 03:00:39.000 894 894 259 259 2005-08-27 23:07:39.000 1 1 2020-12-23 07:18:43
14966 2005-08-22 06:45:57.000 679 679 259 259 2005-08-31 10:02:57.000 1 1 2020-12-23 07:18:54
15425 2005-08-23 00:05:57.000 551 551 259 259 2005-09-01 05:08:57.000 1 1 2020-12-23 07:19:01
15473 2005-08-23 01:39:10.000 356 356 259 259 2005-08-25 03:48:10.000 1 1 2020-12-23 07:19:02
15689 2005-08-23 09:52:55.000 248 248 259 259 2005-08-29 11:15:55.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.069ms