home / sakila

rental

26 rows where customer_id = 31

✎ 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
1656 2005-06-16 10:05:40.000 2253 2253 31 31 2005-06-22 06:26:40.000 1 1 2020-12-23 07:15:42
1838 2005-06-16 23:20:16.000 513 513 31 31 2005-06-20 02:34:16.000 1 1 2020-12-23 07:15:44
2233 2005-06-18 03:57:36.000 3063 3063 31 31 2005-06-21 09:42:36.000 2 2 2020-12-23 07:15:50
2341 2005-06-18 11:35:30.000 638 638 31 31 2005-06-27 11:56:30.000 2 2 2020-12-23 07:15:52
2396 2005-06-18 15:49:48.000 1986 1986 31 31 2005-06-27 20:31:48.000 2 2 2020-12-23 07:15:52
2438 2005-06-18 18:34:21.000 184 184 31 31 2005-06-19 16:50:21.000 1 1 2020-12-23 07:15:53
2530 2005-06-19 01:20:00.000 4166 4166 31 31 2005-06-23 04:10:00.000 1 1 2020-12-23 07:15:54
2648 2005-06-19 10:06:20.000 1620 1620 31 31 2005-06-21 04:30:20.000 2 2 2020-12-23 07:15:56
3117 2005-06-20 18:05:15.000 2184 2184 31 31 2005-06-26 17:28:15.000 1 1 2020-12-23 07:16:02
3172 2005-06-20 22:19:25.000 1758 1758 31 31 2005-06-24 17:18:25.000 2 2 2020-12-23 07:16:03
3205 2005-06-21 00:38:47.000 2964 2964 31 31 2005-06-21 22:49:47.000 1 1 2020-12-23 07:16:03
3701 2005-07-06 10:12:45.000 3679 3679 31 31 2005-07-09 08:52:45.000 1 1 2020-12-23 07:16:11
3967 2005-07-06 22:45:10.000 2510 2510 31 31 2005-07-09 23:54:10.000 2 2 2020-12-23 07:16:15
4122 2005-07-07 07:15:35.000 273 273 31 31 2005-07-14 12:10:35.000 1 1 2020-12-23 07:16:17
4738 2005-07-08 13:24:58.000 2021 2021 31 31 2005-07-17 17:44:58.000 2 2 2020-12-23 07:16:27
6208 2005-07-11 12:34:56.000 672 672 31 31 2005-07-19 15:17:56.000 1 1 2020-12-23 07:16:48
6580 2005-07-12 06:26:10.000 1543 1543 31 31 2005-07-13 06:44:10.000 1 1 2020-12-23 07:16:53
7000 2005-07-27 01:23:24.000 2024 2024 31 31 2005-08-03 02:10:24.000 2 2 2020-12-23 07:17:00
7138 2005-07-27 06:47:13.000 1418 1418 31 31 2005-08-03 01:12:13.000 2 2 2020-12-23 07:17:02
7178 2005-07-27 08:09:25.000 1899 1899 31 31 2005-07-29 13:00:25.000 2 2 2020-12-23 07:17:02
7464 2005-07-27 18:49:42.000 845 845 31 31 2005-07-28 20:45:42.000 2 2 2020-12-23 07:17:07
8997 2005-07-30 04:53:56.000 850 850 31 31 2005-08-03 07:10:56.000 1 1 2020-12-23 07:17:29
12085 2005-08-17 22:17:09.000 600 600 31 31 2005-08-21 01:45:09.000 1 1 2020-12-23 07:18:12
12377 2005-08-18 08:26:05.000 4564 4564 31 31 2005-08-23 02:51:05.000 2 2 2020-12-23 07:18:16
15682 2005-08-23 09:37:34.000 3293 3293 31 31 2005-08-31 06:01:34.000 1 1 2020-12-23 07:19:04
15816 2005-08-23 14:58:06.000 3628 3628 31 31 2005-08-28 13:30:06.000 1 1 2020-12-23 07:19:07

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