home / sakila

rental

5 rows where inventory_id = 4279

✎ 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
942 2005-05-30 15:05:47.000 4279 4279 473 473 2005-06-08 15:59:47.000 2 2 2020-12-23 07:15:32
2053 2005-06-17 15:19:34.000 4279 4279 521 521 2005-06-19 10:06:34.000 2 2 2020-12-23 07:15:48
4748 2005-07-08 13:59:38.000 4279 4279 9 9 2005-07-15 16:51:38.000 1 1 2020-12-23 07:16:27
9170 2005-07-30 11:35:24.000 4279 4279 425 425 2005-08-05 05:36:24.000 1 1 2020-12-23 07:17:32
11626 2005-08-17 04:25:42.000 4279 4279 266 266 2005-08-23 05:46:42.000 1 1 2020-12-23 07:18:06

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