Blog Archives

Generate Slug URL in MySQL

A slug is a short name using human-readable keywords to identify a web page. For example, in the following URL the slug is new-york-art-school. This post shows how to automatically generate slug using SQL in MySQL. Suppose we have a

Tagged with: ,
Posted in MySQL, Web

Update Two Tables with Joins in MySQL

Here we show an example of updating two table at the same time using joins. Suppose we have two tables: lookup which holds information on a person, and activity which holds certain activities happening on a person. Imagine that lookup

Tagged with: ,
Posted in MySQL, SQL

Nearest Neighbor Search by Distance in Large Datasets with MySQL

Nearest neighbor search is common in geographical databases. Here we consider searching for nearby locations in a large geographical database. Many commercial databases have geographical indexes supporting such queries; however, in MySQL there is no simple implementation. We show a

Tagged with: ,
Posted in MySQL, Web

Remove Duplicate Rows in MySQL

Duplicate elimination is necessary when the database is messed up or when we integrate data from multiple sources. This tutorial shows several ways of removing duplicates in MySQL that may fit in different application scenarios. Suppose we have a table

Tagged with: , , ,
Posted in MySQL