home / sakila

rental

27 rows where customer_id = 581

✎ 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
976 2005-05-30 21:11:19.000 2290 2290 581 581 2005-06-06 02:16:19.000 2 2 2020-12-23 07:15:33
1151 2005-05-31 21:29:00.000 1281 1281 581 581 2005-06-03 23:24:00.000 1 1 2020-12-23 07:15:35
1958 2005-06-17 08:52:01.000 1843 1843 581 581 2005-06-23 07:55:01.000 2 2 2020-12-23 07:15:46
2101 2005-06-17 18:57:02.000 2137 2137 581 581 2005-06-20 15:38:02.000 2 2 2020-12-23 07:15:48
2137 2005-06-17 21:18:28.000 1158 1158 581 581 2005-06-20 21:05:28.000 1 1 2020-12-23 07:15:49
4210 2005-07-07 11:36:20.000 1972 1972 581 581 2005-07-16 12:38:20.000 1 1 2020-12-23 07:16:19
4244 2005-07-07 13:41:58.000 592 592 581 581 2005-07-09 15:32:58.000 2 2 2020-12-23 07:16:19
4338 2005-07-07 18:39:56.000 3152 3152 581 581 2005-07-12 21:03:56.000 1 1 2020-12-23 07:16:21
4613 2005-07-08 07:44:49.000 476 476 581 581 2005-07-09 04:47:49.000 1 1 2020-12-23 07:16:25
4669 2005-07-08 10:13:08.000 3494 3494 581 581 2005-07-16 07:52:08.000 1 1 2020-12-23 07:16:26
4815 2005-07-08 17:12:51.000 840 840 581 581 2005-07-17 13:14:51.000 1 1 2020-12-23 07:16:28
4833 2005-07-08 18:07:35.000 2921 2921 581 581 2005-07-13 15:29:35.000 2 2 2020-12-23 07:16:28
5516 2005-07-10 01:13:52.000 1902 1902 581 581 2005-07-15 22:56:52.000 1 1 2020-12-23 07:16:38
5707 2005-07-10 10:26:14.000 708 708 581 581 2005-07-18 06:19:14.000 1 1 2020-12-23 07:16:41
5812 2005-07-10 15:27:56.000 1681 1681 581 581 2005-07-18 15:37:56.000 2 2 2020-12-23 07:16:42
7048 2005-07-27 03:31:48.000 3707 3707 581 581 2005-08-05 07:30:48.000 2 2 2020-12-23 07:17:00
7783 2005-07-28 07:14:43.000 3817 3817 581 581 2005-08-01 05:03:43.000 2 2 2020-12-23 07:17:11
9278 2005-07-30 15:15:19.000 3782 3782 581 581 2005-08-03 20:21:19.000 1 1 2020-12-23 07:17:33
9449 2005-07-30 22:02:34.000 2 2 581 581 2005-08-06 02:09:34.000 1 1 2020-12-23 07:17:36
11443 2005-08-02 20:29:30.000 1291 1291 581 581 2005-08-07 01:08:30.000 2 2 2020-12-23 07:18:04
11707 2005-08-17 07:24:59.000 1030 1030 581 581 2005-08-24 10:40:59.000 1 1 2020-12-23 07:18:07
13621 2005-08-20 06:43:44.000 3754 3754 581 581 2005-08-23 06:25:44.000 2 2 2020-12-23 07:18:35
13712 2005-08-20 09:38:04.000 1039 1039 581 581 2005-08-21 06:10:04.000 1 1 2020-12-23 07:18:36
14070 2005-08-20 22:56:34.000 846 846 581 581 2005-08-29 22:02:34.000 1 1 2020-12-23 07:18:42
14976 2005-08-22 07:10:26.000 77 77 581 581 2005-08-28 07:22:26.000 1 1 2020-12-23 07:18:54
15403 2005-08-22 23:18:10.000 4315 4315 581 581 2005-08-23 18:08:10.000 2 2 2020-12-23 07:19:01
15792 2005-08-23 14:05:37.000 2175 2175 581 581 2005-08-28 10:54:37.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 10.223ms