home / sakila

rental

5 rows where inventory_id = 4209

✎ View and edit SQL

This data as json, xlsx, CSV (advanced)

Suggested facets: rental_date (date), return_date (date), last_update (date)

rental_id ▼ rental_date inventory_id customer_id return_date staff_id last_update
535 2005-05-28 06:16:32.000 4209 4209 307 307 2005-05-31 02:48:32.000 1 1 2020-12-23 07:15:27
1163 2005-06-14 23:12:46.000 4209 4209 592 592 2005-06-23 21:53:46.000 1 1 2020-12-23 07:15:35
3801 2005-07-06 15:05:50.000 4209 4209 68 68 2005-07-12 12:56:50.000 1 1 2020-12-23 07:16:12
9881 2005-07-31 13:50:38.000 4209 4209 412 412 2005-08-06 08:58:38.000 1 1 2020-12-23 07:17:42
12949 2005-08-19 05:55:52.000 4209 4209 279 279 2005-08-23 00:01:52.000 1 1 2020-12-23 07:18:24

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