Ravens vs 49ers, Super Bowl 2013 Prediction

The matchup for Super Bowl XLVII (47) has been set: San Francisco 49ers vs Baltimore Ravens.

The 49ers were the NFC West Champion and was the #2 seed in the NFC. They reached the Super Bowl by first beating the Green Bay Packers, 45-31, where quarterback Colin Kaepernick ran wild and set a playoff rushing record for quarterbacks. In the NFC Championship Game, the 49ers went to Atlanta and was able to overcome Atlanta’s strong passing game in the first half to win, 28-24.

More »

Browser Market Share, December 2012

Here is the browser market share for December 2012, based on traffic to my top site (number in parentheses shows change from November 2012):

Google Chrome: 37.80% (+0.58%)
IE: 29.72% (-0.13%)
Firefox: 26.37% (-0.74%)
Safari: 3.07% (+0.21%)
Opera: 1.41% (-0.03%)

More »

Rename Table in SQL

Sometimes, it may be necessary to rename a table. There is no standard way to rename a table, and the implementation varies by RDBMS. Below we discuss how we can rename a table in MySQL, Oracle, and SQL Server.

MySQL

In MySQL, we can rename a table using one of the following methods:

Method 1

RENAME OLD_TABLE_NAME TO NEW_TABLE_NAME

Method 2

ALTER TABLE OLD_TABLE_NAME
RENAME TO NEW_TABLE_NAME

More »

Find 2nd Largest Value Using SQL

We all know that the MAX function can be used to find the largest value in SQL. How, then, can we write a single-pass SQL that can be used across different database systems to find the second largest value in a column? Single-pass means only one SQL query gets executed, as opposed to having multiple SQL statements using temporary tables to store intermediate results.

More »

Dockster – New Mac Malware Found

A new malware targeting Mac computers have been found and is given the name Dockster. Dockster is a backdoor malware that allows the attacker to compromise the victim’s computer by logging keystrokes and downloading files. It infects computers in the same way as the Flashback malware, which was first discovered in September, 2011. This particular exploit was due to a vulnerability in Java, which Apple had issued a patch for in April, 2012. Systems that have not been patched, however, are still vulnerable to this malware.

More »

Browser Market Share, November 2012 and IE’s Browser Your Love To Hate Campaign

Here is the browser market share for November 2012, based on traffic to my top site (number in parentheses shows change from October 2012):

Google Chrome: 37.22% (+0.51%)
IE: 29.85% (-0.92%)
Firefox: 27.11% (+0.01%)
Safari: 2.86% (+0.32%)
Opera: 1.44% (+0.08%)

More »

Amazon Enters Data Warehousing Field Via Amazon Redshift Service

On November 28, Amazon announced it is entering the data warehousing field by announcing the Amazon Redshift service. Amazon Redshift is build on the ParAccel database platform, which can be accessed using SQL. Users can connect to the Amazon Redshift data warehouse using standard PostgreSQL JDBC or ODBC drivers. In addition, Amazon Redshift is already certified by Jaspersoft and MicroStrategy, two of the leading BI tools in the marketplace.

More »

Find Duplicates in SQL

SQL does not provide a built-in capability to find duplicates in a table. Fortunately, it is fairly easy to write a SQL query that does it. The idea is to count the number of occurrences for each value, and then use the HAVING condition to show only the values that appear more than once.

SELECT COLUMN_NAME, COUNT(*)
FROM TABLE_NAME
GROUP BY COLUMN_NAME
HAVING (COUNT(*) > 1);

More »