home / sakila

rental

21 rows where customer_id = 412

✎ 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
191 2005-05-26 06:14:06.000 4365 4365 412 412 2005-05-28 05:33:06.000 1 1 2020-12-23 07:15:22
333 2005-05-27 02:52:21.000 4001 4001 412 412 2005-06-01 00:55:21.000 2 2 2020-12-23 07:15:24
717 2005-05-29 04:37:44.000 1383 1383 412 412 2005-05-30 05:48:44.000 2 2 2020-12-23 07:15:29
1043 2005-05-31 06:11:40.000 2322 2322 412 412 2005-06-08 09:15:40.000 2 2 2020-12-23 07:15:34
3292 2005-06-21 06:59:11.000 3288 3288 412 412 2005-06-23 07:11:11.000 1 1 2020-12-23 07:16:05
3888 2005-07-06 18:54:20.000 1945 1945 412 412 2005-07-12 17:13:20.000 2 2 2020-12-23 07:16:14
4074 2005-07-07 04:49:49.000 2347 2347 412 412 2005-07-12 04:51:49.000 2 2 2020-12-23 07:16:17
8036 2005-07-28 16:27:43.000 2741 2741 412 412 2005-08-01 13:41:43.000 2 2 2020-12-23 07:17:15
8330 2005-07-29 04:09:07.000 2294 2294 412 412 2005-08-05 05:00:07.000 2 2 2020-12-23 07:17:19
8411 2005-07-29 06:44:23.000 3085 3085 412 412 2005-08-07 03:56:23.000 1 1 2020-12-23 07:17:21
8674 2005-07-29 15:54:22.000 1744 1744 412 412 2005-07-31 12:15:22.000 1 1 2020-12-23 07:17:25
9881 2005-07-31 13:50:38.000 4209 4209 412 412 2005-08-06 08:58:38.000 1 1 2020-12-23 07:17:42
10381 2005-08-01 06:36:37.000 522 522 412 412 2005-08-05 11:17:37.000 1 1 2020-12-23 07:17:49
10467 2005-08-01 09:45:58.000 3773 3773 412 412 2005-08-09 10:17:58.000 2 2 2020-12-23 07:17:50
11027 2005-08-02 05:47:10.000 571 571 412 412 2005-08-05 23:51:10.000 1 1 2020-12-23 07:17:58
14068 2005-08-20 22:50:59.000 818 818 412 412 2005-08-29 00:45:59.000 1 1 2020-12-23 07:18:42
14535 2005-08-21 15:22:37.000 530 530 412 412 2005-08-29 19:23:37.000 2 2 2020-12-23 07:18:48
15314 2006-02-14 15:16:03.000 2754 2754 412 412   1 1 2020-12-23 07:18:59
15354 2005-08-22 21:18:59.000 4212 4212 412 412 2005-08-27 20:12:59.000 2 2 2020-12-23 07:19:00
15732 2005-08-23 11:35:12.000 3247 3247 412 412 2005-08-26 12:50:12.000 2 2 2020-12-23 07:19:05
15781 2005-08-23 13:41:05.000 4449 4449 412 412 2005-08-31 13:11:05.000 1 1 2020-12-23 07:19:06

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