Ever since studying and working with databases 6 months ago, I’ve become fascinated with SQL and its relatively simple syntax. As a guide to the reader, I’ve gathered the essential criteria that employers expect you to know when applying for a database-related job.
In this blog, I will cover what SQL is, its different flavors and syntactical differences centered around an example query, the importance of EXPLAIN and SQL query runtime, and finally some example problems specifically in MySQL.
Read MoreYou may or may not know this, but I use Sendy to send out my monthly newsletters because it is incredibly cheap in comparison to competitors like Mailchimp. Anyone who has done list building before knows that over time you’re going to end up with a lot of stale subscribers that need to be cleaned in an effort to save space and keep things organized.
My email lists require a secondary opt-in to prevent SPAM subscriptions. The problem with this is I still get a lot of SPAM subscriptions even if they are never included in my newsletters. These subscriptions have no business being in my list, so it is best to remove them after so long.
We’re going to see how to use SQL to remove unconfirmed email subscribers in Sendy after so many days.
Read MoreWhen developing an application with the Go programming language, you might find yourself needing to save data locally. If you’ve been keeping up you’ll remember that I’ve written about storing data remotely with Golang in a Couchbase NoSQL database, but never anything locally. Probably the easiest way to store data locally is with a SQLite database as it is a solid technology that has been around for a while.
We’re going to see how to use a SQLite database in our Golang application to read and write local data.
Read MoreWhen developing web applications a common way to store data is to use local storage. This NoSQL approach is great, but what if you’re coming from an RDBMS? With HTML5, you have access to the WebSQL API which allows us to use SQL queries for handling client side storage.
This guide will show you how to use the WebSQL API, which is based around SQLite, in your web application. This information can even be extended for use with mobile hybrid applications.
Read MoreI work with very large Oracle enterprise databases all the time. Consistently, I find myself trying to sift through schemas in the database to find relationships between tables. When tables aren’t named appropriately and you have a lot of them, this can be a long and painful process if you do it manually.
Lucky for us, there is a convenient way to search for the tables you’re looking for based on column information.
Read MoreRecently I found myself needing to aggregate my multiple row SQL data into a single row. This was because the parent data was more useful to me than the multiple row’d data, but I still needed to include it because it was still an essential part of my report. The data looked something like the following:
firstname | lastname | department |
---|---|---|
Nic | Raboy | Engineering |
Maria | Campos | Emergency Room |
Nic | Raboy | Operations |
Nic | Raboy | Design |
I often find myself working with legacy database tables that don’t have primary keys or auto increment keys. In addition to this, I always find myself needing to get the latest record for a particular set of data in my database. It is never as easy as just calling a max
in the where clause. A subquery is often needed to get the most recent record in a table.