home / sakila

rental

26 rows where customer_id = 512

✎ 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
1176 2005-06-15 00:28:37.000 2715 2715 512 512 2005-06-21 21:42:37.000 1 1 2020-12-23 07:15:35
2029 2005-06-17 13:10:59.000 914 914 512 512 2005-06-19 18:15:59.000 1 1 2020-12-23 07:15:47
2364 2005-06-18 13:37:32.000 2856 2856 512 512 2005-06-23 14:18:32.000 1 1 2020-12-23 07:15:52
4752 2005-07-08 14:15:20.000 3250 3250 512 512 2005-07-12 13:22:20.000 1 1 2020-12-23 07:16:27
4799 2005-07-08 16:49:27.000 4112 4112 512 512 2005-07-12 19:58:27.000 2 2 2020-12-23 07:16:28
5064 2005-07-09 04:38:51.000 373 373 512 512 2005-07-18 00:33:51.000 2 2 2020-12-23 07:16:32
5813 2005-07-10 15:34:37.000 942 942 512 512 2005-07-17 16:14:37.000 2 2 2020-12-23 07:16:43
7219 2005-07-27 09:35:36.000 4046 4046 512 512 2005-07-29 04:44:36.000 1 1 2020-12-23 07:17:03
7507 2005-07-27 20:31:48.000 3618 3618 512 512 2005-08-02 17:27:48.000 1 1 2020-12-23 07:17:07
7715 2005-07-28 04:32:38.000 3210 3210 512 512 2005-08-05 00:37:38.000 2 2 2020-12-23 07:17:10
8868 2005-07-30 00:02:26.000 1229 1229 512 512 2005-08-01 22:28:26.000 2 2 2020-12-23 07:17:27
9055 2005-07-30 07:13:07.000 634 634 512 512 2005-08-01 12:18:07.000 1 1 2020-12-23 07:17:30
10232 2005-08-01 01:50:55.000 586 586 512 512 2005-08-03 04:12:55.000 1 1 2020-12-23 07:17:47
10670 2005-08-01 17:07:16.000 156 156 512 512 2005-08-10 11:46:16.000 2 2 2020-12-23 07:17:53
11818 2005-08-17 12:22:04.000 213 213 512 512 2005-08-25 15:59:04.000 2 2 2020-12-23 07:18:09
12786 2006-02-14 15:16:03.000 97 97 512 512   1 1 2020-12-23 07:18:22
12957 2005-08-19 06:12:44.000 2219 2219 512 512 2005-08-28 10:49:44.000 2 2 2020-12-23 07:18:25
13156 2005-08-19 13:10:42.000 770 770 512 512 2005-08-25 15:08:42.000 2 2 2020-12-23 07:18:28
13771 2005-08-20 11:47:21.000 2278 2278 512 512 2005-08-22 17:09:21.000 1 1 2020-12-23 07:18:37
14288 2005-08-21 06:57:34.000 587 587 512 512 2005-08-26 11:32:34.000 1 1 2020-12-23 07:18:45
14870 2005-08-22 03:23:20.000 2170 2170 512 512 2005-08-23 06:50:20.000 2 2 2020-12-23 07:18:53
15153 2005-08-22 14:26:01.000 1051 1051 512 512 2005-08-27 14:17:01.000 2 2 2020-12-23 07:18:57
15265 2005-08-22 18:35:59.000 1763 1763 512 512 2005-08-28 21:18:59.000 2 2 2020-12-23 07:18:59
15317 2005-08-22 20:14:13.000 2325 2325 512 512 2005-08-29 18:32:13.000 1 1 2020-12-23 07:19:00
15733 2005-08-23 11:37:32.000 4185 4185 512 512 2005-08-28 16:27:32.000 1 1 2020-12-23 07:19:05
15990 2005-08-23 20:25:11.000 3233 3233 512 512 2005-08-25 15:01:11.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 9.523ms