关系数据库中的空值可以吗? [英] Are nulls in a relational database okay?

查看:223
本文介绍了关系数据库中的空值可以吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种想法,不应该在关系数据库中允许空值。也就是说,表的属性(列)不应该允许空值。来自软件开发背景,我真的不明白这一点。似乎如果null在属性的上下文中是有效的,那么应该被允许。这在Java中非常常见,对象引用通常为null。没有广泛的数据库体验,我想知道我是否在这里缺少一些东西。

There's a school of thought that null values should not be allowed in a relational database. That is, a table's attribute (column) should not allow null values. Coming from a software development background, I really don't understand this. It seems that if null is valid within the context of the attribute, then it should be allowed. This is very common in Java where object references are often null. Not having an extensive database experience, I wonder if I'm missing something here.

推荐答案

空标记是罚款。真的,他们是。

Null markers are fine. Really, they are.

这篇关于关系数据库中的空值可以吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆