Queries

Steve Holden steve at holdenweb.com
Fri Feb 27 23:09:36 EST 2009


Dennis Lee Bieber wrote:
> On Fri, 27 Feb 2009 15:39:13 -0800 (PST), mmcclaf <mmcclaf at gmail.com>
> declaimed the following in gmane.comp.python.general:
> 
>> This came in the Python groups, and I put one up in the database
>> group, since I will later have to use Python to access the SQL file,
[...]
>> The relational algebra, I am able to translate it into SQL, or most of
> 
> ... and formal relational algebra is a notation many users of database
> engines like MySQL, SQLite, Access/JET, Visual FoxPro, Paradox, Sybase,
> etc. have never encountered -- heck, Access tries to hide SQL from the
> user via a form of QBE interface.
> 
> 	If I were to attempt a textual version of relational algebra, you'd
> be getting something on the order of:
> 
> t1 = Ships x Classes
> t2 = restrict t1(Ships.class = Classes.class)
> res = project t2(Ships.name, Classes.class, Classes.country)
> 
> instead of straight forward SQL
> 
> select Ships.name, Classes.class, Classes.country from Ships
> 	inner join Classes
> 		on Ships.class = Classes.class
> 
> 
I think the real problem is that the database design the OP is using os
far from normalized. This will tend to contort the logic, as well as
making the programming harder to understand.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list