PDA

View Full Version : help a newbie :(


alaios
12-13-2003, 08:01 PM
Hi there just a lot lot lot of questions. Plz answer as many as you
can.



What do u prefer varchar(2) or tiny_text?

What is the biggest size for the varchar? If I want to store a very big
article. What is the biggest size for text that is being support?



What is the difference between timestamp and DateTime? What do u
suggest?

What is the difference between Varchar and Binary Varchar? Details plz?



I have these type of associations supported by mysql

1:1

1:1 (Non-Identyfying)

1:1 (Descendent Obj.)



What are the differences among them? Especially the last one?

raf
12-13-2003, 08:18 PM
What do u prefer varchar(2) or tiny_text?
varchar(2)

Whenever a value from the column is selected, the mySQL server reserves some memoryspace to store the value in while he processes a record. if the column is a tinytext, he'll reserve more memoryspace (i believe just as much as for a varchar(255) ) then if it's a varchar(2).

So chosing the right, smalles possible columntype and length, is an easy way to seve runtime resources and have better performance.

What is the biggest size for the varchar?
max length = 255

If I want to store a very big. What is the biggest size for text that is being support?

Probably Longblob (length : 0 - 4294967295)

What is the difference between timestamp and DateTime? What do u sugest
Timestamp has a lowerlimit of 1970 and upperlimit of 2037 (years), and it's behaviour depends on the servers mySQL version, and you can specify the formt by setting the length.
Datetime has alowerlimit of 1000 and upperlimit of 9999, and is universal and always has the same length.

What is the difference between Varchar and Binary Varchar? Details plz?

Varchar is case-insensitive. If you make it binary, then it becomes case-sensitive. (It's VARCHAR(7) BINARY)
You could say that a varchar is like the text-columntypes, ant the varchar binary is like the blob-columntypesWhat is the difference between timestamp and DateTime? What do u

have these type of associations supported by mysql ...

I have no idea what you mean by that.

Check out
http://www.mysql.com/doc/en/Column_types.html
for more info