home / sakila

rental

21 rows where customer_id = 501

✎ 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
493 2005-05-28 00:34:11.000 184 184 501 501 2005-05-30 18:40:11.000 1 1 2020-12-23 07:15:26
605 2005-05-28 14:39:10.000 4232 4232 501 501 2005-06-01 09:28:10.000 2 2 2020-12-23 07:15:27
3222 2005-06-21 01:50:29.000 4023 4023 501 501 2005-06-27 00:52:29.000 2 2 2020-12-23 07:16:04
3412 2005-06-21 16:44:31.000 3036 3036 501 501 2005-06-28 16:15:31.000 2 2 2020-12-23 07:16:07
3541 2005-07-06 01:50:11.000 1204 1204 501 501 2005-07-12 03:24:11.000 1 1 2020-12-23 07:16:08
3723 2005-07-06 11:12:02.000 4554 4554 501 501 2005-07-14 16:45:02.000 2 2 2020-12-23 07:16:11
4769 2005-07-08 15:29:16.000 3462 3462 501 501 2005-07-09 18:42:16.000 2 2 2020-12-23 07:16:27
5520 2005-07-10 01:30:41.000 2527 2527 501 501 2005-07-15 21:37:41.000 2 2 2020-12-23 07:16:38
6095 2005-07-11 06:06:41.000 727 727 501 501 2005-07-19 06:14:41.000 1 1 2020-12-23 07:16:46
7456 2005-07-27 18:34:53.000 1959 1959 501 501 2005-07-29 17:46:53.000 2 2 2020-12-23 07:17:07
8021 2005-07-28 15:45:24.000 1920 1920 501 501 2005-08-04 10:49:24.000 1 1 2020-12-23 07:17:15
8529 2005-07-29 10:24:31.000 1055 1055 501 501 2005-08-01 16:06:31.000 1 1 2020-12-23 07:17:22
9359 2005-07-30 18:39:28.000 21 21 501 501 2005-07-31 15:39:28.000 1 1 2020-12-23 07:17:34
10817 2005-08-01 22:51:08.000 3056 3056 501 501 2005-08-10 16:55:08.000 2 2 2020-12-23 07:17:55
11393 2005-08-02 18:44:29.000 1033 1033 501 501 2005-08-11 23:58:29.000 1 1 2020-12-23 07:18:03
11640 2005-08-17 04:44:33.000 1718 1718 501 501 2005-08-21 09:29:33.000 2 2 2020-12-23 07:18:07
11799 2005-08-17 11:25:25.000 40 40 501 501 2005-08-25 13:03:25.000 2 2 2020-12-23 07:18:09
12914 2005-08-19 04:25:59.000 4396 4396 501 501 2005-08-23 08:04:59.000 2 2 2020-12-23 07:18:24
13889 2005-08-20 15:40:06.000 4406 4406 501 501 2005-08-22 14:09:06.000 2 2 2020-12-23 07:18:39
15239 2005-08-22 17:46:17.000 1809 1809 501 501 2005-08-26 19:03:17.000 1 1 2020-12-23 07:18:58
15699 2005-08-23 10:20:35.000 4155 4155 501 501 2005-08-30 13:56:35.000 1 1 2020-12-23 07:19:05

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.96ms