home / sakila

rental

27 rows where customer_id = 333

✎ 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
4 2005-05-24 23:04:41.000 2452 2452 333 333 2005-06-03 01:43:41.000 2 2 2020-12-23 07:15:20
1667 2005-06-16 10:18:59.000 2362 2362 333 333 2005-06-22 14:45:59.000 2 2 2020-12-23 07:15:42
2149 2005-06-17 22:50:00.000 3365 3365 333 333 2005-06-26 18:40:00.000 1 1 2020-12-23 07:15:49
2929 2005-06-20 04:47:39.000 3389 3389 333 333 2005-06-25 23:16:39.000 2 2 2020-12-23 07:16:00
3110 2005-06-20 17:40:12.000 2008 2008 333 333 2005-06-24 17:09:12.000 1 1 2020-12-23 07:16:02
5032 2005-07-09 02:39:47.000 2257 2257 333 333 2005-07-10 07:45:47.000 1 1 2020-12-23 07:16:31
5645 2005-07-10 06:58:21.000 1586 1586 333 333 2005-07-18 04:19:21.000 2 2 2020-12-23 07:16:40
5892 2005-07-10 20:02:42.000 4322 4322 333 333 2005-07-11 20:02:42.000 1 1 2020-12-23 07:16:44
6275 2005-07-11 16:12:11.000 3599 3599 333 333 2005-07-17 20:19:11.000 2 2 2020-12-23 07:16:49
6931 2005-07-26 23:02:57.000 2794 2794 333 333 2005-07-28 04:48:57.000 2 2 2020-12-23 07:16:59
6958 2005-07-27 00:02:41.000 657 657 333 333 2005-07-28 00:53:41.000 2 2 2020-12-23 07:16:59
7076 2005-07-27 04:12:14.000 2821 2821 333 333 2005-08-05 00:44:14.000 1 1 2020-12-23 07:17:01
7246 2005-07-27 10:30:41.000 2003 2003 333 333 2005-07-30 05:44:41.000 1 1 2020-12-23 07:17:03
8719 2005-07-29 17:45:45.000 995 995 333 333 2005-08-01 13:53:45.000 1 1 2020-12-23 07:17:25
9148 2005-07-30 10:39:10.000 1407 1407 333 333 2005-08-04 07:17:10.000 2 2 2020-12-23 07:17:31
9338 2005-07-30 18:03:13.000 1482 1482 333 333 2005-08-08 23:57:13.000 2 2 2020-12-23 07:17:34
10035 2005-07-31 18:46:46.000 2694 2694 333 333 2005-08-04 20:33:46.000 1 1 2020-12-23 07:17:44
10062 2005-07-31 19:24:55.000 1815 1815 333 333 2005-08-03 22:51:55.000 2 2 2020-12-23 07:17:45
10844 2005-08-01 23:46:58.000 1516 1516 333 333 2005-08-09 19:42:58.000 2 2 2020-12-23 07:17:56
12427 2005-08-18 10:24:17.000 1759 1759 333 333 2005-08-27 14:22:17.000 1 1 2020-12-23 07:18:17
12661 2005-08-18 19:10:10.000 1547 1547 333 333 2005-08-22 20:30:10.000 1 1 2020-12-23 07:18:20
13579 2005-08-20 05:22:06.000 4237 4237 333 333 2005-08-28 02:33:06.000 2 2 2020-12-23 07:18:34
13710 2005-08-20 09:35:20.000 756 756 333 333 2005-08-21 05:29:20.000 2 2 2020-12-23 07:18:36
14057 2005-08-20 22:22:59.000 1526 1526 333 333 2005-08-25 16:58:59.000 2 2 2020-12-23 07:18:41
14740 2005-08-21 22:35:33.000 1717 1717 333 333 2005-08-26 17:49:33.000 1 1 2020-12-23 07:18:51
15253 2005-08-22 18:05:21.000 4143 4143 333 333 2005-08-23 18:06:21.000 2 2 2020-12-23 07:18:59
15313 2005-08-22 19:59:42.000 2587 2587 333 333 2005-08-24 15:03:42.000 2 2 2020-12-23 07:18:59

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