#Database.
21 posts filed under this topic.
SQL Cheat Sheet: Queries, Joins, Aggregates & More
Complete SQL reference — SELECT syntax, JOINs, GROUP BY, subqueries, window functions, CTEs, transactions, constraints, data types, and common patterns for any relational database.
How to Run PostgreSQL Locally with Docker
Run a full PostgreSQL database locally in under 2 minutes using Docker — with persistent volumes, docker-compose setup, GUI client access, and dump/restore commands.
How to Debug a Slow SQL Query in PostgreSQL
Step-by-step: find slow queries with pg_stat_statements, read EXPLAIN ANALYZE output, identify missing indexes, fix N+1 queries, and diagnose lock contention.
Unsigned Columns in Laravel Migrations
How to declare unsigned integer columns in Laravel migrations using unsignedBigInteger(), foreignId(), and the unsigned() modifier. Updated for Laravel 12.
PostgreSQL Cheat Sheet: SQL, Indexes, EXPLAIN & psql
Complete PostgreSQL reference — psql commands, CRUD queries, joins, indexes, EXPLAIN ANALYZE, CTEs, window functions, JSONB operators, and admin queries.
Nested Eager Loading in Laravel Explained
Learn how nested eager loading in Laravel Eloquent reduces database queries for deeply related models. Covers syntax, conditional loading, practical examples, and when to use it.
Update a Laravel Record Without Touching Timestamps
Four ways to update a Laravel Eloquent record without changing updated_at: timestamps property, saveQuietly(), withoutTimestamps(), and the query builder. With version notes.
MySQL - List all Databases
In this article, you will see how to retrieve list of databases with MySQL.
Introduction to SQL
In this article we look into intro about SQL aka **Structured Query Language**. Used by numerous big giant tech companies & by widely popular applications.
HackerRank SQL Practice Solutions
Solutions to common SQL practice problems on HackerRank.
Laravel Eloquent whereTime() Method Explained
Learn how Laravel's whereTime() method filters records by the time portion of a datetime column. Covers syntax, all operators, and practical examples for time-based queries.
Laravel Eloquent whereDate() Method Explained
Learn how Laravel's whereDate() method filters records by date, ignoring the time component. Covers syntax, operators, examples, and why raw where() fails for dates.
Laravel firstOrCreate(): Find or Create a Record
Learn how Laravel's firstOrCreate() finds the first matching record or creates a new one automatically. Covers syntax, parameters, real examples, and comparison with firstOrNew().
Laravel firstOrNew(): Find or Prepare a Record
Learn how Laravel's firstOrNew() finds the first matching record or returns an unsaved model instance. Covers syntax, when to use it over firstOrCreate(), and real examples.
Move Records Between Tables in Laravel
How to move a database record from one table to another in Laravel using replicate(), setTable(), and DB::transaction() to keep the operation atomic and safe.
Drop Composite Indexes in Laravel Migrations
How to drop a composite index in Laravel migrations using dropIndex() with a column array or a named index string. Updated for Laravel 12 anonymous class syntax.
Create Composite Indexes in Laravel Migrations
How to create composite (multi-column) indexes in Laravel migrations using anonymous migration syntax. Covers naming, column order rules, and how to drop them.
Create Database Indexes in Laravel Migrations
How to add single, unique, full-text, and primary key indexes in Laravel migrations. Includes naming, dropping, and when each index type makes sense.
Change Laravel Model Timestamp Column Names
How to rename created_at and updated_at in a Laravel Eloquent model using CREATED_AT and UPDATED_AT constants. Covers disabling timestamps and custom date formats too.
SQL - CREATE TABLE Statement
A tutorial for creating database table with SQL
How to allow remote access to MySQL database server
How to allow remote access to MySQL database server