Prepare me for a data analyst interview at [company type]. Give me 5 SQL questions with sample tables, 5 statistics concept questions, 2 business case questions, and model answers. Quiz me one at a time if I say 'start'.
Results for “sql”
9 prompts
Write a script in [language] that generates [number] realistic fake records for [entity, e.g. customers with orders] matching this schema: [schema]. Use a faker library, keep relationships consistent, and output as [SQL/JSON/CSV].
Generate realistic test data
Creates realistic fake data for development and tests.
Review this PostgreSQL schema. Check normalisation, data types, constraints, foreign keys, indexes for likely queries ([queries]), naming consistency, and future scaling issues. Suggest improvements with migration SQL. Schema: [paste schema]
PostgreSQL schema review
Reviews a database schema for performance and integrity issues.
Act as a data analyst. Database: [PostgreSQL / BigQuery / Snowflake / MySQL] Tables: [users(id, created_at), events(user_id, event_name, created_at), orders(...)] Questions: [monthly cohort retention, weekly active users, sign-up to purchase funnel] Write the queries with CTEs and comments, explain each step, and desc…
SQL for retention and cohort analysis
Write analytics SQL for cohort retention, funnels and active users.
You are a database performance expert. Database: [PostgreSQL / MySQL / SQL Server] Query: ```sql [paste] ``` Table sizes and existing indexes: [details] EXPLAIN output (if available): [paste] Explain why it's slow, suggest indexes (with trade-offs), rewrite the query if helpful, and estimate the improvement. Mention h…
Optimise a slow SQL query
Speed up a slow query with index suggestions, rewrites and an explanation of the query plan.
Act as a backend developer. Framework/tool: [Laravel, Django, Rails, Prisma, Alembic, raw SQL] Database: [PostgreSQL/MySQL] Change needed: [e.g. add column, rename table, split a field] Table size: [rows] Write the up and down migration, any data backfill, how to deploy it safely without downtime (e.g. expand-and-cont…
Write a database migration
Create safe, reversible migrations for schema changes, including data backfills.
You are a database architect. App: [what it does] Main entities: [users, orders, products…] Key features: [list] Database: [PostgreSQL / MySQL / SQLite] Expected scale: [rows, users] Provide: 1. Entity-relationship overview (text diagram) 2. CREATE TABLE statements with types, constraints, foreign keys 3. Indexes and…
Database schema design
Design a normalised database schema with tables, relationships, indexes and example queries for your app.
Act as a senior backend developer. Framework: [e.g. Express, FastAPI, Laravel, Django REST, Spring Boot] Database/ORM: [e.g. PostgreSQL + Prisma] Endpoint: [METHOD /path] What it does: [description] Request body/params: [fields and rules] Auth: [public / logged-in user / admin] Write: 1. The route/controller code 2. I…
Build a REST API endpoint with validation
Generate a production-ready API endpoint with input validation, error handling, status codes and tests in your framework.
Act as a SQL expert. Database: [MySQL / PostgreSQL / SQLite / SQL Server] Tables: [table_name](column1 type, column2 type, ...) [table_name](...) What I want: [describe the result in plain English, e.g. "top 10 customers by total spend in 2025, with their order count"] Please: 1. Write the query with clear aliases and…
SQL query from plain English
Describe the data you need in normal words and get a correct, readable SQL query with an explanation and performance tips.