Programming 4 results

Deleting Duplicate Data

In most cases, you don’t want duplicate rows in your database. The best practice is to set up your insert process so that data that is already in your tables aren’t added again, but what if that horse has left that barn and you already have duplicates?     In this post, we’ll show you how you remove duplicate data in your MySQL databases.   At a Glance There are just a few necessary steps when removing duplicate data from your table: Back up your ...

Which One to Choose: Cast vs. Convert

When working with Microsoft’s SQL Server (and by extension, T-SQL), you have two options when making explicit conversions: CAST and CONVERT. Many people use them frequently, and quite often interchangeably, but there are some cases when one is a better choice than the other. This post covers the similarities and the differences between the two, as well as when you’re better off using one over the other. Similarities When doing explicit data conversions, CAST and CONVERT are available ...

SQL Injection 101

  SQL injection attacks occur when someone executes malicious SQL statements (also called payloads) that control a database server, typically in a manner not favorable to you. Any SQL-based database is vulnerable to these types of attacks, and it is one of the oldest, most common, and most dangerous forms of attack that someone can direct toward your database. All it takes is one failure for an entire database to be compromised. In some cases, the attacker can even run commands ...

The Seven Types of SQL Joins

It’s unlikely that you’ll be working exclusively with data from one table. So, you need to be able to grab data from multiple tables. One of the ways to do this is by using joins. In relational databases, joins are what make relational databases relational. This post provides a quick refresher of the four main types of SQL Joins and three of its variants. What is a join? A SQL join is a Structured Query Language (SQL) way of linking data from two or more tables based on a column shared ...