2 2 votes Consider the following database table: Create table test( one integer, two integer, primary key(one), unique(two), check(one>=1 and <=10), check (two>=1 and <=5) ); How many data records/tuples atmost can this table contain? $5$ $10$ $15$ $50$ Databases ugcnetcse-dec2015-paper3 databases sql + – Sanjay Sharma 5.3k views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply prateekdwv commented Jan 1, 2016 reply Follow flag You are right. If values of some attribute are constrained to take only unique values, it is still allowed to take Null value. And more importantly it can take null value mltiple time, since in most of the SQL engine null is not equal to null. 1 1 replyShare Himanshu1 commented Jan 2, 2016 reply Follow flag 10 is correct. 0 0 replyShare Please log in or register to add a comment.
1 1 vote B. 10 should be the correct answer. Reason : As one is primary key and it varies from 1 to 10 , So using one atmost 10 tuples can be there. When we take two into consideration it varies from 1 to 5 and is unique, which implies it can be NULL. Hence the number of tuples will be 10, with two being NULL in five of them. CORRECT ME IF I AM WRONG. Ml_Nlp answered Mar 24, 2017 Ml_Nlp comment Share Follow See all 2 Comments 2 2 Comments reply _Dipak_ commented Apr 1, 2017 reply Follow flag I have a Question: What if 1 to 5 which is Unique is not NULL ? (As in the question it is asked "Atmost") 0 0 replyShare prithvish111 commented Nov 21, 2020 reply Follow flag You are right unique can contain NULL values, but what about check (two>=1 and <=5) this condition? if this condition fails the new tuple will not be created, so I think answer should be A)5 0 0 replyShare Please log in or register to add a comment.