By now I stopped counting the attempts to replace SQL. There is a lot of valid critic for SQL and I would be very happy if some things would have been designed different. OTOH the architecture and mathematics behind relational databases are simple, composable and stood the test of time more than most other designs, methodologies or approaches to software development. Though SQL can be improved, even with my average S…
SQL has one flaw: The verb should come last. So, "FROM users WHERE id = 1 DELETE" or "FROM users WHERE email = 'foo@example.com' SELECT id". That'd cut back on some accidental "oops I dropped the whole table" because I submitted a delete query before writing the where clause. Other than that, it's perfect, no notes.
Rethinking Database Programming
91–100 of 167 posts
Re: Rethinking Database Programming
#92Earlier quoted context omitted.
SQL is based on the relational model but doesn't really conform to the mathematics e.g. doesn't exhibit set semantics.
Can you elaborate? It can't express every mathematical set operation, but it does have UNION, EXCEPT, and INTERSECT.
This has a number of elegant properties (and also improves the kinds of optimizations a query planner / execution stage can apply.)
A similar divergence is that the relational model has no concept of nulls. Presence/absence is expressed through "item not in set" in various ways, and by properly normalizing the data.
SQL also isn't properly expression oriented or composable at all. A relational algebraic language absolutely can be, and can lend itself to much more elegant data handling.
In many ways SQL is to "relational" like Java or C++ are to "object oriented" -- it got in very early to market, got mainstream success, and dominated the field, and in so doing it mangled people's perceptions of what a database is, and also made people either define "relational" as "SQL" (sigh), and even worse because they misunderstand what relational is while also hating SQL, they try to throw the baby out with the bathwater with their successors.
Re: Rethinking Database Programming
#93Earlier quoted context omitted.
SQL is based on the relational model but doesn't really conform to the mathematics e.g. doesn't exhibit set semantics.
Can you elaborate? It can't express every mathematical set operation, but it does have UNION, EXCEPT, and INTERSECT.
Re: Rethinking Database Programming
#94Earlier quoted context omitted.
Can you elaborate? It can't express every mathematical set operation, but it does have UNION, EXCEPT, and INTERSECT.
What they're saying is: The relational data model and algebra are based on set semantics. Relations (equivalent of SQL's "tables") are sets of sets (tuples), not bags of "rows". There's no such thing or possibility as duplicate tuples ("rows" of "columns"). This has a number of elegant properties (and also improves the kinds of optimizations a query planner / execution stage can apply.) A similar divergence is that t…
Very cogent.
Re: Rethinking Database Programming
#95Re: Rethinking Database Programming
#96By now I stopped counting the attempts to replace SQL. There is a lot of valid critic for SQL and I would be very happy if some things would have been designed different. OTOH the architecture and mathematics behind relational databases are simple, composable and stood the test of time more than most other designs, methodologies or approaches to software development. Though SQL can be improved, even with my average S…
SQL is based on the relational model but doesn't really conform to the mathematics e.g. doesn't exhibit set semantics.
Re: Rethinking Database Programming
#97Earlier quoted context omitted.
The point is end to end type safety. Whether that is worth the tradeoff of losing direct developer access to the db primitives is another question.
SQL is end to end type safe.
Re: Rethinking Database Programming
#98Earlier quoted context omitted.
SQL has one flaw: The verb should come last. So, "FROM users WHERE id = 1 DELETE" or "FROM users WHERE email = 'foo@example.com' SELECT id". That'd cut back on some accidental "oops I dropped the whole table" because I submitted a delete query before writing the where clause. Other than that, it's perfect, no notes.
The part that has stood the test of time and genuinely seems to carve reality at the seams is the query part. The data definition and data manipulation parts are just ok.
Re: Rethinking Database Programming
#99Earlier quoted context omitted.
SQL is end to end type safe.
Only backend to database. This is talking about typesafe from database - backend - frontend.
Instead of using all the consistencies provided in the database process - including types, but also date/time, constraints, transactions, triggers etc. you are exiting the system and losing all guarantees.
This system also doesn’t solve that problem.
Re: Rethinking Database Programming
#100Earlier quoted context omitted.
Can you elaborate? It can't express every mathematical set operation, but it does have UNION, EXCEPT, and INTERSECT.
What they're saying is: The relational data model and algebra are based on set semantics. Relations (equivalent of SQL's "tables") are sets of sets (tuples), not bags of "rows". There's no such thing or possibility as duplicate tuples ("rows" of "columns"). This has a number of elegant properties (and also improves the kinds of optimizations a query planner / execution stage can apply.) A similar divergence is that t…