answersLogoWhite

0

Why null values in database?

Updated: 8/11/2023
User Avatar

Wiki User

13y ago

Best Answer

The 'null'-content of any given field is just that. It's a 'nothing'. Example, if you create a database to hold chemical values for instance. If the values are, for example, real nubers. That would imply that any value that has 0 in it, is just that; zero. It was beeing measured, and found to contain zero. On the other hand if a value was not tested, the value of that compound should be set to 'null'. If a 'null' value isn't supported by the database a workaround is to set 'null' values to -1 (as per the example above). --

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

It might mean 'no data' or 'not applicable' (for example: wedding date for unmarried people). Some systems (Oracle) treat empty strings as null values, too.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why null values in database?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the three interpretations for null values?

In a database it can be 'not known' or 'not applicable'.


Can you insert primary key only to one field in the database?

Yes. Primary key can be inserted to one field in the database. The field should be unique and not null.


What is meant by a mandatory field?

a mandatory field in a database is one created in a table as "Not null". This means, there is a "rule" on the field that when data is inserted into the table, this field cannot be empty. If it is, then the insert errors. Here's part of a table definition in my database. These field are are required to be populated when inserting into this table. ATTR_DESC_01 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_02 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_03 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_04 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_05 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_06 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_07 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_08 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_09 CHAR(2) DEFAULT SYSTEM NOT NULL, ATTR_DESC_10 CHAR(2) DEFAULT SYSTEM NOT NULL, PARTITION_NBR SMALLINT NO DEFAULT NOT NULL)


Null in programming?

in Russian Null means zero. in some languages Null is a macro for zero. in others Null is a single-tone object which referes to the value Null and thus could be compared to other values. Null has many names from nill Nill nil in diffrent languages. most of the time, Null is used to indicate, no value is set to a variable.


If null is compared with null what is the result-true or false or null or unknown?

You mean SQL? NULL = anything IS NULL NULL <> anything IS NULL ... NULL IS NULL = TRUE NULL IS NOT NULL = FALSE

Related questions

What are the three interpretations for null values?

In a database it can be 'not known' or 'not applicable'.


Does foreign key alllows null values and duplicate values?

A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.A foreign can have null values and it can have duplicate values.


What are the various reasons that lead to the occurrence of NULL values in relations?

A given field in a database table might be for a values that, in certain case, no such values exist or can be determined. For example, in an employee database, a field might be a foreign key to that employee's direct manager. However, in the case of the CEO, there is no such person. In that case, the field would be set to Null.


What is a Null Value and when are Null values used?

In a database, there is a difference between an empty field and one whose value is undetermined. For example, an employee database might have value constraints defined that check any entry into a date field be a valid date. If one such field was for termination date, it couldn't be left blank because that's not a valid date but no valid date exists as yet. In such a case, setting the field to Null solves the problem.


Can You insert a row containing a null attribute value using SQL?

You cannot do it, if the column is not null in the table. Assuming you have a table TBL with columns a, b, c insert into TBL (a, b, c) values ('AAA', null, 'BBB') Now, the value null would be stored in the database for the column 'b'


What group function can be used to perform a count that includes NULL values?

You can not group a NULL value natively. You can however transform the NULL into so other unique value; dynamically, without writing this value to the database; and group by this. You would accomplish this by implementing a coalesce T-SQL expression For example lets say the MiddleName field is NULL in many cases and you want to to group by these.. You might want to turn this NULL into say an * for purposes of giving a value that you can group by. Now you can group by all MiddleName entries and also use a where clause to excluded those values <> * giving you a sub grouping of those records ONLY having null. The SQL command would look something like this: SELECT coalesce(MiddleName, '*') FROM YourTableNameHere WHERE MiddleName LIKE '*' GROUP BY MiddleName The coalesce returns the first NON NULL value in the chain(you can have more than two values). In the above example you will get the MiddleName if there is one and an * if the database value is NULL. This is a SELECT so there is NO update to the database.


What is key constraints?

Primary Key is a Constraint Used to avoid Duplicate entries in database table and you define primary key the column doesn't allow NULL values.


Can a foreign key be null?

yes .a foreign key can have null values


What is primary key constraint?

Primary Key is a Constraint Used to avoid Duplicate entries in database table and you define primary key the column doesn't allow NULL values.


Have foreign keys null values?

Yes Foreign key can have null value.


Can you update view database?

View update is possible when: Views are created from a single base table using the primary key and columns with NOT NULL constraint and without using default values.


What are field can be used as primary key?

A field or set a of fields Êin a database tableÊwith unique values Êcan be used as a primary key.ÊPrimary key field cannot have a null value.