WHERE clause combined with greater than(>) to COMPARISON OPERATORS WHERE clause combined with Equal(=) to COMPARISON OPERATORS WHERE clause combined with – NOT IN Keyword SELECT * FROM table2 WHERE t1 NOT IN (1,2,3) SELECT * FROM table2 WHERE t1 IN (1,2,3) WHERE clause combined with – OR LOGICAL Operator SELECT * FROM table1 WHERE t1 = 1 OR t1 = 2 WHERE clause combined with – AND LOGICAL Operator SELECT * FROM table1 WHERE t1 = 2 AND t2 = 2008 MySQL WHERE clause with AND, OR, IN, NOT IN commands Command SELECT column_name|value|expression alias_name SELECT Concat(t1, (, t3, )), t4 FROM table2 We are only interested in getting only the t1, t2, t3 and t4 fields only. SELECT FROM tableName ORDER BY fieldName(s) Similar to VARCHAR, difference is texts are stored in binary format. Similar to CHAR, difference is texts are stored in binary format. Synonym for TINYINT(1), used to store Boolean values This is also used for storing text values chosen from a list of predefined text values. To store text value chosen from a list of predefined text values. Choice for storing currency values.Ī fixed section from 0 to 255 characters long.Ī variable section from 0 to 255 characters long.Ī string with a maximum length of 255 characters.Ī string with a maximum length of 65535 characters.Ī string with a maximum length of 16777215 characters.Ī string with a maximum length of 4294967295 characters. 9223372036854775808 to 9223372036854775807 normalĪ small approximate number with a floating decimal point.Ī large number with a floating decimal point.Ī DOUBLE stored as a string, allowing for a fixed decimal point. SQL Data Types Cheat Sheet Numeric Data types Command You can see list of existing databases by running following SQL command.ĬREATE TABLE TableName (fieldname dataType ) ENGINE = storage Engine The Latin1 character set uses the latin1_swedish_ci collation which is the Swedish case insensitive order. IF NOT EXISTS let you to instruct MySQL server to check the existence of a database with a similar name prior to creating database.ĬREATE DATABASE IF NOT EXISTS database1 CHARACTER SET latin1 COLLATE latin1_swedish_ci MySQL GROUP BY and HAVING Clause commandĬreate Database and table commands Command.In this SQL Query cheat sheet you will learn
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |