home / sakila

rental

30 rows where customer_id = 296

✎ 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
162 2005-05-26 02:02:05.000 1229 1229 296 296 2005-05-27 03:38:05.000 2 2 2020-12-23 07:15:22
511 2005-05-28 03:04:04.000 3827 3827 296 296 2005-06-03 04:58:04.000 1 1 2020-12-23 07:15:26
869 2005-05-30 04:22:06.000 3399 3399 296 296 2005-06-03 09:18:06.000 2 2 2020-12-23 07:15:31
956 2005-05-30 17:30:28.000 647 647 296 296 2005-06-07 13:54:28.000 2 2 2020-12-23 07:15:32
1659 2005-06-16 10:11:46.000 1182 1182 296 296 2005-06-20 13:51:46.000 1 1 2020-12-23 07:15:42
3034 2005-06-20 12:15:50.000 2755 2755 296 296 2005-06-24 06:21:50.000 2 2 2020-12-23 07:16:01
3119 2005-06-20 18:11:44.000 683 683 296 296 2005-06-27 16:14:44.000 2 2 2020-12-23 07:16:02
3486 2005-07-05 23:29:55.000 4067 4067 296 296 2005-07-13 19:54:55.000 1 1 2020-12-23 07:16:08
3810 2005-07-06 15:18:44.000 342 342 296 296 2005-07-12 09:52:44.000 2 2 2020-12-23 07:16:13
4480 2005-07-08 00:56:30.000 4457 4457 296 296 2005-07-10 20:52:30.000 2 2 2020-12-23 07:16:23
5090 2005-07-09 05:48:22.000 1728 1728 296 296 2005-07-11 06:50:22.000 2 2 2020-12-23 07:16:32
5589 2005-07-10 04:22:58.000 3673 3673 296 296 2005-07-10 23:13:58.000 1 1 2020-12-23 07:16:39
6016 2005-07-11 02:04:45.000 651 651 296 296 2005-07-17 22:22:45.000 1 1 2020-12-23 07:16:45
6398 2005-07-11 22:34:49.000 1409 1409 296 296 2005-07-17 17:58:49.000 2 2 2020-12-23 07:16:51
6967 2005-07-27 00:16:31.000 1145 1145 296 296 2005-08-03 22:19:31.000 1 1 2020-12-23 07:16:59
7568 2005-07-27 22:38:53.000 1578 1578 296 296 2005-07-29 00:51:53.000 1 1 2020-12-23 07:17:08
8171 2005-07-28 21:32:57.000 3380 3380 296 296 2005-07-30 21:19:57.000 1 1 2020-12-23 07:17:17
9249 2005-07-30 14:15:02.000 2015 2015 296 296 2005-08-05 13:02:02.000 1 1 2020-12-23 07:17:33
9304 2005-07-30 16:41:34.000 2937 2937 296 296 2005-08-02 13:55:34.000 2 2 2020-12-23 07:17:34
11571 2005-08-17 01:37:51.000 203 203 296 296 2005-08-17 20:30:51.000 1 1 2020-12-23 07:18:06
11825 2005-08-17 12:43:30.000 2656 2656 296 296 2005-08-20 15:25:30.000 1 1 2020-12-23 07:18:09
12009 2006-02-14 15:16:03.000 2134 2134 296 296   2 2 2020-12-23 07:18:11
12689 2005-08-18 20:06:34.000 1066 1066 296 296 2005-08-22 20:11:34.000 2 2 2020-12-23 07:18:20
13471 2005-08-20 01:02:26.000 1391 1391 296 296 2005-08-25 06:37:26.000 2 2 2020-12-23 07:18:32
13702 2005-08-20 09:27:20.000 700 700 296 296 2005-08-29 15:04:20.000 2 2 2020-12-23 07:18:36
13819 2005-08-20 13:23:15.000 1459 1459 296 296 2005-08-22 16:02:15.000 2 2 2020-12-23 07:18:38
13991 2005-08-20 19:29:44.000 1971 1971 296 296 2005-08-24 21:10:44.000 1 1 2020-12-23 07:18:40
14571 2005-08-21 16:40:26.000 2218 2218 296 296 2005-08-29 17:10:26.000 1 1 2020-12-23 07:18:49
15023 2005-08-22 08:56:48.000 358 358 296 296 2005-08-29 08:13:48.000 1 1 2020-12-23 07:18:55
15866 2005-08-23 16:19:02.000 3828 3828 296 296 2005-08-31 12:29:02.000 2 2 2020-12-23 07:19:07

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