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 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.