DVDRental Sample Database Query
Query for larger DVDRental Revenue By Month Top Customer by Lifetime Value Most Rented Film Rental Duration Distribution Customer with overdue or long rentals Revenue by Store and Month Category…
Query for larger DVDRental Revenue By Month Top Customer by Lifetime Value Most Rented Film Rental Duration Distribution Customer with overdue or long rentals Revenue by Store and Month Category…
The following are scripts I use for pgbench. The scripts assume:
Download pgbouncer user Get Auth Min pgbouncer.ini Max pgbouncer
0) What you’ll end up with AWS confirms: 1) Create & attach a custom DB parameter group (required for pg_cron) In the AWS Console Parameters to set A) shared_preload_libraries AWS…
CREATE TABLE sales.orders_new3 ( created_at timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, order_id uuid NOT NULL DEFAULT gen_random_uuid(), customer_id bigint NOT NULL, amount numeric(12,2) NOT NULL, PRIMARY KEY (created_at, order_id) ) PARTITION…
DROP TABLE IF EXISTS sales CASCADE; -- Create parent table with partitioning CREATE TABLE sales ( id bigint NOT NULL GENERATED ALWAYS AS IDENTITY, sale_date DATE NOT NULL, amount NUMERIC(10,…
-- Use or create database (adjust as needed) -- \c test; DROP TABLE IF EXISTS calendar_basic; CREATE TABLE calendar_basic ( date_id INT NOT NULL PRIMARY KEY, full_date DATE NOT NULL,…
After