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.
In MySQL, we can rename a table using one of the following methods:
RENAME OLD_TABLE_NAME TO NEW_TABLE_NAME
ALTER TABLE OLD_TABLE_NAME
RENAME TO NEW_TABLE_NAME
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.
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.
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.
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(*)
GROUP BY COLUMN_NAME
HAVING (COUNT(*) > 1);
I have been following BOTW’s promotions this year, and the best I’ve found so far is 20% off. So, if you’ve been thinking about submitting to the BOTW directory, but have been hesitant because of the price, now is the time to act!