Take the following create table statement:
create table fruit { count int, name varchar(32), size float }
Instead of these specific data types, why not "string", "number", "boolean" or better, without specifying any data types at all.
What are the technical reasons for having these specific data types? (unlike a typical or missing data type)
Imagine 20 million rows in a table with an int column, where all numbers are from 1 to 10.
tinyint, 1 . int, 4 . , 60 .
" " , , , . , , . , , , .
, .
.
MyNumberField : "1234", 13, 35, "1234afgas"
"1234afgas"?
tinyint = 1
smallint = 2
int = 4
bigint = 8
, , , bigint
(char, varchar .. ..)
... A int... ..
, : string, boolean, number. , . , .
, , . , "1" , , 1, "1" ...
"1" , col1 + col2 2 "11"?
, , , SQLite (http://www.sqlite.org/).
, , , , IBM Universe DB (aka Pick). Db , , "".
. ? . x, x. , .
, , , . , N X, , X.
, , , -X X , -Z Z. ( ). .
, , , . , , , .
, , , - 8 , , , . (, nchar (8))
( , ) .
. , . , , , , , .
One of the other core functions of a database is data integrity. The more accurately you specify what data should be stored in the field, the less likely you are to accidentally save incorrect data there. This is similar to why your C compiler is so picky about the code you write: you should prefer to deal with errors at compile time rather than run-time errors.
Source: https://habr.com/ru/post/1729281/More articles:Measure transaction log throughput? - sql-serverDjango / Python: How to start a new process in Python? - pythonDoes Cocotron Objective-C support garbage collection? - cross-platformChanging the location of auto recovery data in SQL Server Management Studio - sql-serverАтрибут заголовка для отключенных элементов в Firefox - javascriptXML in COBOL with nested tables and different children - xmlIterate over a large set of Django requests while data changes elsewhere - pythonNUnit and Log4Net Integration: Log-Based Approval - assertHow to convert yyyy-mm-dd hh: mm: ss to UTC in Perl? - datetimeNHibernate free timeout while batch insertion - nhibernateAll Articles