home / sakila

rental

12 rows where customer_id = 318

✎ 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
224 2005-05-26 10:18:27.000 4285 4285 318 318 2005-06-04 06:59:27.000 1 1 2020-12-23 07:15:23
2634 2005-06-19 08:55:17.000 3687 3687 318 318 2005-06-20 11:44:17.000 2 2 2020-12-23 07:15:56
2643 2005-06-19 09:39:27.000 1928 1928 318 318 2005-06-26 10:27:27.000 2 2 2020-12-23 07:15:56
3337 2005-06-21 10:24:35.000 1176 1176 318 318 2005-06-22 13:51:35.000 1 1 2020-12-23 07:16:05
3376 2005-06-21 13:43:02.000 3055 3055 318 318 2005-06-28 18:07:02.000 1 1 2020-12-23 07:16:06
3732 2005-07-06 11:33:37.000 106 106 318 318 2005-07-08 08:31:37.000 1 1 2020-12-23 07:16:11
3974 2005-07-06 22:59:16.000 4282 4282 318 318 2005-07-11 22:30:16.000 1 1 2020-12-23 07:16:15
4356 2005-07-07 19:21:22.000 1907 1907 318 318 2005-07-16 15:57:22.000 1 1 2020-12-23 07:16:21
7649 2005-07-28 01:37:26.000 2704 2704 318 318 2005-07-28 21:18:26.000 1 1 2020-12-23 07:17:09
7853 2005-07-28 09:36:38.000 4053 4053 318 318 2005-07-29 15:01:38.000 1 1 2020-12-23 07:17:12
10023 2005-07-31 18:25:51.000 384 384 318 318 2005-08-09 18:00:51.000 1 1 2020-12-23 07:17:44
14276 2005-08-21 06:34:05.000 3637 3637 318 318 2005-08-28 10:13:05.000 2 2 2020-12-23 07:18:45

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