7 ms·
It really depends on which RDBMS we are talking about. sqlite is definitely not statically typed. Values in cells can be compared against integers or strings us
by laumars 10y ago
It really depends on which RDBMS we are talking about. sqlite is definitely not statically typed. Values in cells can be compared against integers or strings using any preferred operators. However others relational databases such as Oracle support are strict about data types and even support inlining functions inside SQL (technically it's PL/SQL rather than ANSI SQL) for code reuse exactly like the feature enhancement you were describing.
Most enterprise RDBMSs I wouldn't say we're dynamic; you define your table at the start of your code, Inc storage types (like you would declare global variables in a strictly typed imperative programming language) and you get compile time errors when executing the SQL if the datatypes are mismatched, just like you would in most modern strictly typed languages. The problem people typically raise about SQL is really more a matter of tooling. eg there isn't much in the way of Visual Studio or IntelliJ for SQL. The best I've used is MySQL Workbench but even that is buggy and often crash prone. However most developers generally write code outside of an SQL IDE because they're either inlining their SQL inside another language (eg via paramatised SQL functions in Go, PHP, Java or whatever) or a DB guy so skilled enough to write their SQL outside of an IDE (much like how some functional or imperative language developers use text editors rather than IDEs).