Skip to content

Instantly share code, notes, and snippets.

@ngollperrier
Created October 30, 2018 13:47
Show Gist options
  • Save ngollperrier/9a9195c6f317653d4883f2dc1843ff5d to your computer and use it in GitHub Desktop.
Save ngollperrier/9a9195c6f317653d4883f2dc1843ff5d to your computer and use it in GitHub Desktop.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE clickstream (
click_id uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
click_timestamp TIMESTAMP WITH TIME ZONE,
user_id UUID,
is_ad_display_event BOOLEAN,
is_ad_search_event BOOLEAN
);
CREATE TABLE clickstream_aggregated (
click_date DATE,
nb_ad_display_events BIGINT,
nb_ad_search_events BIGINT
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment