Another column modifer: AUTO_INCREMENT generate sequence of successive unique integers. On one integer column only, which must be indexed (e.g. Primary Key) and Not Null (automatically is Not Null if Primary Key, but not if other indexes). Probably should be unsigned too (negative value might mess it up??). When Insert Null or 0 (deprecated?), generates the next unique integer. Typically used to create artificial primary key. Reset if Delete all rows or Truncate. LAST_INSERT_ID() function returns most recently generated sequence number. Independent sequences if Auto_increment on part of a composite key. id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT +----------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | ************************************************************************** Another Select statement clause: --HAVING clause modifies Group By clause (further constrains the groups to those with particular summary characteristics) SELECT f1,aggfunc(f2) FROM t GROUP BY f1 HAVING aggfunc(f2) relOp value can be different aggregate functions. find duplicate fi's: SELECT fi... FROM t GROUP BY fi HAVING COUNT(*)>1 select species,count(*) from pet group by species having count(*)>2; select species from pet group by species having avg(weight)>20; select owner from pet group by owner having count(*)=1; #species of exactly 2 pets: select species from pet group by species having 2=count(*); HAVING and WHERE sometimes interchangable in GROUP BY if the condition does not involve an aggregate function and does involve the grouping column: Having doesn't have to have an aggregate function, it can be a restriction on the Group By column: select species,count(*) from pet group by species having species!='snake';SELECT ... FROM t GROUP BY fi HAVING condition SELECT ... FROM t WHERE condition GROUP BY fi select species,count(*) from pet where species='cat' or species='dog' group by species; select species,count(*) from pet group by species having species='cat' or species='dog'; More efficient to use the Where version; it eliminates rows earlier. ************************************************************************** LOAD DATA LOCAL INFILE 'filename' INTO TABLE t1 (f2,f6,f3) #list of columns corresponding to fields of datafile ************************************************************************** status #of mysql client program server information: SHOW STATUS; #310 counters FLUSH STATUS; #reset counters SHOW PROCESSLIST; #connected clients/threads SHOW VARIABLES; #120/329? of them Show variables Like '%buffer'; select host,user,password from mysql.user; #users SHOW CREATE TABLE t1; SHOW TABLE STATUS; Name,Engine,Row_format,Rows,Avg_row_length,Data_length,Index_length,Create_time,Update_time