home / sakila

rental

21 rows where customer_id = 301

✎ 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
27 2005-05-25 03:41:50.000 1225 1225 301 301 2005-05-30 01:13:50.000 2 2 2020-12-23 07:15:20
227 2005-05-26 10:51:46.000 214 214 301 301 2005-05-30 07:24:46.000 1 1 2020-12-23 07:15:23
955 2005-05-30 16:59:03.000 4140 4140 301 301 2005-05-31 11:58:03.000 2 2 2020-12-23 07:15:32
1853 2005-06-17 00:39:54.000 2949 2949 301 301 2005-06-19 00:22:54.000 2 2 2020-12-23 07:15:44
2611 2005-06-19 07:18:17.000 3682 3682 301 301 2005-06-21 10:19:17.000 1 1 2020-12-23 07:15:56
2925 2005-06-20 04:23:49.000 804 804 301 301 2005-06-22 04:37:49.000 2 2 2020-12-23 07:16:00
4316 2005-07-07 17:44:22.000 517 517 301 301 2005-07-14 15:12:22.000 2 2 2020-12-23 07:16:20
4834 2005-07-08 18:07:45.000 1288 1288 301 301 2005-07-14 15:27:45.000 1 1 2020-12-23 07:16:28
5119 2005-07-09 07:14:18.000 2996 2996 301 301 2005-07-18 04:07:18.000 1 1 2020-12-23 07:16:32
5511 2005-07-10 01:00:00.000 3678 3678 301 301 2005-07-12 20:44:00.000 1 1 2020-12-23 07:16:38
5730 2005-07-10 11:28:32.000 1903 1903 301 301 2005-07-11 11:45:32.000 2 2 2020-12-23 07:16:41
5807 2005-07-10 15:16:30.000 2092 2092 301 301 2005-07-11 14:02:30.000 2 2 2020-12-23 07:16:42
6833 2005-07-12 18:53:34.000 912 912 301 301 2005-07-19 22:21:34.000 2 2 2020-12-23 07:16:57
7318 2005-07-27 13:25:31.000 1954 1954 301 301 2005-07-31 11:44:31.000 2 2 2020-12-23 07:17:04
7818 2005-07-28 08:25:00.000 1672 1672 301 301 2005-07-29 14:07:00.000 1 1 2020-12-23 07:17:12
9435 2005-07-30 21:31:02.000 3116 3116 301 301 2005-08-05 22:34:02.000 1 1 2020-12-23 07:17:36
10883 2005-08-02 00:47:19.000 4 4 301 301 2005-08-03 00:02:19.000 1 1 2020-12-23 07:17:56
13183 2005-08-19 14:09:26.000 2404 2404 301 301 2005-08-28 08:44:26.000 2 2 2020-12-23 07:18:28
13633 2005-08-20 07:13:47.000 3227 3227 301 301 2005-08-24 11:25:47.000 1 1 2020-12-23 07:18:35
15201 2005-08-22 16:24:42.000 4456 4456 301 301 2005-08-31 17:54:42.000 1 1 2020-12-23 07:18:58
15268 2005-08-22 18:39:11.000 1245 1245 301 301 2005-08-26 21:46:11.000 1 1 2020-12-23 07:18:59

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