home / sakila

rental

20 rows where customer_id = 428

✎ 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
634 2005-05-28 17:40:35.000 2630 2630 428 428 2005-06-05 16:18:35.000 2 2 2020-12-23 07:15:28
1227 2005-06-15 03:50:03.000 654 654 428 428 2005-06-21 23:48:03.000 2 2 2020-12-23 07:15:36
1471 2005-06-15 20:53:26.000 565 565 428 428 2005-06-24 18:25:26.000 2 2 2020-12-23 07:15:39
1601 2005-06-16 06:11:13.000 3115 3115 428 428 2005-06-21 08:57:13.000 2 2 2020-12-23 07:15:41
2677 2005-06-19 12:01:59.000 4384 4384 428 428 2005-06-21 06:15:59.000 2 2 2020-12-23 07:15:56
3377 2005-06-21 13:51:12.000 1845 1845 428 428 2005-06-22 18:16:12.000 1 1 2020-12-23 07:16:06
3702 2005-07-06 10:13:56.000 2204 2204 428 428 2005-07-10 08:12:56.000 1 1 2020-12-23 07:16:11
3925 2005-07-06 20:41:44.000 2653 2653 428 428 2005-07-15 21:05:44.000 2 2 2020-12-23 07:16:14
4151 2005-07-07 08:49:02.000 4564 4564 428 428 2005-07-11 05:19:02.000 1 1 2020-12-23 07:16:18
5373 2005-07-09 18:48:57.000 950 950 428 428 2005-07-10 16:34:57.000 1 1 2020-12-23 07:16:36
6735 2005-07-12 14:08:20.000 276 276 428 428 2005-07-18 09:41:20.000 2 2 2020-12-23 07:16:56
7823 2005-07-28 08:32:53.000 84 84 428 428 2005-08-06 11:59:53.000 1 1 2020-12-23 07:17:12
8155 2005-07-28 20:57:06.000 3023 3023 428 428 2005-08-02 18:40:06.000 2 2 2020-12-23 07:17:17
8387 2005-07-29 05:47:27.000 910 910 428 428 2005-07-31 06:26:27.000 1 1 2020-12-23 07:17:20
8528 2005-07-29 10:24:22.000 2107 2107 428 428 2005-08-07 10:34:22.000 1 1 2020-12-23 07:17:22
9904 2005-07-31 14:34:17.000 4089 4089 428 428 2005-08-08 17:19:17.000 1 1 2020-12-23 07:17:42
9982 2005-07-31 17:09:02.000 2698 2698 428 428 2005-08-02 13:02:02.000 2 2 2020-12-23 07:17:44
10577 2005-08-01 13:46:38.000 2240 2240 428 428 2005-08-06 11:35:38.000 2 2 2020-12-23 07:17:52
10888 2005-08-02 00:52:45.000 2412 2412 428 428 2005-08-03 03:07:45.000 1 1 2020-12-23 07:17:56
11536 2005-08-17 00:40:03.000 2735 2735 428 428 2005-08-21 19:11:03.000 1 1 2020-12-23 07:18:05

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