The AI-first SQL editor

Write SQL blazing fast in an editor designed for data analysts

Dashboard

Data Studio

IDE

RP

Rahul Pattamatta

Administrator

Threads

Schema

Search Tables...

category

4

catid

catgroup

catdesc

catname

date

8

dateid

caldate

day

month

week

qtr

holiday

year

event

4

dateid

catid

venueid

eventid

starttime

listing

8

category

4

SQL Editor

dbn s3

(s3)

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

event_metrics AS (

SELECT

person_id,

distinct_id,

FROM event_base

GROUP BY distinct_id, person_id

)

COUNT(DISTINCT uuid) AS total_events,

COUNT(DISTINCT event) AS unique_event_types,

COUNT(DISTINCT event_date) AS active_days,

MIN(timestamp) AS first_event_time,

MAX(timestamp) AS last_event_time,

EXTRACT(EPOCH FROM (MAX(timestamp) - MIN(timestamp))) / 86400.0 AS days_between_first_last,

-- Additional metrics you could add:

COUNT(DISTINCT event_week) AS active_weeks,

COUNT(*) / NULLIF(COUNT(DISTINCT event_date), 0) AS avg_events_per_active_day,

MAX(timestamp): :DATE - MIN(timestamp)::DATE + 1 AS calendar_days_span

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

Charts

Results

Results

(202 Rows)

Pivot

Totals

Save as Table

VENUEID

VENUENAME

VENUECITY

VENUESTATE

TOTAL_EVENTS

TOTAL_TRANSACT

220

Nederlander Theatre

New York City

NY

81

1,456

212

Winter Garden Theatre

New York City

NY

83

1,672

222

Lunt-Fontanne Theatre

New York City

NY

82

1,532

226

Winter Garden Theatre

New York City

NY

80

1,456

220

Majestic Theatre

New York City

NY

91

1,234

225

Lunt-Fontanne Theatre

New York City

NY

81

1,583

228

August Wilson Theatre

New York City

NY

78

1,234

250

Majestic Theatre

New York City

NY

81

1,456

1-10 of 202 rows

First

Previous

1

2

3

4

....

21

Next

Last

AI Assistant

Data Exploration - 11:03:33 PM

total events counts by date

Here's my approach:

Analysis

Based on your request for "total events counts by date", I'll create a query that counts the number of events grouped by date. Since we have a timestamp column in the s3_posthog_event table, I'll extract the date portion from it and group the events accordingly.

Count total events by date

11:09 PM

SQL diff compared to previous query

-- Count total events by date

SELECT

DATE(timestamp) AS event_date,

COUNT(*) AS total_events

FROM s3_posthog_events

WHERE timestamp IS NOT NULL

GROUP BY DATE(timestamp)

ORDER BY event_date DESC

LIMIT 1000;

timestamp

s3_posthog_events

Using: | Model: | Version:

|

Agent

Dashboard

Data Studio

IDE

RP

Rahul Pattamatta

Administrator

Threads

Schema

Search Tables...

category

4

catid

catgroup

catdesc

catname

date

8

dateid

caldate

day

month

week

qtr

holiday

year

event

4

dateid

catid

venueid

eventid

starttime

listing

8

category

4

SQL Editor

dbn s3

(s3)

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

event_metrics AS (

SELECT

person_id,

distinct_id,

FROM event_base

GROUP BY distinct_id, person_id

)

COUNT(DISTINCT uuid) AS total_events,

COUNT(DISTINCT event) AS unique_event_types,

COUNT(DISTINCT event_date) AS active_days,

MIN(timestamp) AS first_event_time,

MAX(timestamp) AS last_event_time,

EXTRACT(EPOCH FROM (MAX(timestamp) - MIN(timestamp))) / 86400.0 AS days_between_first_last,

-- Additional metrics you could add:

COUNT(DISTINCT event_week) AS active_weeks,

COUNT(*) / NULLIF(COUNT(DISTINCT event_date), 0) AS avg_events_per_active_day,

MAX(timestamp): :DATE - MIN(timestamp)::DATE + 1 AS calendar_days_span

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

Charts

Results

Results

(202 Rows)

Pivot

Totals

Save as Table

VENUEID

VENUENAME

VENUECITY

VENUESTATE

TOTAL_EVENTS

TOTAL_TRANSACT

220

Nederlander Theatre

New York City

NY

81

1,456

212

Winter Garden Theatre

New York City

NY

83

1,672

222

Lunt-Fontanne Theatre

New York City

NY

82

1,532

226

Winter Garden Theatre

New York City

NY

80

1,456

220

Majestic Theatre

New York City

NY

91

1,234

225

Lunt-Fontanne Theatre

New York City

NY

81

1,583

228

August Wilson Theatre

New York City

NY

78

1,234

250

Majestic Theatre

New York City

NY

81

1,456

1-10 of 202 rows

First

Previous

1

2

3

4

....

21

Next

Last

AI Assistant

Data Exploration - 11:03:33 PM

total events counts by date

Here's my approach:

Analysis

Based on your request for "total events counts by date", I'll create a query that counts the number of events grouped by date. Since we have a timestamp column in the s3_posthog_event table, I'll extract the date portion from it and group the events accordingly.

Count total events by date

11:09 PM

SQL diff compared to previous query

-- Count total events by date

SELECT

DATE(timestamp) AS event_date,

COUNT(*) AS total_events

FROM s3_posthog_events

WHERE timestamp IS NOT NULL

GROUP BY DATE(timestamp)

ORDER BY event_date DESC

LIMIT 1000;

timestamp

s3_posthog_events

Using: | Model: | Version:

|

Agent

The AI-first SQL editor

Write SQL blazing fast in an editor designed for data analysts

The AI-first SQL editor

Write SQL blazing fast in an editor designed for data analysts

BENEFITS

Build analytics faster

Build analytics faster

Everything you need to write SQL, verify accuracy, and build insights

Everything you need to write SQL, verify accuracy, and build insights

Generate SQL

Generate SQL from scratch or edit large and complex queries.

Generate SQL

Generate SQL from scratch or edit large and complex queries.

Generate SQL

Generate SQL from scratch or edit large and complex queries.

Chat with your db

Plan tasks, ask AI about your schema, ERD and find columns.

Chat with your db

Plan tasks, ask AI about your schema, ERD and find columns.

Chat with your db

Plan tasks, ask AI about your schema, ERD and find columns.

Spot and fix bugs

Tura automatically analyzes your SQL to surface root causes of bugs

Spot and fix bugs

Tura automatically analyzes your SQL to surface root causes of bugs

Spot and fix bugs

Tura automatically analyzes your SQL to surface root causes of bugs

FEATURES

Zero context-switching. Flow state always.

Zero context-switching. Flow state always.

AI pair programmer to guide you along every step, to go from raw data to insights in minutes

AI pair programmer to guide you along every step, to go from raw data to insights in minutes

SQL Editor

dbn s3

(s3)

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

event_metrics AS (

SELECT

person_id,

distinct_id,

FROM event_base

GROUP BY distinct_id, person_id

)

COUNT(DISTINCT uuid) AS total_events,

COUNT(DISTINCT event) AS unique_event_types,

COUNT(DISTINCT event_date) AS active_days,

MIN(timestamp) AS first_event_time,

MAX(timestamp) AS last_event_time,

EXTRACT(EPOCH FROM (MAX(timestamp) - MIN(timestamp))) / 86400.0 AS days_between_first_last,

-- Additional metrics you could add:

COUNT(DISTINCT event_week) AS active_weeks,

COUNT(*) / NULLIF(COUNT(DISTINCT event_date), 0) AS avg_events_per_active_day,

MAX(timestamp): :DATE - MIN(timestamp)::DATE + 1 AS calendar_days_span

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

SQL Editor

dbn s3

(s3)

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

event_metrics AS (

SELECT

person_id,

distinct_id,

FROM event_base

GROUP BY distinct_id, person_id

)

COUNT(DISTINCT uuid) AS total_events,

COUNT(DISTINCT event) AS unique_event_types,

COUNT(DISTINCT event_date) AS active_days,

MIN(timestamp) AS first_event_time,

MAX(timestamp) AS last_event_time,

EXTRACT(EPOCH FROM (MAX(timestamp) - MIN(timestamp))) / 86400.0 AS days_between_first_last,

-- Additional metrics you could add:

COUNT(DISTINCT event_week) AS active_weeks,

COUNT(*) / NULLIF(COUNT(DISTINCT event_date), 0) AS avg_events_per_active_day,

MAX(timestamp): :DATE - MIN(timestamp)::DATE + 1 AS calendar_days_span

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

SQL Auto-Completion

Use tabs to autocomplete and write fully schema-aware code.

SQL Editor

dbn s3

(s3)

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

event_metrics AS (

SELECT

person_id,

distinct_id,

FROM event_base

GROUP BY distinct_id, person_id

)

COUNT(DISTINCT uuid) AS total_events,

COUNT(DISTINCT event) AS unique_event_types,

COUNT(DISTINCT event_date) AS active_days,

MIN(timestamp) AS first_event_time,

MAX(timestamp) AS last_event_time,

EXTRACT(EPOCH FROM (MAX(timestamp) - MIN(timestamp))) / 86400.0 AS days_between_first_last,

-- Additional metrics you could add:

COUNT(DISTINCT event_week) AS active_weeks,

COUNT(*) / NULLIF(COUNT(DISTINCT event_date), 0) AS avg_events_per_active_day,

MAX(timestamp): :DATE - MIN(timestamp)::DATE + 1 AS calendar_days_span

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

AI Assistant

Here's my approach:

I see you've selected the event_metrics CTE from your complex query. This

CTE is calculating key user-level metrics from the event data. Let me analyze

what this specific part does:

Analysis of the Selected CTE: 'event_ metrics"

What this CTE does

The event_metrics CTE aggregates event data at the user level, calculating

several important metrics:

**Total Events** ('total _events*): Counts unique event occurrences per user using ' COUNT(DISTINCT uuid) *

**Event Variety** ('unique_event_types*): Counts how many different types of events each user has triggered

**Activity Span** ('active_days*): Counts the number of distinct days a user was active

**Time Boundaries**: Captures the first and last event timestamps for each user

**User Lifetime** (*days_between_first_last*): Calculates the number of days between a user's first and last event

event_metrics

Key Design Decisions

**Grouping Strategy**: Groups by both distinct_id and person_id to maintain user identity consistency

**Time Calculation**: Uses EXTRACTEPOCH FR t convert the

event_metrics

distinct_id

person_id

EXTRACT(EPOCH FROM ...)

Using: | Model: | Version:

Generate SQL for questions like 'Find total sales by region for last month'...

Agent

SQL Editor

dbn s3

(s3)

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

event_metrics AS (

SELECT

person_id,

distinct_id,

FROM event_base

GROUP BY distinct_id, person_id

)

COUNT(DISTINCT uuid) AS total_events,

COUNT(DISTINCT event) AS unique_event_types,

COUNT(DISTINCT event_date) AS active_days,

MIN(timestamp) AS first_event_time,

MAX(timestamp) AS last_event_time,

EXTRACT(EPOCH FROM (MAX(timestamp) - MIN(timestamp))) / 86400.0 AS days_between_first_last,

-- Additional metrics you could add:

COUNT(DISTINCT event_week) AS active_weeks,

COUNT(*) / NULLIF(COUNT(DISTINCT event_date), 0) AS avg_events_per_active_day,

MAX(timestamp): :DATE - MIN(timestamp)::DATE + 1 AS calendar_days_span

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

AI Assistant

Here's my approach:

I see you've selected the event_metrics CTE from your complex query. This

CTE is calculating key user-level metrics from the event data. Let me analyze

what this specific part does:

Analysis of the Selected CTE: 'event_ metrics"

What this CTE does

The event_metrics CTE aggregates event data at the user level, calculating

several important metrics:

**Total Events** ('total _events*): Counts unique event occurrences per user using ' COUNT(DISTINCT uuid) *

**Event Variety** ('unique_event_types*): Counts how many different types of events each user has triggered

**Activity Span** ('active_days*): Counts the number of distinct days a user was active

**Time Boundaries**: Captures the first and last event timestamps for each user

**User Lifetime** (*days_between_first_last*): Calculates the number of days between a user's first and last event

event_metrics

Key Design Decisions

**Grouping Strategy**: Groups by both distinct_id and person_id to maintain user identity consistency

**Time Calculation**: Uses EXTRACTEPOCH FR t convert the

event_metrics

distinct_id

person_id

EXTRACT(EPOCH FROM ...)

Using: | Model: | Version:

Generate SQL for questions like 'Find total sales by region for last month'...

Agent

Ask about your database

Save hours finding column names, table names and appropriate metrics.

Error: Query execution error for s3 connection 'dbn s3': Parser Error: syntax error at or near "LIMIT"

Fix in Chat

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

-- Complex CTE analysis for 53 posthog events table

SELECT

-- This query demonstrates multiple CTE levels with various analytical techniques

-- This query demonstrates multiple CTE levels with various analytical techniques

WITH base_events AS (

SELECT

uuid,

timestamp,

events,

properties,

distinct_id,

person_id,

person_properties,

DATE_TRUNC(‘day’,timestamp) AS event_date,

DATE_TRUNC(‘hour’,timestamp) AS event_hour,

EXTRACT(dow FROM timestamp) AS day_of_week,

EXTRACT(hour FROM timestamp) AS hour_of_day,

1 of 1 problem

7

Query execution error for s3 connection 'dbn s3': Parser Error: syntax error at or near "LIMIT" SQL Error

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

Query execution error for s3 connection 'dbn s3": Parser Error: syntax error at or near "LIMIT"

Error: Query execution error for s3 connection 'dbn s3': Parser Error: syntax error at or near "LIMIT"

Fix in Chat

Format

Run Query

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

-- Complex CTE analysis for 53 posthog events table

SELECT

-- This query demonstrates multiple CTE levels with various analytical techniques

-- This query demonstrates multiple CTE levels with various analytical techniques

WITH base_events AS (

SELECT

uuid,

timestamp,

events,

properties,

distinct_id,

person_id,

person_properties,

DATE_TRUNC(‘day’,timestamp) AS event_date,

DATE_TRUNC(‘hour’,timestamp) AS event_hour,

EXTRACT(dow FROM timestamp) AS day_of_week,

EXTRACT(hour FROM timestamp) AS hour_of_day,

1 of 1 problem

7

Query execution error for s3 connection 'dbn s3': Parser Error: syntax error at or near "LIMIT" SQL Error

Press Cd/Ctri + Enter to run query (selection or cursor statement) • Cd/Ctri + Shift + F to format - Cmd/Ctri + / to ask in chat - Select text + Cmd/Ctri + Shift + Enter to ask Al

Query execution error for s3 connection 'dbn s3": Parser Error: syntax error at or near "LIMIT"

Auto-fix syntax issues

No more copying CTE's, verifying them and re-running scripts.

Auto-fix syntax issues

No more copying CTE's, verifying them and re-running scripts.

Charts

Results

Results

(202 Rows)

Pivot

Totals

Save as Table

VENUENAME

VENUECITY

VENUEID

TOTAL_EVENTS

TOTAL_TRANSACT

Nederlander Theatre

New York City

220

81

1,456

Winter Garden Theatre

New York City

212

83

1,672

Lunt-Fontanne Theatre

New York City

222

82

1,532

Winter Garden Theatre

New York City

226

80

1,456

Majestic Theatre

New York City

220

91

1,234

Lunt-Fontanne Theatre

New York City

225

81

1,583

August Wilson Theatre

New York City

228

78

1,234

Majestic Theatre

New York City

250

81

1,456

1-10 of 202 rows

First

Previous

1

2

3

4

....

21

Next

Last

Column Actions

Ask AI

Sort Ascending

Sort Desceding

Filter Column

Add Column

Aggregates

Average

Count Distinct

List Values

Charts

Results

Results

(202 Rows)

Pivot

Totals

Save as Table

VENUENAME

VENUECITY

VENUEID

TOTAL_EVENTS

TOTAL_TRANSACT

Nederlander Theatre

New York City

220

81

1,456

Winter Garden Theatre

New York City

212

83

1,672

Lunt-Fontanne Theatre

New York City

222

82

1,532

Winter Garden Theatre

New York City

226

80

1,456

Majestic Theatre

New York City

220

91

1,234

Lunt-Fontanne Theatre

New York City

225

81

1,583

August Wilson Theatre

New York City

228

78

1,234

Majestic Theatre

New York City

250

81

1,456

1-10 of 202 rows

First

Previous

1

2

3

4

....

21

Next

Last

Column Actions

Ask AI

Sort Ascending

Sort Desceding

Filter Column

Add Column

Aggregates

Average

Count Distinct

List Values

Explore and transform data

Leverage both chat and point and click for Al, to do last mile transformations.

INTEGRATIONS

Connect your favorite data source

Bring any transactional, data warehouse or lakehouse to Tura.

PRICING

Plans for every need

Plans for every need

Choose a plan that fits your goals and scale as you grow

Choose a plan that fits your goals and scale as you grow

Basic

Free

Includes

100 LLM calls

Al-powered code editor

10 threads

1 data source

Basic

Free

Includes

100 LLM calls

Al-powered code editor

10 threads

1 data source

Pro

$20

$20

/user/month

Everything in Basic +

Unlimited slow LLM calls

500 Fast LLM calls/ month

3 data sources

1 Dashboard

Enterprise

$40

$40

/user/month

Everything in Pro +

Unlimited Fast LLM calls / month

10 data sources

Unlimited Dashboards

COMPARISON

Why Tura?

Why Tura?

See how we compare against others in performance, growth

See how we compare against others in performance, growth

Native AI experience

Plan tasks and ask questions

Advanced dashboards and visualizations

Built in guardrails

Real time experience

Traditional IDE's

No AI SQL generation

No AI Autocomplete

Rigid exploration

Lack planning and chat

Clunky UX and slow performance

SECURITY

Enterprise Security, Out of the Box

Enterprise Security, Out of the Box

Keep your data private

Tura doesn't store any of your data in our servers and logs. We only store the embeddings.

Build more, faster than ever

Build more,
faster than ever

Unlock endless possibilities with Tura

Unlock endless possibilities with Tura

support@tura.dev