Hi Akshay, It is great to see students from most premier institutions of a country in Drizzle. I hope you can do more heavy lifting than this suggested one
(please don't get me wrong, i am not trying to discourage you, but to encourage you to do things worth great for the world) Regarding "DIVIDE" operation on sets, You may notice that such a crucial thing is missing from most of the RDBMS implementations and even from ANSI/ISO spec of SQL. it is not something missing...there is GROUP BY ..... HAVING clause, which acts as a superset of "DIVIDE". In real world, i see developers are quite comfortable with this clause to do "divide" operation. (Hoping that i got your points correctly) In My Humble Opinion, SQL as a language is very powerful and expressive (please see Standards spec or Postgres) but twisted SQL implementation is a problem. It will be great if you can help drizzle to get it straight. (In my short experience, it looks like sql dielect by MySQL is quite twisted / weak compared to that of Postgres, Firebird and others. Drizzle inherits this weakness. Jihadi's please don't put bomb on me) but i see Drizzle is continuously improving the to match ANSI/ISO SQL spec. As a user, i love to have same power to express my queries just like any others (being a Drizzle user, don't want to be a second class citizen) Thank you, Jobin. On Tue, Mar 30, 2010 at 1:38 AM, Akshay Mittal <[email protected]> wrote: > Hi Jobin and Andrew, > > Thanks for your suggestions. Minus/Except and Intersect are indeed quite > easy to implement using the sub-queries ( for eg left join as you suggested) > but I am sure you would have faced a hell lot of trouble in conjecturing a > "DIVIDE" query. > I do hope you have used a "DIVIDE" implementation in a query before. Only > then can you understand the complexity of the queries involving this > operation. > > Thanking you, > Akshay Mittal > IIT Kanpur, > India > > > On Tue, Mar 30, 2010 at 12:07 AM, Jobin Augustine <[email protected]>wrote: > >> Andrew, you are correct. >> A simple left Join is sufficient. and no need of any sub-query to do >> minus. >> just like : >> >> select t1.a,t1.b >> from t1 left outer join t2 on t1.a = t2.a and t1.b = t2.b >> where t2.a is null... >> >> and if user don't know what is left join, can be more explicit: >> >> select t1.a,t1.b from t1 where (t1.a,t1.b) not in (select t2.a,t2.b from >> t2); >> here "not in" = "minus" >> >> The first one method is much better because it is a normal join operation >> it can do all optimization. >> on the otherhand a minus operation not only cannot be optimized (say, for >> using indexes), need to store the result in temporarily just like Union. >> >> IMHO, the keyword "minus" is a Oraclism. not in standards and other >> database like Postgres, M$ SQL. >> Standard keywords for set operations are : UNION, INTERSECT, and EXCEPT. >> here EXCEPT is "minus" >> INTERSECT is much more straight to put in normal join. >> >> In all these set operations, UNION is required to be implemented and >> drizzle already has it. >> others are just of decorative bells. >> >> Thank you, >> Jobin. >> >> On Mon, Mar 29, 2010 at 7:15 PM, Andrew Hutchings <[email protected] >> > wrote: >> >>> Hello Akshay, >>> >>> On Mon, 2010-03-29 at 18:53 +0530, Akshay Mittal wrote: >>> > MySql does not have the set operations-- >>> > "divide" , "intersect" and "minus" --- related queries as opposed to >>> > set operation - "union". Recently I have developed a php >>> > wrapper which could interface with MySql and implement the "divide" , >>> > "intersect" and "minus" features in the same way as "union". For >>> > example: >>> > >>> > select A,B from rel1 minus select A,B from rel2 >>> > >>> > will return the tuples(A,B) that are present in rel1 and not present >>> > in rel2. >>> >>> I could be wrong but is this not the same as a left join and checking >>> for NULL in the where condition? >>> >>> Kind Regards >>> -- >>> Andrew Hutchings - LinuxJedi - http://www.linuxjedi.co.uk/ >>> Certified MySQL Developer, DBA & Cluster DBA >>> Zend PHP5 Certified Engineer >>> >>> >>> _______________________________________________ >>> Mailing list: >>> https://launchpad.net/~drizzle-discuss<https://launchpad.net/%7Edrizzle-discuss> >>> Post to : [email protected] >>> Unsubscribe : >>> https://launchpad.net/~drizzle-discuss<https://launchpad.net/%7Edrizzle-discuss> >>> More help : https://help.launchpad.net/ListHelp >>> >> >> >
_______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

