SQL Studio
Powered by Grok 4.5 — describe a data question, get production-ready SQL
SaaS Revenue by Plan
Ecommerce Repeat Purchases
Support Ticket SLA Breach
Schema
CREATE TABLE subscriptions ( id SERIAL PRIMARY KEY, user_id INT NOT NULL, plan VARCHAR(20) NOT NULL, -- 'free', 'pro', 'enterprise' status VARCHAR(20) NOT NULL, -- 'active', 'canceled', 'past_due' started_at TIMESTAMP NOT NULL, canceled_at TIMESTAMP, monthly_price DECIMAL(10,2) NOT NULL ); CREATE TABLE payments ( id SERIAL PRIMARY KEY, subscription_id INT REFERENCES subscriptions(id), amount DECIMAL(10,2) NOT NULL, paid_at TIMESTAMP NOT NULL );
Question
Show monthly revenue by plan for the last 12 months.
Generate SQL
Generated SQL will appear here