home / sakila

rental

18 rows where customer_id = 542

✎ 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
220 2005-05-26 10:06:49.000 1259 1259 542 542 2005-06-01 07:43:49.000 1 1 2020-12-23 07:15:23
376 2005-05-27 08:58:15.000 3197 3197 542 542 2005-06-02 04:48:15.000 1 1 2020-12-23 07:15:25
2610 2005-06-19 07:16:20.000 3845 3845 542 542 2005-06-25 09:39:20.000 2 2 2020-12-23 07:15:56
2957 2005-06-20 06:53:47.000 4034 4034 542 542 2005-06-29 09:21:47.000 2 2 2020-12-23 07:16:00
5293 2005-07-09 15:17:23.000 2880 2880 542 542 2005-07-11 11:23:23.000 2 2 2020-12-23 07:16:35
5477 2005-07-09 23:43:49.000 994 994 542 542 2005-07-15 05:03:49.000 2 2 2020-12-23 07:16:38
6077 2005-07-11 05:06:08.000 2154 2154 542 542 2005-07-16 10:29:08.000 1 1 2020-12-23 07:16:46
6325 2005-07-11 19:06:01.000 4556 4556 542 542 2005-07-18 18:25:01.000 2 2 2020-12-23 07:16:50
6887 2005-07-12 21:00:23.000 4487 4487 542 542 2005-07-21 17:46:23.000 1 1 2020-12-23 07:16:58
7672 2005-07-28 02:49:41.000 573 573 542 542 2005-08-04 02:38:41.000 1 1 2020-12-23 07:17:10
8533 2005-07-29 10:29:16.000 551 551 542 542 2005-08-01 06:52:16.000 1 1 2020-12-23 07:17:22
8544 2005-07-29 11:02:08.000 412 412 542 542 2005-08-06 15:06:08.000 2 2 2020-12-23 07:17:23
10280 2005-08-01 03:27:15.000 1457 1457 542 542 2005-08-07 23:01:15.000 2 2 2020-12-23 07:17:47
11583 2005-08-17 02:08:13.000 133 133 542 542 2005-08-20 23:13:13.000 2 2 2020-12-23 07:18:06
11903 2005-08-17 15:37:45.000 1196 1196 542 542 2005-08-23 18:31:45.000 2 2 2020-12-23 07:18:10
12819 2005-08-19 01:05:05.000 1117 1117 542 542 2005-08-22 05:50:05.000 1 1 2020-12-23 07:18:22
13447 2005-08-20 00:09:36.000 285 285 542 542 2005-08-25 01:22:36.000 1 1 2020-12-23 07:18:32
14982 2005-08-22 07:20:55.000 2333 2333 542 542 2005-08-31 04:35:55.000 2 2 2020-12-23 07:18:54

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