home / sakila

rental

34 rows where customer_id = 30

✎ 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
1874 2005-06-17 02:39:20.000 3884 3884 30 30 2005-06-24 04:41:20.000 2 2 2020-12-23 07:15:45
1895 2005-06-17 04:25:12.000 680 680 30 30 2005-06-26 08:44:12.000 1 1 2020-12-23 07:15:45
2154 2005-06-17 22:59:42.000 1655 1655 30 30 2005-06-24 04:11:42.000 1 1 2020-12-23 07:15:49
2730 2005-06-19 15:10:09.000 1264 1264 30 30 2005-06-28 13:05:09.000 1 1 2020-12-23 07:15:57
3964 2005-07-06 22:23:02.000 1853 1853 30 30 2005-07-07 22:21:02.000 1 1 2020-12-23 07:16:15
4471 2005-07-08 00:21:29.000 263 263 30 30 2005-07-11 18:48:29.000 2 2 2020-12-23 07:16:23
4642 2005-07-08 09:13:28.000 1962 1962 30 30 2005-07-10 06:17:28.000 2 2 2020-12-23 07:16:25
5028 2005-07-09 02:34:45.000 4531 4531 30 30 2005-07-14 20:45:45.000 2 2 2020-12-23 07:16:31
5108 2005-07-09 06:44:30.000 4229 4229 30 30 2005-07-17 04:24:30.000 1 1 2020-12-23 07:16:32
5289 2005-07-09 15:14:08.000 4336 4336 30 30 2005-07-12 12:51:08.000 2 2 2020-12-23 07:16:35
5972 2005-07-11 00:08:54.000 4577 4577 30 30 2005-07-17 21:01:54.000 1 1 2020-12-23 07:16:45
6249 2005-07-11 15:02:02.000 4334 4334 30 30 2005-07-14 11:37:02.000 2 2 2020-12-23 07:16:48
6359 2005-07-11 21:06:17.000 1656 1656 30 30 2005-07-16 02:51:17.000 2 2 2020-12-23 07:16:50
7394 2005-07-27 16:03:08.000 2399 2399 30 30 2005-08-04 11:27:08.000 2 2 2020-12-23 07:17:06
7769 2005-07-28 06:45:23.000 3250 3250 30 30 2005-07-30 12:18:23.000 1 1 2020-12-23 07:17:11
8030 2005-07-28 16:12:53.000 2633 2633 30 30 2005-07-31 17:15:53.000 1 1 2020-12-23 07:17:15
8038 2005-07-28 16:32:55.000 1225 1225 30 30 2005-07-30 21:08:55.000 1 1 2020-12-23 07:17:15
8083 2005-07-28 18:09:48.000 2187 2187 30 30 2005-08-04 21:47:48.000 2 2 2020-12-23 07:17:16
8641 2005-07-29 14:37:30.000 3199 3199 30 30 2005-08-02 19:32:30.000 2 2 2020-12-23 07:17:24
9309 2005-07-30 16:55:53.000 3616 3616 30 30 2005-08-07 11:23:53.000 1 1 2020-12-23 07:17:34
9551 2005-07-31 02:04:58.000 1260 1260 30 30 2005-08-06 04:07:58.000 2 2 2020-12-23 07:17:37
9641 2005-07-31 05:33:48.000 1085 1085 30 30 2005-08-04 07:43:48.000 1 1 2020-12-23 07:17:38
9998 2005-07-31 17:40:35.000 2549 2549 30 30 2005-08-04 18:15:35.000 1 1 2020-12-23 07:17:44
10235 2005-08-01 01:57:48.000 2850 2850 30 30 2005-08-10 07:38:48.000 2 2 2020-12-23 07:17:47
12240 2005-08-18 03:27:11.000 1168 1168 30 30 2005-08-26 04:34:11.000 2 2 2020-12-23 07:18:15
12546 2005-08-18 14:29:37.000 610 610 30 30 2005-08-26 09:47:37.000 1 1 2020-12-23 07:18:19
12758 2005-08-18 22:58:34.000 2279 2279 30 30 2005-08-22 23:33:34.000 1 1 2020-12-23 07:18:22
13435 2005-08-19 23:35:44.000 3919 3919 30 30 2005-08-24 18:14:44.000 2 2 2020-12-23 07:18:32
13682 2005-08-20 08:50:39.000 287 287 30 30 2005-08-21 09:05:39.000 2 2 2020-12-23 07:18:36
14339 2005-08-21 08:37:15.000 1744 1744 30 30 2005-08-26 03:37:15.000 2 2 2020-12-23 07:18:46
14585 2005-08-21 17:18:33.000 82 82 30 30 2005-08-26 11:36:33.000 1 1 2020-12-23 07:18:49
15063 2005-08-22 10:39:51.000 1159 1159 30 30 2005-08-25 16:03:51.000 2 2 2020-12-23 07:18:56
15544 2005-08-23 04:17:56.000 1918 1918 30 30 2005-09-01 00:43:56.000 2 2 2020-12-23 07:19:03
15829 2005-08-23 15:17:14.000 4387 4387 30 30 2005-08-27 13:04:14.000 1 1 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.801ms