home / sakila

rental

28 rows where customer_id = 221

✎ 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
226 2005-05-26 10:44:04.000 4181 4181 221 221 2005-05-31 13:26:04.000 2 2 2020-12-23 07:15:23
1369 2005-06-15 14:29:14.000 679 679 221 221 2005-06-16 13:01:14.000 1 1 2020-12-23 07:15:38
2331 2005-06-18 10:50:09.000 1546 1546 221 221 2005-06-25 14:30:09.000 1 1 2020-12-23 07:15:52
2473 2005-06-18 20:42:45.000 3876 3876 221 221 2005-06-19 20:17:45.000 1 1 2020-12-23 07:15:54
2660 2005-06-19 10:50:02.000 4341 4341 221 221 2005-06-28 12:49:02.000 1 1 2020-12-23 07:15:56
3200 2005-06-21 00:22:47.000 4117 4117 221 221 2005-06-27 05:52:47.000 2 2 2020-12-23 07:16:03
4293 2005-07-07 15:53:47.000 984 984 221 221 2005-07-10 18:11:47.000 1 1 2020-12-23 07:16:20
4649 2005-07-08 09:32:05.000 1116 1116 221 221 2005-07-15 08:37:05.000 2 2 2020-12-23 07:16:25
4693 2005-07-08 11:07:36.000 1694 1694 221 221 2005-07-14 08:40:36.000 1 1 2020-12-23 07:16:26
5058 2005-07-09 04:20:35.000 917 917 221 221 2005-07-18 08:09:35.000 2 2 2020-12-23 07:16:31
5920 2005-07-10 21:33:58.000 1893 1893 221 221 2005-07-17 19:41:58.000 2 2 2020-12-23 07:16:44
7101 2005-07-27 05:06:34.000 2006 2006 221 221 2005-07-29 06:12:34.000 1 1 2020-12-23 07:17:01
7129 2005-07-27 06:18:01.000 1930 1930 221 221 2005-07-28 02:38:01.000 1 1 2020-12-23 07:17:02
7531 2005-07-27 21:19:34.000 2393 2393 221 221 2005-08-06 01:07:34.000 2 2 2020-12-23 07:17:08
8486 2005-07-29 08:53:38.000 1759 1759 221 221 2005-08-01 14:12:38.000 2 2 2020-12-23 07:17:22
9320 2005-07-30 17:16:39.000 909 909 221 221 2005-08-06 18:43:39.000 2 2 2020-12-23 07:17:34
9453 2005-07-30 22:20:04.000 1988 1988 221 221 2005-08-08 02:27:04.000 1 1 2020-12-23 07:17:36
9853 2005-07-31 12:58:20.000 1782 1782 221 221 2005-08-04 10:47:20.000 1 1 2020-12-23 07:17:42
11680 2005-08-17 06:12:27.000 4538 4538 221 221 2005-08-23 08:54:27.000 1 1 2020-12-23 07:18:07
11693 2005-08-17 06:56:56.000 793 793 221 221 2005-08-24 06:20:56.000 2 2 2020-12-23 07:18:07
11802 2005-08-17 11:32:51.000 2815 2815 221 221 2005-08-22 10:56:51.000 1 1 2020-12-23 07:18:09
12324 2005-08-18 06:38:20.000 2436 2436 221 221 2005-08-20 02:28:20.000 2 2 2020-12-23 07:18:16
12620 2005-08-18 17:26:38.000 2663 2663 221 221 2005-08-25 13:24:38.000 1 1 2020-12-23 07:18:20
13434 2005-08-19 23:34:26.000 2073 2073 221 221 2005-08-23 18:33:26.000 1 1 2020-12-23 07:18:32
14322 2005-08-21 08:06:30.000 2818 2818 221 221 2005-08-29 10:12:30.000 2 2 2020-12-23 07:18:45
14371 2005-08-21 09:37:16.000 2197 2197 221 221 2005-08-27 13:50:16.000 2 2 2020-12-23 07:18:46
14419 2005-08-21 11:15:46.000 3146 3146 221 221 2005-08-30 16:37:46.000 1 1 2020-12-23 07:18:47
15125 2005-08-22 12:53:22.000 3942 3942 221 221 2005-08-29 18:44:22.000 1 1 2020-12-23 07:18:57

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