home / sakila

rental

18 rows where customer_id = 218

✎ 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
1459 2005-06-15 20:25:53.000 1862 1862 218 218 2005-06-22 23:34:53.000 2 2 2020-12-23 07:15:39
2262 2005-06-18 05:49:46.000 4172 4172 218 218 2005-06-20 00:25:46.000 2 2 2020-12-23 07:15:51
2267 2005-06-18 06:10:23.000 2086 2086 218 218 2005-06-20 00:39:23.000 2 2 2020-12-23 07:15:51
4898 2005-07-08 20:31:43.000 3212 3212 218 218 2005-07-15 15:58:43.000 2 2 2020-12-23 07:16:29
5226 2005-07-09 12:10:44.000 3128 3128 218 218 2005-07-11 17:32:44.000 2 2 2020-12-23 07:16:34
5737 2005-07-10 11:50:04.000 1118 1118 218 218 2005-07-13 10:37:04.000 1 1 2020-12-23 07:16:41
7090 2005-07-27 04:43:53.000 3495 3495 218 218 2005-07-29 07:33:53.000 2 2 2020-12-23 07:17:01
7236 2005-07-27 10:09:39.000 3004 3004 218 218 2005-08-03 16:05:39.000 1 1 2020-12-23 07:17:03
9018 2005-07-30 05:28:40.000 1982 1982 218 218 2005-08-07 01:34:40.000 1 1 2020-12-23 07:17:29
9902 2005-07-31 14:24:33.000 486 486 218 218 2005-08-09 11:11:33.000 2 2 2020-12-23 07:17:42
10114 2005-07-31 21:12:58.000 3881 3881 218 218 2005-08-02 19:45:58.000 2 2 2020-12-23 07:17:45
11654 2005-08-17 05:06:19.000 1048 1048 218 218 2005-08-18 04:32:19.000 2 2 2020-12-23 07:18:07
12481 2005-08-18 12:31:34.000 2424 2424 218 218 2005-08-21 16:08:34.000 2 2 2020-12-23 07:18:18
12974 2005-08-19 06:51:02.000 3599 3599 218 218 2005-08-25 11:48:02.000 2 2 2020-12-23 07:18:25
13708 2005-08-20 09:34:07.000 2236 2236 218 218 2005-08-26 10:17:07.000 1 1 2020-12-23 07:18:36
13947 2005-08-20 17:46:06.000 2562 2562 218 218 2005-08-29 23:44:06.000 2 2 2020-12-23 07:18:40
14848 2005-08-22 02:14:19.000 395 395 218 218 2005-08-26 02:54:19.000 2 2 2020-12-23 07:18:52
15575 2005-08-23 05:30:19.000 3916 3916 218 218 2005-08-27 05:19:19.000 2 2 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 10.568ms