Give Me One Minute And I’ll Tell You If You Are Liberal Or Conservative

This Tuesday is election day in the United States. It’s a big day. Political enthusiasts from both the Republican and Democrat parties go to the polls and vote for their preferred candidates for member of Congress, state legislature and governor.

But, what does this have to do with databases. Well, it turns out that the SQL language has politics embedded in it. For example, consider the following two simple queries:

Query 1:

SELECT emp.last_name,
       dept.department_name
  FROM departments dept LEFT OUTER JOIN employees emp
       ON dept.department_id = emp.department_id

Query 2:

SELECT emp.last_name,
       dept.department_name
  FROM employees emp RIGHT OUTER JOIN departments dept
       ON dept.department_id = emp.department_id

Both queries return the same result set. The difference between the two is that one uses “LEFT” and the other uses “RIGHT”.

Which one do you prefer using? In other words, which type of outer join do you usually use in your queries, the left or the right?

Now, if you select query 1, the one that uses the “LEFT” join, you most probably lean towards the left. You are a liberal. As a result, you are more likely to vote Democrat this Tuesday.

But, if you select query 2, the one that uses the “RIGHT” join, you most probably lean towards the right. You are a conservative. As a result, you are more likely to vote Republican this Tuesday.

There you go. A simple test, for all of you SQL developers out there, to know your political affiliation. :)

Some have called for a boycott of all right joins and only use left joins on Tuesday. Others have called for the abolition of both the left and the right.

Personally, I do not use right joins. But again, I cannot vote because I’m not a US citizen.


Possibly related:


Tagged , , | Post a Comment