home / sakila

rental

20 rows where customer_id = 509

✎ 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
22 2005-05-25 02:19:23.000 727 727 509 509 2005-05-26 04:52:23.000 2 2 2020-12-23 07:15:20
831 2005-05-29 22:50:25.000 3912 3912 509 509 2005-06-06 02:27:25.000 1 1 2020-12-23 07:15:31
1267 2005-06-15 07:21:21.000 4246 4246 509 509 2005-06-17 08:12:21.000 2 2 2020-12-23 07:15:37
2919 2005-06-20 04:10:16.000 2835 2835 509 509 2005-06-27 06:34:16.000 1 1 2020-12-23 07:16:00
4139 2005-07-07 08:17:35.000 2094 2094 509 509 2005-07-14 14:01:35.000 2 2 2020-12-23 07:16:18
4266 2005-07-07 14:34:50.000 1578 1578 509 509 2005-07-08 09:23:50.000 2 2 2020-12-23 07:16:19
4832 2005-07-08 18:07:05.000 1838 1838 509 509 2005-07-10 19:37:05.000 2 2 2020-12-23 07:16:28
5008 2005-07-09 01:31:42.000 824 824 509 509 2005-07-11 22:34:42.000 2 2 2020-12-23 07:16:31
6591 2005-07-12 07:13:46.000 2846 2846 509 509 2005-07-16 05:15:46.000 2 2 2020-12-23 07:16:54
7848 2005-07-28 09:24:31.000 162 162 509 509 2005-08-05 05:11:31.000 2 2 2020-12-23 07:17:12
8114 2005-07-28 19:14:06.000 815 815 509 509 2005-08-05 13:16:06.000 1 1 2020-12-23 07:17:16
8214 2005-07-28 23:37:57.000 352 352 509 509 2005-08-07 00:29:57.000 2 2 2020-12-23 07:17:18
8240 2005-07-29 00:33:32.000 1975 1975 509 509 2005-08-05 21:25:32.000 2 2 2020-12-23 07:17:18
10189 2005-08-01 00:25:00.000 616 616 509 509 2005-08-03 06:01:00.000 2 2 2020-12-23 07:17:46
10988 2005-08-02 04:38:17.000 1157 1157 509 509 2005-08-09 00:09:17.000 1 1 2020-12-23 07:17:57
11814 2005-08-17 12:09:20.000 3462 3462 509 509 2005-08-25 16:56:20.000 2 2 2020-12-23 07:18:09
12109 2005-08-17 22:58:35.000 1423 1423 509 509 2005-08-25 19:44:35.000 2 2 2020-12-23 07:18:13
14045 2005-08-20 21:50:11.000 3010 3010 509 509 2005-08-25 19:03:11.000 2 2 2020-12-23 07:18:41
14994 2005-08-22 07:52:24.000 1601 1601 509 509 2005-08-26 09:57:24.000 1 1 2020-12-23 07:18:55
15965 2005-08-23 19:46:39.000 3449 3449 509 509 2005-08-24 20:08:39.000 2 2 2020-12-23 07:19:09

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