home / sakila

rental

27 rows where customer_id = 151

✎ 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
164 2005-05-26 02:26:49.000 1070 1070 151 151 2005-05-28 00:32:49.000 1 1 2020-12-23 07:15:22
418 2005-05-27 15:13:17.000 3063 3063 151 151 2005-06-04 12:05:17.000 2 2 2020-12-23 07:15:25
2474 2005-06-18 20:51:34.000 3450 3450 151 151 2005-06-25 01:39:34.000 1 1 2020-12-23 07:15:54
2947 2005-06-20 06:00:21.000 4302 4302 151 151 2005-06-23 10:04:21.000 2 2 2020-12-23 07:16:00
3017 2005-06-20 11:08:56.000 2513 2513 151 151 2005-06-28 16:26:56.000 1 1 2020-12-23 07:16:01
3089 2005-06-20 15:57:01.000 539 539 151 151 2005-06-25 13:15:01.000 2 2 2020-12-23 07:16:02
3390 2005-06-21 15:10:50.000 2034 2034 151 151 2005-06-26 12:38:50.000 1 1 2020-12-23 07:16:06
4376 2005-07-07 20:24:33.000 1344 1344 151 151 2005-07-11 18:32:33.000 1 1 2020-12-23 07:16:21
6720 2005-07-12 13:41:16.000 2704 2704 151 151 2005-07-13 14:41:16.000 2 2 2020-12-23 07:16:55
6768 2005-07-12 15:47:51.000 3418 3418 151 151 2005-07-19 21:17:51.000 2 2 2020-12-23 07:16:56
6854 2005-07-12 19:38:57.000 3173 3173 151 151 2005-07-16 16:28:57.000 1 1 2020-12-23 07:16:57
7189 2005-07-27 08:35:02.000 4419 4419 151 151 2005-07-30 14:00:02.000 2 2 2020-12-23 07:17:03
7332 2005-07-27 13:58:57.000 1761 1761 151 151 2005-08-02 12:40:57.000 1 1 2020-12-23 07:17:05
9253 2005-07-30 14:20:12.000 4183 4183 151 151 2005-07-31 11:31:12.000 2 2 2020-12-23 07:17:33
9890 2005-07-31 14:04:44.000 1024 1024 151 151 2005-08-01 11:24:44.000 1 1 2020-12-23 07:17:42
9969 2005-07-31 16:38:12.000 938 938 151 151 2005-08-05 11:45:12.000 2 2 2020-12-23 07:17:43
10078 2005-07-31 20:02:02.000 3198 3198 151 151 2005-08-04 00:45:02.000 1 1 2020-12-23 07:17:45
10311 2005-08-01 04:27:59.000 4211 4211 151 151 2005-08-02 08:51:59.000 1 1 2020-12-23 07:17:48
10662 2005-08-01 16:50:57.000 2857 2857 151 151 2005-08-03 17:19:57.000 1 1 2020-12-23 07:17:53
11714 2005-08-17 07:34:55.000 17 17 151 151 2005-08-18 04:07:55.000 1 1 2020-12-23 07:18:08
13230 2005-08-19 16:12:07.000 3645 3645 151 151 2005-08-21 12:19:07.000 1 1 2020-12-23 07:18:29
13568 2005-08-20 05:02:46.000 1243 1243 151 151 2005-08-27 03:12:46.000 2 2 2020-12-23 07:18:34
14856 2005-08-22 02:31:51.000 3292 3292 151 151 2005-08-26 23:41:51.000 2 2 2020-12-23 07:18:53
14922 2005-08-22 05:13:05.000 2322 2322 151 151 2005-08-30 04:59:05.000 1 1 2020-12-23 07:18:53
15227 2005-08-22 17:22:41.000 2987 2987 151 151 2005-08-23 20:59:41.000 1 1 2020-12-23 07:18:58
15926 2005-08-23 18:20:56.000 2231 2231 151 151 2005-08-24 18:20:56.000 2 2 2020-12-23 07:19:08
15996 2005-08-23 20:31:38.000 3098 3098 151 151 2005-08-29 20:58:38.000 1 1 2020-12-23 07:19:09

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