A Little Noise

November 15, 2005

Distinct Count

Filed under: MySQL Gotchas — snoyes @ 4:00 am
SELECT COUNT(DISTINCT someField) FROM someTable;
SELECT DISTINCT someField FROM someTable;

T/F: The value returned by the first will always equal the number of rows returned by the second.
Show Answer ▼

November 13, 2005

Unique Index

Filed under: MySQL Gotchas — snoyes @ 4:00 am

If I run the following, what will happen?

CREATE TABLE myTable (someField int, UNIQUE (someField));
INSERT INTO myTable VALUES (null);
INSERT INTO myTable VALUES (NULL);

Show Answer ▼

November 11, 2005

Truncation

Filed under: MySQL Gotchas — snoyes @ 4:47 pm

Assume the following has completed correctly:

CREATE TABLE test (
charField varchar(5)
);

What is the end difference between the following two statements?

INSERT INTO test (charField) VALUES ("123456");
INSERT INTO test (charField) VALUES ("12345 ");

Show Answer ▼

November 9, 2005

User Experience

Filed under: MySQL — snoyes @ 4:43 pm

I had a positive user experience at the MySQL website the other day while registering for a webinar. The site knew I was logged in, and filled out as much of the form for me as it could. When I added the missing pieces of information, that next page noticed and provided a single-click where I could add the data to my profile. Added functionality, but completely unobtrusive – that’s the user experience I like.

« Newer Posts

Powered by WordPress