Store Data
Column and schema decisions are hard to undo once data is in production. These guides cover column types, primary key strategies, constraints, and types enabled by VillageSQL’s extension framework — like native UUIDs and network address types.- How to generate and store UUIDs efficiently
- How to choose between auto-increment, UUIDs, and composite keys
- How to store IPv4 and IPv6 addresses efficiently
- How to store and query MAC addresses in MySQL
- How to handle IPv6 addresses natively with VillageSQL
- How to store, query, and manipulate JSON documents
- How to pick the right column type for your data
- How character sets and collations affect your data
- How to handle time zones correctly with MySQL timestamps
- How to structure your schema with database normalization
- How to enforce referential integrity with foreign keys
- How to compute and index derived values with generated columns
- How to validate data at the database level with CHECK constraints
Write Queries
These guides cover the SQL you’ll write most often, from JOINs and aggregations to window functions, CTEs, and full-text search. VillageSQL-specific guides include querying by IP subnet and enriching results with HTTP and AI functions.- How to combine rows from multiple tables with JOINs
- How to decide between subqueries and JOINs
- How to write readable, recursive queries with CTEs
- How to aggregate and filter grouped data with GROUP BY and HAVING
- How to compute running totals, ranks, and moving averages with window functions
- How NULL behaves in MySQL and how to handle it correctly
- How to implement full-text search in MySQL
- How to simplify complex queries with views
- How to insert or update rows in a single statement with upsert
- How to manipulate and transform strings in SQL
- How to work with dates and times in MySQL queries
- How to query and filter by IP subnet in MySQL
- How to do geolocation lookups by IP address in MySQL
- How to make HTTP requests directly from MySQL
- How to enrich query results with data from external REST APIs
Secure Data
VillageSQL’s crypto extension brings bcrypt, AES encryption, HMAC signing, and digest functions into SQL. These guides cover those cryptographic functions alongside MySQL’s built-in user and privilege management.- How to hash passwords securely with bcrypt and Argon2
- How to generate checksums and digests for data integrity
- How to encrypt sensitive column data at the database level
- How to encrypt and decrypt data with AES in MySQL
- How to sign and verify data with HMAC in MySQL
- How to generate cryptographically secure random values
- How to create and manage MySQL users and privileges
- How to harden a MySQL server for production
Optimize Performance
Slow queries are usually an indexing or schema problem. These guides cover how to diagnose them — using EXPLAIN output, the slow query log, and an understanding of how InnoDB stores data — and what to change.- How indexes work and when to use them
- How to read and act on MySQL EXPLAIN output
- How covering indexes eliminate table lookups
- How to find and fix slow queries with the slow query log
- How to manage database connections efficiently with connection pooling
- How InnoDB stores data and why it matters for performance
- How to insert large volumes of data quickly
- How to partition large tables for better query performance
Build with AI
VillageSQL’s AI extension lets you call language models and generate embeddings directly from SQL. These guides cover provider setup and how to useai_prompt() and create_embed() in real queries.
- How to configure AI provider credentials for VillageSQL
- How to call AI models directly from SQL with ai_prompt()
- How to generate and store vector embeddings in MySQL
- How to classify text using AI from within MySQL
- How to run sentiment analysis with AI functions in MySQL
- How to summarize text with AI directly in SQL
Operate MySQL
These guides cover the operational side: schema migrations, Docker setup, transactions, replication, backups, and what to do when things go wrong in production.- How to upgrade MySQL with minimal downtime
- How to migrate from PostgreSQL to MySQL
- How to manage schema changes safely in production
- How to run MySQL in Docker for local development and production
- How to use transactions to keep your data consistent
- How to detect, prevent, and recover from deadlocks
- How to write and use stored procedures in MySQL
- How to automate actions with MySQL triggers
- How to send webhooks from MySQL triggers
- How to query MySQL metadata with INFORMATION_SCHEMA
- How to back up and restore MySQL databases
- How MySQL replication works and how to set it up
- How binary logging works and how to use it for point-in-time recovery

