home / sakila

rental

21 rows where customer_id = 505

✎ 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
159 2005-05-26 01:34:28.000 3453 3453 505 505 2005-05-29 04:00:28.000 1 1 2020-12-23 07:15:22
645 2005-05-28 19:14:09.000 3128 3128 505 505 2005-06-05 14:01:09.000 1 1 2020-12-23 07:15:28
1799 2005-06-16 20:17:20.000 2847 2847 505 505 2005-06-20 23:55:20.000 1 1 2020-12-23 07:15:44
1886 2005-06-17 03:36:02.000 2367 2367 505 505 2005-06-19 08:12:02.000 2 2 2020-12-23 07:15:45
2773 2005-06-19 18:04:18.000 4155 4155 505 505 2005-06-28 23:52:18.000 1 1 2020-12-23 07:15:58
3137 2005-06-20 19:41:28.000 786 786 505 505 2005-06-28 00:32:28.000 1 1 2020-12-23 07:16:03
4008 2005-07-07 00:26:43.000 1107 1107 505 505 2005-07-16 03:58:43.000 2 2 2020-12-23 07:16:16
4507 2005-07-08 02:22:45.000 819 819 505 505 2005-07-14 20:53:45.000 1 1 2020-12-23 07:16:23
5976 2005-07-11 00:16:35.000 1693 1693 505 505 2005-07-20 01:30:35.000 2 2 2020-12-23 07:16:45
6292 2005-07-11 17:23:33.000 4375 4375 505 505 2005-07-12 16:27:33.000 2 2 2020-12-23 07:16:49
6441 2005-07-12 00:27:08.000 2489 2489 505 505 2005-07-14 03:12:08.000 1 1 2020-12-23 07:16:51
7784 2005-07-28 07:15:32.000 3611 3611 505 505 2005-08-06 05:00:32.000 1 1 2020-12-23 07:17:11
10219 2005-08-01 01:10:33.000 2262 2262 505 505 2005-08-10 02:45:33.000 2 2 2020-12-23 07:17:47
10896 2005-08-02 01:19:33.000 2283 2283 505 505 2005-08-08 06:54:33.000 1 1 2020-12-23 07:17:56
11163 2005-08-02 10:08:40.000 1925 1925 505 505 2005-08-05 14:59:40.000 1 1 2020-12-23 07:18:00
11907 2005-08-17 15:40:47.000 3928 3928 505 505 2005-08-20 19:55:47.000 2 2 2020-12-23 07:18:10
13612 2005-08-20 06:22:08.000 675 675 505 505 2005-08-28 02:22:08.000 1 1 2020-12-23 07:18:34
14398 2005-08-21 10:27:21.000 357 357 505 505 2005-08-23 10:46:21.000 2 2 2020-12-23 07:18:46
14802 2005-08-22 00:48:23.000 707 707 505 505 2005-08-28 01:02:23.000 1 1 2020-12-23 07:18:52
15436 2005-08-23 00:30:26.000 1527 1527 505 505 2005-08-28 06:29:26.000 1 1 2020-12-23 07:19:01
15867 2006-02-14 15:16:03.000 837 837 505 505   2 2 2020-12-23 07:19:07

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