✦BLOG
Practical guides on querying your database in plain language — safely and verifiably.
How text-to-SQL accuracy should be measured and why a query that "looks right" is not enough. The method behind our 661-question test set, suite-by-suite results, and where we fail most.
AI SQL generators and ChatGPT-written SQL are everywhere; is that safe on company data? Four real risks and a concrete control for each: read-only users, visible SQL, data locality, and measurement.
NLQ, or natural language query, is the experience of reaching data with your own sentence instead of SQL or filter panels. How it relates to text-to-SQL, its place in self-service BI, and its limits.
Text-to-SQL (NL2SQL) is the AI technique that turns a natural-language question into a runnable SQL query. How it works, where it fails, and what safe usage requires. A guide without the marketing.
A plain-English guide to natural-language-to-SQL: how a question becomes a query, why a read-only, always-visible query is safer, and how PerSight keeps your row data on your machine.
Today's date, going back 30 days, truncating to month, extracting year and month, date differences, and formatting: the 6 most-needed date operations, side by side in all four database dialects.
A query inside a query: scalar subqueries, IN, EXISTS, and correlated subqueries. Why NOT IN returns nothing when NULLs are involved, and when to prefer a subquery over a JOIN.
The three most expensive products in each category, each customer's latest order: finding the top N rows per group with ROW_NUMBER. The window-function pattern and a fallback for MySQL 5.7.
This month, the last 30 days, last quarter: the safe way to query a date range in SQL. Why BETWEEN misleads once times are involved, and the PostgreSQL, SQL Server, MySQL, and Oracle equivalents.
Monthly revenue, orders per customer, units by category: aggregation with GROUP BY. COUNT/SUM/AVG, the difference between WHERE and HAVING, and MySQL's ONLY_FULL_GROUP_BY trap, with real examples.
A practical guide to joining tables like orders and customers in SQL: the difference between INNER JOIN and LEFT JOIN, the row-multiplication trap, and real examples that run on all four databases.