phpfunk.com


Archive for the ‘databases’ Category

left join sql select with where clause or on conditional

Wednesday, April 6th, 2011

Given a database schema containing the following tables: CREATE TABLE `categories` ( `id` int(10) unsigned NOT NULL auto_increment, `category` varchar(31) NOT NULL default ”, PRIMARY KEY (`id`) ) ENGINE=InnoDB; CREATE TABLE `account_categories` ( `acct_id` int(10) unsigned NOT NULL, `cat_id` int(10) unsigned NOT NULL, `markup` decimal(3,2) NOT NULL default ’0.00′, PRIMARY KEY (`acct_id`,`cat_id`), KEY `cat_id` (`cat_id`), [...]

Learn efficient mysql

Wednesday, March 17th, 2010

Having a good understanding of database schema design, how to use indices and write table joins is important for any developer. If you use mysql there is an excellent book that covers such information in a clear and concise manner. Click on the cover image to visit amazon.com: