Sunday, February 24, 2019

syntax - Can I omit the second “is” in “is… and is…”?


What is the correct syntax:



This column is a primary key and null.




or



This column is a primary key and is null.



Should I write is again?



Answer



I would select 'is null' for both English and SQL reasons.


The alternatives are different in nature. I.e., primary key is singular ('a' primary key), but the null attribute is a mass noun. Having 'is' in front of both alternatives helps to highlight this difference.


Additionally, in SQL the syntax used to query a null column is (eg:)



WHERE column_value *IS NULL*

Because of this construct in the language, it will help to identify that you mean 'null' in an SQL sense (ie, has no data) and not necessarily in an English sense - which could mean invalid or wrong.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...