home / sakila

rental

21 rows where customer_id = 159

✎ 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
475 2005-05-27 22:16:26.000 2520 2520 159 159 2005-05-28 19:58:26.000 1 1 2020-12-23 07:15:26
549 2005-05-28 07:35:37.000 1818 1818 159 159 2005-06-02 09:08:37.000 1 1 2020-12-23 07:15:27
598 2005-05-28 14:04:50.000 599 599 159 159 2005-06-03 18:00:50.000 2 2 2020-12-23 07:15:27
832 2005-05-29 22:51:20.000 1381 1381 159 159 2005-06-07 17:37:20.000 2 2 2020-12-23 07:15:31
1695 2005-06-16 12:40:28.000 4436 4436 159 159 2005-06-22 13:41:28.000 1 1 2020-12-23 07:15:42
2572 2005-06-19 04:21:26.000 2449 2449 159 159 2005-06-23 09:22:26.000 2 2 2020-12-23 07:15:55
3914 2005-07-06 20:11:10.000 4092 4092 159 159 2005-07-14 14:42:10.000 2 2 2020-12-23 07:16:14
4273 2005-07-07 14:40:22.000 4163 4163 159 159 2005-07-13 09:58:22.000 2 2 2020-12-23 07:16:20
5656 2005-07-10 07:31:07.000 4138 4138 159 159 2005-07-15 04:44:07.000 1 1 2020-12-23 07:16:40
6885 2005-07-12 20:56:04.000 3972 3972 159 159 2005-07-15 19:21:04.000 2 2 2020-12-23 07:16:58
8212 2005-07-28 23:37:23.000 1305 1305 159 159 2005-08-04 04:33:23.000 2 2 2020-12-23 07:17:18
8470 2005-07-29 08:28:50.000 3717 3717 159 159 2005-07-30 13:40:50.000 2 2 2020-12-23 07:17:21
9022 2005-07-30 05:34:45.000 4473 4473 159 159 2005-08-03 23:57:45.000 2 2 2020-12-23 07:17:29
9132 2005-07-30 09:56:00.000 402 402 159 159 2005-08-02 09:22:00.000 1 1 2020-12-23 07:17:31
9559 2005-07-31 02:15:53.000 2882 2882 159 159 2005-08-08 02:38:53.000 1 1 2020-12-23 07:17:37
9917 2005-07-31 14:55:11.000 3829 3829 159 159 2005-08-02 13:58:11.000 2 2 2020-12-23 07:17:43
11225 2005-08-02 12:43:27.000 3721 3721 159 159 2005-08-04 18:41:27.000 2 2 2020-12-23 07:18:00
13270 2005-08-19 17:41:16.000 405 405 159 159 2005-08-23 20:22:16.000 2 2 2020-12-23 07:18:29
13933 2005-08-20 17:17:07.000 647 647 159 159 2005-08-22 18:10:07.000 2 2 2020-12-23 07:18:40
14575 2005-08-21 16:51:34.000 3752 3752 159 159 2005-08-30 20:13:34.000 2 2 2020-12-23 07:18:49
15197 2005-08-22 16:14:25.000 2915 2915 159 159 2005-08-26 16:22:25.000 2 2 2020-12-23 07:18:58

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 12.926ms