home / sakila

rental

23 rows where customer_id = 345

✎ View and edit SQL

This data as json, xlsx, CSV (advanced)

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

rental_id ▼ rental_date inventory_id customer_id return_date staff_id last_update
206 2005-05-26 08:01:54.000 1717 1717 345 345 2005-05-27 06:26:54.000 1 1 2020-12-23 07:15:22
363 2005-05-27 07:14:00.000 4282 4282 345 345 2005-05-28 12:22:00.000 2 2 2020-12-23 07:15:24
1210 2005-06-15 02:57:51.000 7 7 345 345 2005-06-20 01:41:51.000 2 2 2020-12-23 07:15:36
1457 2005-06-15 20:05:49.000 730 730 345 345 2005-06-19 15:35:49.000 1 1 2020-12-23 07:15:39
1550 2005-06-16 01:58:35.000 2003 2003 345 345 2005-06-18 23:56:35.000 1 1 2020-12-23 07:15:40
2766 2005-06-19 17:45:15.000 3421 3421 345 345 2005-06-23 20:11:15.000 2 2 2020-12-23 07:15:58
4422 2005-07-07 22:09:45.000 1741 1741 345 345 2005-07-10 01:43:45.000 1 1 2020-12-23 07:16:22
4425 2005-07-07 22:22:44.000 877 877 345 345 2005-07-08 22:23:44.000 2 2 2020-12-23 07:16:22
4450 2005-07-07 23:20:05.000 1252 1252 345 345 2005-07-13 19:50:05.000 2 2 2020-12-23 07:16:22
5508 2005-07-10 00:50:01.000 2977 2977 345 345 2005-07-16 19:07:01.000 1 1 2020-12-23 07:16:38
6307 2005-07-11 18:04:29.000 4029 4029 345 345 2005-07-17 23:40:29.000 2 2 2020-12-23 07:16:49
7092 2005-07-27 04:46:00.000 1433 1433 345 345 2005-08-03 07:22:00.000 2 2 2020-12-23 07:17:01
8129 2005-07-28 19:47:02.000 2546 2546 345 345 2005-07-31 21:33:02.000 2 2 2020-12-23 07:17:16
8694 2005-07-29 16:44:48.000 503 503 345 345 2005-08-06 16:28:48.000 1 1 2020-12-23 07:17:25
9163 2005-07-30 11:23:22.000 4562 4562 345 345 2005-07-31 07:34:22.000 2 2 2020-12-23 07:17:32
9207 2005-07-30 12:49:57.000 1346 1346 345 345 2005-07-31 14:32:57.000 2 2 2020-12-23 07:17:32
10215 2005-08-01 01:04:28.000 838 838 345 345 2005-08-09 21:43:28.000 2 2 2020-12-23 07:17:47
10982 2005-08-02 04:19:11.000 2508 2508 345 345 2005-08-04 00:20:11.000 2 2 2020-12-23 07:17:57
11865 2005-08-17 14:03:46.000 2577 2577 345 345 2005-08-19 08:39:46.000 1 1 2020-12-23 07:18:09
12485 2005-08-18 12:41:41.000 422 422 345 345 2005-08-22 16:38:41.000 2 2 2020-12-23 07:18:18
12805 2005-08-19 00:36:34.000 2964 2964 345 345 2005-08-26 20:38:34.000 1 1 2020-12-23 07:18:22
14702 2005-08-21 21:00:03.000 4096 4096 345 345 2005-08-30 16:59:03.000 1 1 2020-12-23 07:18:50
15551 2005-08-23 04:28:25.000 3570 3570 345 345 2005-08-26 07:19:25.000 1 1 2020-12-23 07:19:03

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