In MySql, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. The ‘.frm’ file stores the table definition. The data file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension,
0 Comments
SELECT COUNT(*) FROM table_name;
Primary Key: A column in a table whose values uniquely identify the
rows in the table. A primary key value cannot be NULL. Unique Key: Unique Keys are used to uniquely identify each row in the table. There can be one and only one row for each unique key value. So NULL can be a unique key. There can be only one primary key for a table but there can be more than one unique for a table. 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 we are
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 10 bytes if we store ‘mizan’, if each char takes a byte Eg: name varchar(15) will just use 5 bytes if we store ‘mizan’, if each char takes a byte. rest 10 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 SELECT DATEDIFF(’2007-03-07′,’2005-01-01′);
AES_ENCRYPT () and AES_DECRYPT ()
http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php
Cross Join Equi-Join (or) Inner Join Left Join Right Join
b) Begin all SQL verbs on a new line c) Separate all words with a single space d) Right or left aligning verbs within the initial SQL verb Refer: http://beginner-sql-tutorial.com/sql-query-tuning.htm |