Donate!: http://bit.ly/DonateCTVM2. Videos Available for Download - http://www.udemy.com/calebthevideomaker2-database-and-mysql-classes/
Playlist - http://www.youtube.com/watch?v=krx-w9icrkU&list=PL405B31DD586979DE
Welcome to your very first video in this series, MySQL Datatypes! Please subscribe and like my videos, it means a TON to me. Thanks :)
This is simply a small course to introduce you to all of the datatypes(excluding spatial, which I will not be covering in this course).
All of the datatypes are broken into 4 sections, these are Numeric, Date and Time, String, and Spatial. In all, these are the datatypes I will be covering: tinyint, smallint, mediumint, int, bigint, decimal, float, double, real, bit, boolean, serial, date, datetime, timestamp, time, year, char, varchar, tinytext, text, mediumtext, longtext, binary, varbinary, tinyblob, mediumblob, blob, longblob, enum, and set. Wooah that's a lot. haha.
I will not be going over geometry, point, linestring, polygon, multipoint, or multilinestring. If you want to learn more about Spatial types, start here: http://dev.mysql.com/doc/refman/5.6/en/mysql-spatial-datatypes.html
Want more information about what is covered in these videos? Always be sure to read the supporting page in the MySQL manual. http://dev.mysql.com/doc/refman/5.6/en/index.html
Video information: Char and Varchar
Char has a character range from 0 up to 255, varchar allows up to 65535.
a max length can be specified in parenthesis such as char(40).
char is right padded to fit the specified amount of characters, and the spaces are then removed on retrieval. Only trailing spaces will be removed. for example. Cat_hat__ will come out as cat_hat. This can be a bad thing if you need to store spaces. you will need to use varchar instead.
If a value entered is too long, it will be "truncated," or cut to length.
a character set is an allowed range of characters that are entered into an entry. such as UTF-8. Utf 8 is 3 bytes for every character.
the storing information for varchar and char are like this..
char - string length.
varchar - string length+1.
A 10 character entry using UTF-8 would then take 30 bytes in char, and 31 bytes in varchar, but if only 5 characters are entered, it will be 30 bytes for char, and 16 for varchar. This is because char stores the trailing spaces till the requested size is full (in this case 10).
A table maximum row size is 65535, so this means if you have a varchar 65535 that is completely full in one column, that is the max allowed stored across that column.
Any corrections needing made in these videos please message me. Thank you!
More content: http://CalebCurry.com
Subscribe (it's free!): http://bit.ly/PqPyvH
Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)