Categories
Mozilla Web Development

The Winner For Most Embedded Is: SQLite

So the format war of Blue-ray vs. HD-DVD is over. There are still several other rather significant battles going on in the tech world right now that aren’t Microsoft vs. Apple or Yahoo vs. Google. For example:

Adobe Air vs. Mozilla Prism vs. Microsoft Silverlight

Google Gears vs. HTML5 Offline support

Android vs. iPhone SDK vs. Symbian

Ruby On Rails vs. PHP

Not every case will have a true “winner”. That’s not really a bad thing. Choice is good. In some cases they will merge to form one standard, such as what’s likely for offline web applications.

What is interesting is that SQLite really dominates right now. Adobe Air, Mozilla Prism, Google Gears, Android, iPhone SDK (likely through Core Data API), Symbian, Ruby On Rails (default DB in 2.0), PHP 5 (bundled but disabled in php.ini by default). It’s becoming harder and harder to ignore that SQL survived the transition from mainframe to server, and now is going from server to client.

No longer is the term “database” purely referring to an expensive RAID5 machine in a datacenter running Oracle, MySQL, DB2 or Microsoft SQL Server. It can now refer to someone’s web browser, or mobile phone.

This has really just begun to have an impact on things. The availability of good information storage, retrieval, and sorting means much less of these poorly concocted solutions and much better applications. Client side databases are the next AJAX.

Edit [2/27/2008 9:14 AM EST]: Added Symbian, since they also use SQLite. Thanks Chris.

Categories
Programming

Getting A Random Row In MySQL

This is a great page on RAND() in MySQL. Very nice breakdown of how to gain performance with one of the biggest “it should be simple but it isn’t” problems in DBMS’s.

Categories
Funny Programming

Holiday SQL

You’ve got to be somewhat nerdy for this, but if your reading this, you automatically qualify. Perhaps I’ll add to this list when I’m bored. If I have the time. If someone is so inclined, feel free to do so below.

Santa’s Present List

SELECT fName, lName, street, city, state, zip, country
FROM people
WHERE STATUS = ‘nice’
AND age < 18
ORDER BY country DESC;

Santa’s Coal List

SELECT fName, lName, street, city, state, zip, country
FROM people
WHERE STATUS = ‘naughty’
AND age < 18
ORDER BY country DESC;

Santa’s Personal Wish List

SELECT fName, lName, street, city, state, zip, country
FROM people
WHERE STATUS = ‘naughty’
AND age BETWEEN 18 AND 25
AND height BETWEEN 67 AND 72
AND cupSize > ‘C’
AND sex = ‘female’
ORDER BY age ASC;

Paris Hilton’s Personal Wish List

SELECT fName, lName, street, city, state, zip, country
FROM people
WHERE age BETWEEN 18 AND 30;

Feel free to give it a try if your geeky enough to do so. I’ll update them to color syntax.