Archive for June, 2009

The FEDERATED storage engine is available beginning with MySQL 5.0.3. It is a storage engine that accesses data in tables of remote databases rather than in local tables. The FEDERATED storage engine is available beginning with MySQL 5.0.3. This storage engine enables data to be accessed from a remote MySQL database on a local server without using replication or cluster technology. When using …

The syntax in the previous answer (where count(*) > 1) is very questionable. suppose you think that you have duplicate employee numbers. there’s no need to count them to find out which values were duplicate but the followin SQL will show only the empnos that are duplicate and how many exist in the table: Select empno, count(*) from employee group by empno having …

MySql has many advantages in comparison to Oracle. 1 – MySql is Open source, which can be available any time 2 – MySql has no cost of development purpose. 3 – MySql has most of features , which oracle provides 4 – MySql day by day updating with new facilities. 5 – Good for small applications. 6 – easy to learn and to …

The second one is on-demand and can be retrieved via SELECT SQL_CACHE … If you’re worried about the SQL portability to other servers, you can use SELECT /* SQL_CACHE */ id FROM … – MySQL will interpret the code inside comments, while other servers will ignore it.

SELECT SQL_NO_CACHE

PRIMARY KEY cannot be null, so essentially PRIMARY KEY is equivalent to UNIQUE NOT NULL.

ALTER TABLE customers ADD INDEX (business_name(4))

ALTER TABLE customers TYPE = InnoDB

Berkeley DB and InnoDB.

What’s ACID?

 on June 15, 2009

Automicity – transactions are atomic and should be treated as one in case of rollback. Consistency – the database should be in consistent state between multiple states in transaction. Isolation – no other queries can access the data modified by a running transaction. Durability – system crashes should not lose the data.