home / sakila

rental

17 rows where customer_id = 555

✎ 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
3232 2005-06-21 02:30:37.000 1972 1972 555 555 2005-06-29 03:10:37.000 1 1 2020-12-23 07:16:04
4875 2005-07-08 19:24:17.000 843 843 555 555 2005-07-11 19:15:17.000 2 2 2020-12-23 07:16:29
8161 2005-07-28 21:11:00.000 848 848 555 555 2005-08-03 23:32:00.000 1 1 2020-12-23 07:17:17
8245 2005-07-29 00:37:09.000 3330 3330 555 555 2005-08-05 05:48:09.000 2 2 2020-12-23 07:17:18
9299 2005-07-30 16:32:51.000 1515 1515 555 555 2005-08-08 15:28:51.000 2 2 2020-12-23 07:17:34
9990 2005-07-31 17:24:21.000 4481 4481 555 555 2005-08-09 17:14:21.000 2 2 2020-12-23 07:17:44
10076 2005-07-31 20:00:34.000 1117 1117 555 555 2005-08-10 00:37:34.000 2 2 2020-12-23 07:17:45
10921 2005-08-02 02:14:33.000 1820 1820 555 555 2005-08-09 20:58:33.000 2 2 2020-12-23 07:17:57
11168 2005-08-02 10:19:42.000 468 468 555 555 2005-08-04 08:42:42.000 1 1 2020-12-23 07:18:00
11718 2005-08-17 07:44:42.000 3673 3673 555 555 2005-08-23 03:02:42.000 2 2 2020-12-23 07:18:08
11747 2005-08-17 09:03:31.000 1041 1041 555 555 2005-08-19 08:23:31.000 2 2 2020-12-23 07:18:08
12091 2005-08-17 22:22:50.000 2161 2161 555 555 2005-08-27 03:55:50.000 1 1 2020-12-23 07:18:13
12150 2005-08-18 00:13:55.000 3781 3781 555 555 2005-08-20 23:35:55.000 2 2 2020-12-23 07:18:13
12182 2005-08-18 01:30:19.000 296 296 555 555 2005-08-21 05:52:19.000 1 1 2020-12-23 07:18:14
12388 2005-08-18 08:48:09.000 4016 4016 555 555 2005-08-26 09:05:09.000 2 2 2020-12-23 07:18:17
12883 2005-08-19 03:33:47.000 964 964 555 555 2005-08-23 21:55:47.000 1 1 2020-12-23 07:18:23
15102 2005-08-22 11:58:58.000 2317 2317 555 555 2005-08-29 08:37:58.000 1 1 2020-12-23 07:18:56

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