3 ms·
I like relational algebra. I like the idea of a data-store language whose core features are the CRUD operations. But I'll pipe up and say I don't like SQL. V
by Pxtl 12y ago
I like relational algebra. I like the idea of a data-store language whose core features are the CRUD operations. But I'll pipe up and say I don't like SQL. Verbose string management, monstrous 3-value boolean logic, the lack of any linguistic shortcuts for joining on foreign-key constraints, etc.. The problem is that a good replacement for SQL would be a modernized relational language, not a NOSQL language that throws the baby out with the bath-water.
- jimktrains2 12y agoYou mean shorter than "JOIN fktable USING (key_name)"? (Granted, that implies both columns have the same name iirc)
- twic 12y agoActually, yes. JPQL, the generally SQL-like query language in the Java Persistence API, lets you write joins through foreign key references (as most joins are, although of course not all) as if they were object property references. So instead of: select u.user_id from User u join Company c using (company_id) join Country k using (country_id) where k.code = 'br' You would write something like: select u from User u where u.company.country.code = 'br' That's pretty neat. I wish i could do that in SQL. If you want to fetch data from joined entities, then you still need to name them in an explicit join, but it's still easier than in SQL: select u, k.code from User u join u.company.country k where u.creation_date = current_date
- Pxtl 12y agoMicrosoft's Entity Framework is similar, except that they put the Select at the end so that the editor is aware of the availability of relevant variables when you're writing the "select" part of the statement. Such simple changes that will never be part of the SQL standard.
- sanderjd 12y agoYeah the SQL vs. NoSQL thing conflates so many different concerns. Sometimes it's about not wanting to do things relationally, sometimes it's about trading off ACID for other concerns, and sometimes (most rarely, it seems to me) it is actually about the SQL language itself. I don't think the language is really so bad (inconsistencies across databases aside), but I'd be interested in taking a look at a redesigned language that does all the same stuff but cleans a few things up.