• Coding Practice,  MySQL

    Use ANSI Style for MySQL

    I prefer to use ANSI style for writing MySQL queries.  When I started working on SQL, I used the old style aka Theta style for all my queries. Example of a query in  Theta style : SELECT  e.title, i.first_name, i.response FROM invitees i, events e WHERE e.id = i.event_id AND e.date = ‘2008-07-04’; which , in ANSI style is equivalent to : SELECT e.title, i.name, i.response FROM invitees i INNER JOIN events e on e.id = i.event_id WHERE e.date = ‘2008-07-04’ Many developers prefer using the old style. But believe me, ANSI style is lot better and advantageous. First, MySQL  supports OUTER JOINs in ANSI style. Second, ANSI style forces…