ORDER BY [col1],[col2],...,[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.GROUP BY [col1],[col2],...,[coln]; Tels DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average
Set char to occupy n bytes and it will take n bytes even if u r
storing a value of n-m bytes Set varchar to occupy n bytes and it will take only the required space
and will not use the n bytes
eg. name char(15) will waste 5 bytes if we store ‘romharshan’, if each char takes a byte
eg. name varchar(15) will just use 10 bytes if we store ‘romharshan’, if each char takes a byte. rest 5 bytes will be free.
you can use LOAD DATA INFILE file_name; syntax to load data
from a text file. but you have to make sure that
a) data is delimited
b) columns and data matched correctly
To backup: BACKUP TABLE tbl_name[,tbl_name] TO ‘/path/to/backup/directory’
RESTORE TABLE tbl_name[,tbl_name] FROM ‘/path/to/backup/directory’mysqldump: Dumping Table Structure and DataUtility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table.
-t, no-create-info. Don’t write table creation information (the CREATE TABLE statement).
-d, no-data. Don’t write any row information for the table. This is very useful if you just want to get a dump of the structure for a table!