Home » Tag Archives: SQL

Tag Archives: SQL

How to Detect Slow Queries with jOOQ

jooq-2-logo

Just now, we implemented a nice little feature in jOOQ’s code generator: https://github.com/jOOQ/jOOQ/issues/4974 It detects whenever the jOOQ code generator runs a slow query to reverse engineer schema meta information. Why? In our development and integration test environment, we don’t have huge schemas with all the different performance edge cases put in place. For instance, we don’t have 5000 Oracle ...

Read More »

Impress Your Coworkers by Using SQL UNPIVOT!

software-development-2-logo

I’ve recently encountered a very interesting question on Stack Overflow by an unnamed user. The question was about generating a table of the following form in Oracle, using a table valued function: Description COUNT ------------------- TEST1 10 TEST2 15 TEST3 25 TEST4 50 The logic that should be implemented for the COUNT column is the following: TEST1: count of employees ...

Read More »

How to Fill Sparse Data With the Previous Non-Empty Value in SQL

software-development-2-logo

The following is a very common problem in all data related technologies and we’re going to look into two very lean, SQL-based solutions for it: How do I fill the cells of a sparse data set with the “previous non-empty value”? The problem The problem is really simple and I’m reusing the example provided by Stack Overflow user aljassi in ...

Read More »

SQL GROUP BY and Functional Dependencies: A Very Useful Feature

software-development-2-logo

Relational databases define the term “Functional Dependency” as such (from Wikipedia): In relational database theory, a functional dependency is a constraint between two sets of attributes in a relation from a database. In other words, functional dependency is a constraint that describes the relationship between attributes in a relation. In SQL, functional dependencies appear whenever there is a unique constraint ...

Read More »

How to Find the Longest Consecutive Series of Events in SQL

software-development-2-logo

A very interesting problem that can be solved very easily with SQL is to find consecutive series of events in a time series. But what is a consecutive series of events in a time series? Take Stack Overflow, for example. Stack Overflow has a cool reputation system that uses badges to reward certain behaviour. As a social website, they encourage ...

Read More »

NoSQL vs. SQL: Choosing a Data Management Solution

software-development-2-logo

Table Of Contents 1. Introduction 2. Distributed systems: the CAP theorem 3. Relational data stores 3.1. MySQL / MariaDB 3.2. PostgreSQL 3.3. Others 4. Why NoSQL? 5. Key/Value data stores 5.1. DynamoDB 5.2. Memcached 5.3. Redis 5.4. Riak 5.5. Aerospike 5.6. FoundationDB 6. Columnar data stores 6.1. Accumulo 6.2. Cassandra 6.3. HBase 7. Graph data stores 7.1. Neo4J 7.2. Titan ...

Read More »

How to Find the Closest Subset Sum with SQL

software-development-2-logo

I’ve stumbled upon this very interesting question on Stack Overflow, recently. Its title is: [How to] compare a number with sum of subset of numbers In this article, we’ll compare the user’s imperative approach to the extremely elegant (Oracle) SQL approach. We’ll be making use of any combination of these awesome SQL features:   Window functions FIRST and LAST functions, ...

Read More »

Leveraging new features in Drill 1.2 – ANSI SQL Analytic/Window functions

software-development-2-logo

Today we are very excited to announce the latest version of Apache Drill, 1.2,) as part of the MapR distribution. Drill 1.2 packages for MapR can be downloaded http://doc.mapr.com/display/MapR/Apache+Drill+on+MapR You can experiment with the release using MapR sandbox and various hands on tutorials at https://www.mapr.com/products/mapr-sandbox-hadoop/download-sandbox-drill Apache Drill has been gaining significant user adoption and community momentum since its initial Beta ...

Read More »

jOOQ Tuesdays: Markus Winand is on a Modern SQL Mission

software-development-2-logo

Welcome to the jOOQ Tuesdays series. In this series, we’ll publish an article on the third Tuesday every other month where we interview someone we find exciting in our industry from a jOOQ perspective. This includes people who work with SQL, Java, Open Source, and a variety of other related topics. We are excited to talk with Markus Winand in ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials