News for hackers. Stuff that matters.
Re:SQL is syntactic sugar for relational algebra by Mutjake on Saturday March 23, 2024 @10:19AM (#39800101)
Well, to be fair ”from foo delete” would do the same I suppose :-D Unless there’d be an explicit end to the statement to designate you really want to delete everything. Which might not be a bad idea. Or make ”where …” mandatory and bring in ”delete_all” or ”delete everything from foo” as a syntactic guardrail. This is equally implementable, whichever the order of ”delete” and ”from” would be.
Re:SQL is syntactic sugar for relational algebra by Izkata on Saturday March 23, 2024 @02:22PM (#39802002)
The MySQL client has an --i-am-a-dummy flag that won't let you run a DELETE (or UPDATE, I think) without a WHERE.
Re:SQL is syntactic sugar for relational algebra by bbqq on Sunday March 24, 2024 @12:40AM (#39805204)
the Google SQL variant has where required for deletes. on my first encounter of it I was just like "huh, neat", you can always use 1=1 as the predicate if needed.