4 ms·
SQL does not have type inference. It's dynamically typed, and will break at runtime if you feed the wrong type into something. It probably is strongly typed,
by dllthomas 6y ago
SQL does not have type inference. It's dynamically typed, and will break at runtime if you feed the wrong type into something. It probably is strongly typed, depending where you draw that line.
It also sometimes has side effects, although that's more dialect specific than present in the standard I think (when it comes to DML).
- jeffdavis 6y agoI'm sure there are some counterexamples, but for the most part most SQL implementations will fail to compile a query if you try to add a string to an integer or take the average of a date column. So I'm not quite sure what you mean. And type inference also plays a role with CASE statements, UNION, etc. Again may depend on SQL implementation.
- dllthomas 6y agoHmm, I'm not sure of the details, but I very much remember encountering type errors based on what data path was taken. Playing around now I think the typical case is more as you described. I might revisit when I'm better rested.