home / sakila

rental

22 rows where customer_id = 22

✎ 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
370 2005-05-27 07:49:43.000 3347 3347 22 22 2005-06-05 06:39:43.000 2 2 2020-12-23 07:15:24
556 2005-05-28 08:31:36.000 1814 1814 22 22 2005-06-06 07:29:36.000 2 2 2020-12-23 07:15:27
820 2005-05-29 21:07:22.000 2584 2584 22 22 2005-06-07 00:22:22.000 2 2 2020-12-23 07:15:31
3419 2005-06-21 17:18:01.000 4022 4022 22 22 2005-06-22 15:08:01.000 1 1 2020-12-23 07:16:07
4215 2005-07-07 12:00:52.000 1239 1239 22 22 2005-07-11 15:14:52.000 2 2 2020-12-23 07:16:19
5294 2005-07-09 15:23:42.000 3237 3237 22 22 2005-07-15 15:28:42.000 2 2 2020-12-23 07:16:35
5815 2005-07-10 15:48:19.000 2934 2934 22 22 2005-07-13 12:09:19.000 1 1 2020-12-23 07:16:43
7087 2005-07-27 04:42:08.000 1159 1159 22 22 2005-08-02 00:53:08.000 1 1 2020-12-23 07:17:01
7705 2005-07-28 04:02:58.000 1072 1072 22 22 2005-08-05 01:19:58.000 2 2 2020-12-23 07:17:10
9410 2005-07-30 20:38:05.000 1789 1789 22 22 2005-07-31 19:57:05.000 2 2 2020-12-23 07:17:35
9580 2005-07-31 03:01:11.000 532 532 22 22 2005-08-05 06:01:11.000 1 1 2020-12-23 07:17:38
12023 2005-08-17 19:54:54.000 247 247 22 22 2005-08-26 23:03:54.000 1 1 2020-12-23 07:18:12
12124 2005-08-17 23:22:46.000 2036 2036 22 22 2005-08-21 01:40:46.000 1 1 2020-12-23 07:18:13
12222 2006-02-14 15:16:03.000 3949 3949 22 22   1 1 2020-12-23 07:18:14
12809 2005-08-19 00:42:24.000 2005 2005 22 22 2005-08-23 06:06:24.000 1 1 2020-12-23 07:18:22
13060 2005-08-19 09:43:25.000 507 507 22 22 2005-08-28 15:22:25.000 1 1 2020-12-23 07:18:26
14056 2005-08-20 22:18:53.000 1300 1300 22 22 2005-08-27 01:05:53.000 2 2 2020-12-23 07:18:41
14564 2005-08-21 16:24:43.000 3250 3250 22 22 2005-08-26 16:58:43.000 1 1 2020-12-23 07:18:49
15134 2005-08-22 13:18:25.000 4442 4442 22 22 2005-08-29 18:03:25.000 1 1 2020-12-23 07:18:57
15589 2005-08-23 06:03:31.000 2379 2379 22 22 2005-08-30 07:44:31.000 2 2 2020-12-23 07:19:03
15658 2005-08-23 08:48:43.000 3565 3565 22 22 2005-08-25 05:38:43.000 1 1 2020-12-23 07:19:04
15793 2005-08-23 14:06:19.000 2863 2863 22 22 2005-08-24 19:59:19.000 2 2 2020-12-23 07:19: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 12.75ms