home / sakila

rental

24 rows where customer_id = 123

✎ 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
992 2005-05-30 23:47:56.000 3572 3572 123 123 2005-06-05 19:01:56.000 1 1 2020-12-23 07:15:33
1490 2005-06-15 21:42:17.000 3515 3515 123 123 2005-06-22 02:01:17.000 2 2 2020-12-23 07:15:39
1751 2005-06-16 17:00:14.000 138 138 123 123 2005-06-17 12:12:14.000 2 2 2020-12-23 07:15:43
1775 2005-06-16 18:28:19.000 1922 1922 123 123 2005-06-25 13:09:19.000 2 2 2020-12-23 07:15:43
1951 2005-06-17 08:30:35.000 955 955 123 123 2005-06-20 10:43:35.000 2 2 2020-12-23 07:15:46
2594 2005-06-19 05:43:43.000 829 829 123 123 2005-06-25 03:41:43.000 2 2 2020-12-23 07:15:55
4442 2005-07-07 23:05:30.000 461 461 123 123 2005-07-13 22:20:30.000 2 2 2020-12-23 07:16:22
4860 2005-07-08 18:54:07.000 428 428 123 123 2005-07-17 15:09:07.000 2 2 2020-12-23 07:16:28
7535 2005-07-27 21:32:39.000 772 772 123 123 2005-08-05 23:42:39.000 1 1 2020-12-23 07:17:08
7727 2005-07-28 04:52:43.000 2274 2274 123 123 2005-08-03 01:12:43.000 2 2 2020-12-23 07:17:11
7768 2005-07-28 06:44:03.000 2450 2450 123 123 2005-07-29 09:46:03.000 1 1 2020-12-23 07:17:11
7852 2005-07-28 09:34:29.000 3462 3462 123 123 2005-07-30 05:48:29.000 1 1 2020-12-23 07:17:12
7969 2005-07-28 13:57:37.000 2224 2224 123 123 2005-08-04 19:31:37.000 1 1 2020-12-23 07:17:14
8699 2005-07-29 16:53:00.000 4080 4080 123 123 2005-08-07 20:31:00.000 1 1 2020-12-23 07:17:25
9529 2005-07-31 01:05:26.000 816 816 123 123 2005-08-02 22:30:26.000 2 2 2020-12-23 07:17:37
10066 2005-07-31 19:30:01.000 4285 4285 123 123 2005-08-01 14:45:01.000 2 2 2020-12-23 07:17:45
10295 2005-08-01 03:53:49.000 2355 2355 123 123 2005-08-10 03:56:49.000 1 1 2020-12-23 07:17:48
12360 2005-08-18 07:46:35.000 929 929 123 123 2005-08-26 12:01:35.000 1 1 2020-12-23 07:18:16
12402 2005-08-18 09:27:34.000 385 385 123 123 2005-08-25 13:10:34.000 2 2 2020-12-23 07:18:17
13668 2005-08-20 08:26:06.000 3659 3659 123 123 2005-08-25 05:52:06.000 2 2 2020-12-23 07:18:35
15152 2005-08-22 14:25:21.000 739 739 123 123 2005-08-31 14:28:21.000 1 1 2020-12-23 07:18:57
15525 2005-08-23 03:43:32.000 3509 3509 123 123 2005-08-25 07:31:32.000 2 2 2020-12-23 07:19:02
15621 2005-08-23 07:13:43.000 3832 3832 123 123 2005-08-29 08:19:43.000 1 1 2020-12-23 07:19:04
15787 2005-08-23 13:51:57.000 2932 2932 123 123 2005-08-27 17:06:57.000 1 1 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 9.715ms