Version 3 of the Foxhound Database Monitor is now available...

Tuesday, March 18, 2008

Unpublished MySQL FAQ

Q: How much does MySQL cost?
A: MySQL is free!

Q: Why should I use MySQL?
A: MySQL is free!

Q: Who do I call if I find a bug in MySQL?
A: MySQL is free!

Q: Is database recovery automatic after the server crashes?
A: MySQL is free!

Q: Are all data changes recorded in the binary log?
A: MySQL is free!

Q: How do I get referential integrity?
A: MySQL is free!

Q: How do I get multi-user transaction control?
A: MySQL is free!

Q: What happens when ALTER TABLE ... SET NOT NULL encounters a NULL value?
A: MySQL is free!

Q: What happens to foreign keys when InnoDB is not running?
A: MySQL is free!

Q: How do I get snapshot isolation (multiversion concurrency control)?
A: MySQL is free!

Q: What happens when you divide by zero in MySQL?
A: MySQL is free!

Q: What happens when an application tries to insert a NULL value into a NOT NULL column with no DEFAULT?
A: MySQL is free!

Q: What happens when an application tries to insert a NULL value into an AUTO_INCREMENT PRIMARY KEY column?
A: MySQL is free!

Q: What happens to the table when you add or drop an index?
A: MySQL is free!

Q: What rows will WHERE column IS NULL match, when applied to a NOT NULL column?
A: MySQL is free!

Q: Does MySQL let you code spaces in function references, as in SELECT MIN ( salary )?
A: MySQL is free!

Q: How do I get to use all the column and index types?
A: MySQL is free!

Q: What happens when you try to insert 'xxxxxxxxxx' into a VARCHAR(5) column?
A: MySQL is free!

Q: What happens when you try to insert 123456.78 into a NUMERIC(5,2) column?
A: MySQL is free!

Q: What happens when you try to insert '2008-02-31' into a DATE column?
A: MySQL is free!

Q: What happens when you try to insert '2008-03-00' into a DATE column?
A: MySQL is free!

Q: What happens when you try to insert '0000-00-00' into a DATE column?
A: MySQL is free!

Q: What happens when you try to insert 'xxx' into a DATE column?
A: MySQL is free!

Q: What happens when you try to insert 99999999999 into a INT column?
A: MySQL is free!

Q: What happens when you try to insert 'xxx' into a INT column?
A: MySQL is free!

Q: What happens when you try to insert a numeric value into an ENUM column?
A: MySQL is free!

Q: What happens when you try to insert an out of range index value into an ENUM column?
A: MySQL is free!
Q: How does AUTO_INCREMENT work?
A: MySQL is free!

Q: How does the TIMESTAMP data type work?
A: MySQL is free!

Q: How do I use time values with fractional seconds?
A: MySQL is free!

Q: How do I use time zones?
A: MySQL is free!

Q: Is MySQL a relational database management system?
A: MySQL is free!

Q: Will MySQL handle my database?
A: MySQL is free!
(continued at Unpublished MySQL FAQ (2))

13 comments:

Anonymous said...

Breck, you got me to laugh out loud on this one!

I think your google foo just went down, though. :)

-jim.

Breck Carter said...

Oh yes on many levels I am sure :)

Anonymous said...

I always liked this one:

http://bugs.mysql.com/bug.php?id=27645

NOW()? No way can MySQL handle that - that's a default value that calls a function to derive its value! Scary!

(MySQL is Free!)

Matt said...

I wish I could remember who I got into a major drop down drag out argument with over mysql's "NOT null" behavior. I wish I could remember, because I'd send them this list.

It was a long time ago, before I knew much at all about databases (not that I do now, mind you, but I have more experience than I did then), and I sanely objected to the fact that MySQL would happily insert null into my NOT null fields. It made no sense to me at all. I'm glad I'm not the only one.

Anonymous said...

Q: how do i do select * from sometable limit 1000,10 in mssql

A: mssql is expensive!

Anonymous said...

Anonymous:

You do it like this:

WITH PagedData AS (
SELECT ROW_NUMBER() OVER (ORDER BY id) AS rownum, * FROM sometable
)
SELECT *
FROM PagedData
WHERE rownum BETWEEN 1000 AND 1009;

I know, it's complicated, but it's also ANSI SQL:2003 and works in MSSQL, Oracle and DB2.

When will MySQL support CTEs and ranking functions to perform ANSI compliant paging?

MySQL is free!

Breck Carter said...

Q: how do i do select * from sometable limit 1000,10 in mssql

A: Well, yes, MSS is expensive, and no, you can't do offsets in SQL Server 2008. The MSS syntax SELECT [ TOP (expression) [PERCENT] [ WITH TIES ] ] is shown here: TOP (Transact-SQL)

HOWEVER, you CAN do that in SQL Anywhere, and no, SQL Anywhere is NOT expensive.

-- continued --

Breck Carter said...

The MySQL syntax SELECT ... [LIMIT {[offset,] row_count | row_count OFFSET offset}] is shown here: 12.2.8. SELECT Syntax

The SQL Anywhere 11 syntax SELECT FIRST | TOP n [ START AT m ] is shown here: SELECT statement

But, as always... MySQL is free!

Myor said...

hahhaa.. so, the best answer in forum mysql is MySql is Free. :D

Anonymous said...

whats this????????????????????????????????

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

you should be aware the previous comment is spam

Breck Carter said...

@Anonymous: Thanks, it's gone now. Google has an almost 100% perfect record of deleting spam automatically with zero effort on my part. Being paranoid, however, I thought "maybe there are lots of false positives" so I looked in the Spam Comments folder... nope, all spam, even the ones that REALLY LOOK like real comments... I feel a blog post coming on :)