home / sakila

rental

29 rows where customer_id = 302

✎ 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
38 2005-05-25 04:47:44.000 2540 2540 302 302 2005-06-01 00:58:44.000 1 1 2020-12-23 07:15:20
92 2005-05-25 15:38:46.000 775 775 302 302 2005-05-31 13:40:46.000 2 2 2020-12-23 07:15:21
1231 2005-06-15 04:04:41.000 3003 3003 302 302 2005-06-20 23:52:41.000 2 2 2020-12-23 07:15:36
4676 2005-07-08 10:26:02.000 2590 2590 302 302 2005-07-10 13:38:02.000 2 2 2020-12-23 07:16:26
5498 2005-07-10 00:27:21.000 63 63 302 302 2005-07-13 20:11:21.000 2 2 2020-12-23 07:16:38
5682 2005-07-10 08:51:39.000 17 17 302 302 2005-07-12 14:44:39.000 2 2 2020-12-23 07:16:41
5709 2005-07-10 10:31:52.000 732 732 302 302 2005-07-12 10:47:52.000 1 1 2020-12-23 07:16:41
5821 2005-07-10 16:07:16.000 147 147 302 302 2005-07-14 19:48:16.000 1 1 2020-12-23 07:16:43
6623 2005-07-12 09:05:34.000 4412 4412 302 302 2005-07-19 13:54:34.000 2 2 2020-12-23 07:16:54
7183 2005-07-27 08:18:38.000 3384 3384 302 302 2005-08-01 03:24:38.000 1 1 2020-12-23 07:17:02
7411 2005-07-27 16:42:30.000 515 515 302 302 2005-08-05 17:38:30.000 1 1 2020-12-23 07:17:06
8363 2005-07-29 05:10:08.000 1607 1607 302 302 2005-08-06 00:11:08.000 1 1 2020-12-23 07:17:20
8646 2005-07-29 14:48:48.000 89 89 302 302 2005-08-03 18:11:48.000 2 2 2020-12-23 07:17:24
8795 2005-07-29 21:04:14.000 1896 1896 302 302 2005-07-31 02:58:14.000 2 2 2020-12-23 07:17:26
9146 2005-07-30 10:32:08.000 483 483 302 302 2005-08-08 14:30:08.000 1 1 2020-12-23 07:17:31
9358 2005-07-30 18:37:24.000 712 712 302 302 2005-08-07 23:34:24.000 2 2 2020-12-23 07:17:34
9374 2005-07-30 19:10:03.000 103 103 302 302 2005-08-06 21:54:03.000 2 2 2020-12-23 07:17:35
9581 2005-07-31 03:03:07.000 2588 2588 302 302 2005-08-05 23:01:07.000 1 1 2020-12-23 07:17:38
10329 2005-08-01 04:56:13.000 2289 2289 302 302 2005-08-03 03:54:13.000 1 1 2020-12-23 07:17:48
12126 2005-08-17 23:25:21.000 2304 2304 302 302 2005-08-23 21:51:21.000 1 1 2020-12-23 07:18:13
12516 2005-08-18 13:39:53.000 1332 1332 302 302 2005-08-20 08:33:53.000 1 1 2020-12-23 07:18:18
12903 2005-08-19 04:09:38.000 2340 2340 302 302 2005-08-26 03:24:38.000 2 2 2020-12-23 07:18:24
13916 2005-08-20 16:43:02.000 2971 2971 302 302 2005-08-25 19:21:02.000 1 1 2020-12-23 07:18:39
14120 2005-08-21 01:25:00.000 4069 4069 302 302 2005-08-24 23:21:00.000 2 2 2020-12-23 07:18:42
14247 2005-08-21 05:35:17.000 267 267 302 302 2005-08-26 03:22:17.000 1 1 2020-12-23 07:18:44
15578 2005-08-23 05:37:13.000 2829 2829 302 302 2005-08-27 01:11:13.000 1 1 2020-12-23 07:19:03
15622 2005-08-23 07:22:02.000 3335 3335 302 302 2005-09-01 06:08:02.000 2 2 2020-12-23 07:19:04
15734 2005-08-23 11:40:08.000 3952 3952 302 302 2005-08-27 08:16:08.000 1 1 2020-12-23 07:19:05
15987 2005-08-23 20:22:17.000 3150 3150 302 302 2005-08-31 21:46:17.000 2 2 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 11.431ms