Skip to main content

176 posts tagged with "Database"

Databases, Data Modeling, and Data Access

View All Tags

How to Read Rows from MySQL with EF Core and LINQ

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

With EF Core, you read rows by writing a LINQ query in C#, and EF Core turns it into SQL. The part that surprises people is timing: building the query sends nothing, and only ToListAsync or a similar call goes to MySQL. This guide reads rows with Where and OrderBy, shows the SQL each piece becomes, and proves the timing with real logs.

Why MySQL AUTO_INCREMENT IDs Have Gaps

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Your table's IDs go 1, 2, 5, 7, 12, and you can't account for the missing numbers. Nothing is wrong. MySQL hands out an AUTO_INCREMENT value before it knows whether the insert will succeed, and it doesn't take the value back. Here's that happening on MySQL 9.7, in two different ways.

How to Join Two Tables in MySQL

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A product row holds a CategoryId, not a category's name. A JOIN brings the two tables together, so you can read both in one result. INNER JOIN keeps only the rows that match, and LEFT JOIN keeps every row from the first table. This guide runs both on MySQL 9.7, and shows a counting mistake that's easy to make.