Hacker News new | past | comments | ask | show | jobs | submit login

further, afaik there's no assignment nor iteration in SQL. it's not a programming language at all. It's a.. query language.



I'd consider INSERTs and UPDATEs to technically be "assignment", even if they're very different from how other languages do it.

Some SQL dialects do support both traditional variable assignment and iteration for those cases where an iterative/imperative approach makes more sense than trying to shoehorn the problem into something set-based / declarative. Some limit them to stored procedures (e.g. Postgres, and AFAICT Db2), while others allow them pretty much anywhere (e.g. SQL Server / T-SQL).


> further, afaik there's no assignment nor iteration in SQL

That was until CTEs were introduced in SQL:1999

> it's not a programming language at all. It's a.. query language.

The two are not mutually exclusive. SQL is used to tell a computer what to do, and it is very powerful at it: https://www.youtube.com/watch?v=wTPGW1PNy_Y


I tend to lump it in as a "logic programming" language, along with Prolog and Datalog.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: