Archives

The List

Pop Quiz

« Previous Entries Next Entries »

MySQL Pop Quiz #22

Monday, March 31st, 2008

I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
A column defined as CHAR(x) or VARCHAR(x) will allow you to store up to x characters within each field of that column.
What’s the minimum size of x?
What’s the maximum [...]

MySQL Pop Quiz #21

Friday, March 28th, 2008

I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
The maximum row size in a MySQL table in 64kb (65,535 bytes).
A LONGTEXT or LONGBLOB column may be up to 4,294,967,296 (4G) in size.
Explain how a LONGTEXT or LONGBLOB [...]

MySQL Pop Quiz #20

Thursday, March 27th, 2008

Today’s question comes courtesy of Diego Medina.
I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
When using a 1-byte character set like Latin-1, a VARCHAR(250) field requires 251 bytes of storage. A VARCHAR(260) field requires 262 bytes [...]

MySQL Pop Quiz #19

Wednesday, March 26th, 2008

I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
This entry comes from Rudy Limeback
A user searching your website is moving through categories, and you want to display descriptions of these categories as the user progresses. Your basic [...]

MySQL Pop Quiz #18

Tuesday, March 25th, 2008

I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
In mysql>, you already know that hitting return on this:
SELECT 1+1, 2+2;
returns this:
+—–+—–+
| 1+1 | 2+2 |
+—–+—–+
| 2 | 4 |
+—–+—–+
What happens if you instead [...]

MySQL Pop Quiz #17

Wednesday, March 19th, 2008

I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
As the MySQL root user user, I grant access to a new employee in the organization:
GRANT SELECT ON abc.* TO “user_a”@”192.168.1.%”;
Some time later, the new colleague becomes a former [...]

MySQL Pop Quiz #16

Monday, March 17th, 2008

I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
Short questions with somewhat involved answers. In terms of MySQL (and databases in general)…

What is a character set?
What is a collation?
How do they interact?
Is this something you even need [...]

MySQL Pop Quiz #15

Monday, March 17th, 2008

I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
Question: Where can you find a really cool Pop Quiz — like question on the syntax (and pitfalls) of the CASE statement?

MySQL Pop Quiz #14

Monday, March 10th, 2008

This quiz is based on an email I got from a somewhat annoyed Jesper Krogh.
btw, I’m still looking for new entries. I get quite a few suggestions, but not all of them make it into quiz questions. Do send in your suggestions!
Given:
SELECT * FROM car_parts:
+———+———+——-+——–+
| part_id | car_id | price | weight |
+———+———+——-+——–+
| [...]

MySQL Pop Quiz #13

Thursday, March 6th, 2008

Another quiz based on comments from aka fenixshadow:
Two identical tables with FOREIGN KEY constraints within the tables are created:
CREATE TABLE t (
id INT NOT NULL PRIMARY KEY,
type INT,
pid INT,
FOREIGN KEY (pid) REFERENCES t (id)
) ENGINE=INNODB;

CREATE TABLE t1 (
id INT NOT NULL PRIMARY KEY,
[...]

« Previous Entries Next Entries »