home / sakila

rental

21 rows where customer_id = 399

✎ 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
10 2005-05-25 00:02:21.000 1824 1824 399 399 2005-05-31 22:44:21.000 2 2 2020-12-23 07:15:20
694 2005-05-29 01:49:43.000 592 592 399 399 2005-06-05 06:52:43.000 1 1 2020-12-23 07:15:29
883 2005-05-30 06:21:05.000 2271 2271 399 399 2005-06-07 04:50:05.000 2 2 2020-12-23 07:15:32
2961 2005-06-20 07:29:15.000 4539 4539 399 399 2005-06-24 08:05:15.000 1 1 2020-12-23 07:16:00
3036 2005-06-20 12:18:31.000 4463 4463 399 399 2005-06-29 09:52:31.000 1 1 2020-12-23 07:16:01
4957 2005-07-08 23:18:48.000 4082 4082 399 399 2005-07-09 23:13:48.000 1 1 2020-12-23 07:16:30
4981 2005-07-09 00:29:29.000 3363 3363 399 399 2005-07-16 19:06:29.000 2 2 2020-12-23 07:16:30
5507 2005-07-10 00:49:04.000 716 716 399 399 2005-07-15 22:06:04.000 2 2 2020-12-23 07:16:38
6006 2005-07-11 01:38:42.000 4201 4201 399 399 2005-07-17 05:18:42.000 2 2 2020-12-23 07:16:45
6229 2005-07-11 13:59:50.000 3137 3137 399 399 2005-07-20 09:26:50.000 1 1 2020-12-23 07:16:48
6674 2005-07-12 11:51:54.000 2385 2385 399 399 2005-07-13 16:57:54.000 1 1 2020-12-23 07:16:55
8461 2005-07-29 08:11:31.000 3373 3373 399 399 2005-08-06 09:23:31.000 1 1 2020-12-23 07:17:21
9728 2005-07-31 08:40:54.000 3630 3630 399 399 2005-08-03 04:14:54.000 2 2 2020-12-23 07:17:40
10654 2005-08-01 16:31:35.000 2522 2522 399 399 2005-08-05 12:04:35.000 2 2 2020-12-23 07:17:53
10960 2005-08-02 03:46:18.000 3536 3536 399 399 2005-08-11 01:29:18.000 1 1 2020-12-23 07:17:57
11329 2005-08-02 16:42:52.000 2677 2677 399 399 2005-08-08 16:45:52.000 1 1 2020-12-23 07:18:02
11953 2005-08-17 17:16:42.000 2993 2993 399 399 2005-08-23 18:28:42.000 1 1 2020-12-23 07:18:11
13253 2005-08-19 16:53:56.000 472 472 399 399 2005-08-20 11:38:56.000 2 2 2020-12-23 07:18:29
13293 2005-08-19 18:35:52.000 380 380 399 399 2005-08-23 17:18:52.000 2 2 2020-12-23 07:18:30
15300 2005-08-22 19:44:00.000 2319 2319 399 399 2005-08-25 22:49:00.000 2 2 2020-12-23 07:18:59
15468 2005-08-23 01:25:30.000 2440 2440 399 399 2005-08-28 01:40:30.000 2 2 2020-12-23 07:19:02

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