Home » Tag Archives: SQL (page 3)

Tag Archives: SQL

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 »

The 10 Most Popular DB Engines (SQL and NoSQL) in 2015

software-development-2-logo

About two years ago, we’ve published this post about the 10 most popular DB engines, where we analyzed the data published by Solid IT on their DB Ranking website. In the meantime, the Solid IT measurement system has found to be a credible source, such that the website has also been cited at Gartner, InfoWorld, and many other sources. Comparing ...

Read More »

You Probably don’t Use SQL INTERSECT or EXCEPT Often Enough

software-development-2-logo

When people talk about SQL JOIN, they often use Venn Diagrams to illustrate inclusion and exclusion of the two joined sets: While these Venn diagrams are certainly useful to understand (and remember) SQL JOIN syntax, they’re not entirely accurate, because SQL JOIN is a special type of a cartesian product, the CROSS JOIN. In a cartesian product between two sets ...

Read More »

Don’t Format Dates in SQL. Use the DATE Literal!

software-development-2-logo

I’m seeing people do this all the time. They want to hammer a date or timestamp constant into their SQL query, and the only function they know is the TO_DATE() or TO_TIMESTAMP() date parsing function: SELECT TO_DATE ('20150801', 'yyyymmdd') FROM DUAL; As observed in this Stack Overflow question, for instance: TO_DATE ('20150801', 'yyyymmdd') AS DAY_20150801_TOTAL, TO_DATE ('20150802', 'yyyymmdd') AS DAY_20150802_TOTAL, ...

Read More »

Passing Arrays to a PostgreSQL PL/pgSQL Function

postgresql-logo

It can be handy to pass a collection of strings to a PL/pgSQL stored function via a PostgreSQL array. This is generally a very easy thing to accomplish, but this post demonstrates a couple of nuances to be aware of when passing an array to a PL/pgSQL function from JDBC or psql. The next code listing is for a contrived ...

Read More »

There is no Such Thing as Object-Relational Impedance Mismatch

software-development-2-logo

Much of the ORM criticism of the last decade missed the point, being inaccurate. By the end of this article, we will conclude with the following: There is no significant difference between the relational (data) model and object oriented models How to come to this conclusion? Read on! How we came to believe in this fallacy Many popular bloggers and ...

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