在我的 MySQL 数据库上,我想使用TINYINT (Unsigned)
?
你会Byte
在 SQL Server 上使用吗?
我正忙于设计一个网站,我需要在我的 SQL Server 数据库中包含以下列:
我已经阅读了有关检查约束的内容,我想知道以下是否可行/以及它是否是上述问题的最佳解决方案:
allocation | tinyint | not null | check constraint: 0-100
year | date | not null | check constraint: year
month | date | not null | check constraint: month
Run Code Online (Sandbox Code Playgroud)
我也会从我的前端进行验证,但我听说在适当的地方设计带有这些限制的数据库是一种很好的做法。