home / sakila

rental

17 rows where customer_id = 223

✎ 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
524 2005-05-28 03:57:28.000 1962 1962 223 223 2005-05-31 05:20:28.000 1 1 2020-12-23 07:15:26
1839 2005-06-16 23:22:22.000 2750 2750 223 223 2005-06-23 00:33:22.000 1 1 2020-12-23 07:15:44
2334 2005-06-18 10:56:24.000 3076 3076 223 223 2005-06-22 10:38:24.000 2 2 2020-12-23 07:15:52
3513 2005-07-06 00:45:57.000 4225 4225 223 223 2005-07-11 19:04:57.000 2 2 2020-12-23 07:16:08
3705 2005-07-06 10:17:59.000 65 65 223 223 2005-07-10 15:31:59.000 1 1 2020-12-23 07:16:11
4874 2005-07-08 19:23:38.000 2386 2386 223 223 2005-07-13 14:39:38.000 2 2 2020-12-23 07:16:29
5996 2005-07-11 01:18:33.000 4263 4263 223 223 2005-07-17 04:18:33.000 1 1 2020-12-23 07:16:45
7085 2005-07-27 04:35:44.000 2603 2603 223 223 2005-08-05 07:10:44.000 2 2 2020-12-23 07:17:01
8362 2005-07-29 05:09:11.000 2287 2287 223 223 2005-08-04 00:08:11.000 2 2 2020-12-23 07:17:20
10053 2005-07-31 19:15:39.000 4102 4102 223 223 2005-08-07 22:32:39.000 1 1 2020-12-23 07:17:44
11040 2005-08-02 06:03:22.000 2297 2297 223 223 2005-08-03 07:58:22.000 1 1 2020-12-23 07:17:58
12927 2005-08-19 05:02:46.000 1171 1171 223 223 2005-08-23 01:08:46.000 1 1 2020-12-23 07:18:24
13576 2005-08-20 05:19:56.000 2669 2669 223 223 2005-08-22 09:08:56.000 2 2 2020-12-23 07:18:34
14496 2005-08-21 14:07:35.000 2185 2185 223 223 2005-08-24 12:31:35.000 1 1 2020-12-23 07:18:48
15257 2005-08-22 18:21:04.000 915 915 223 223 2005-08-30 20:13:04.000 1 1 2020-12-23 07:18:59
15546 2005-08-23 04:20:38.000 2087 2087 223 223 2005-09-01 09:57:38.000 2 2 2020-12-23 07:19:03
15662 2005-08-23 08:52:50.000 3028 3028 223 223 2005-08-24 08:08:50.000 1 1 2020-12-23 07:19:04

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