Engineering Questions with Answers - Multiple Choice Questions
Home » MCQs » Computer Science » MCQs on Null Values Operations
MCQs on Null Values Operations
A _____ indicates an absent value that may exist but be unknown or that may not exist at all.
a) Empty tuple
b) New value
c) Null value
d) Old value
View Answer
Answer: c
Explanation: None.
If the attribute phone number is included in the relation all the values need not be entered into the phone number column. This type of entry is given as
a) 0
b) –
c) Null
d) Empty space
View Answer
Answer: c
Explanation: Null is used to represent the absence of a value.
The predicate in a where clause can involve Boolean operations such as and. The result of true and unknown is_______ false and unknown is _____ while unknown and unknown is _____
a) Unknown, unknown, false
b) True, false, unknown
c) True, unknown, unknown
d) Unknown, false, unknown
View Answer
Answer: d
Explanation: None.
SELECT name FROM instructor WHERE salary IS NOT NULL; Selects
a) Tuples with null value
b) Tuples with no null values
c) Tuples with any salary
d) All of the mentioned
View Answer
Answer: b
Explanation: Not null constraint removes the tpules of null values.
In an employee table to include the attributes whose value always have some value which of the following constraint must be used?
a) Null
b) Not null
c) Unique
d) Distinct
View Answer
Answer: b
Explanation: Not null constraint removes the tuples of null values.
Answer: b
Explanation: Not null constraint removes the tuples of null values.
View Answer
Explanation: Unique is a constraint.
CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL); INSERT INTO employee VALUES (1005,Rach,0); INSERT INTO employee VALUES (1007,Ross, ); INSERT INTO employee VALUES (1002,Joey,335);
Some of these insert statements will produce an error. Identify the statement.
a) Insert into employee values (1005,Rach,0);
b) Insert into employee values (1002,Joey,335);
c) Insert into employee values (1007,Ross, );
d) None of the mentioned
View Answer
Answer: c Explanation: Not null constraint is specified which means sone value (can include 0 also) should be given.
The primary key must be
a) Unique
b) Not null
c) Both Unique and Not null
d) Either Unique or Not null
View Answer
Answer: c
Explanation: Primary key must satisfy unique and not null condition for sure.
You attempt to query the database with this command:
SELECT nvl (100 / quantity, NONE) FROM inventory;
Why does this statement cause an error when QUANTITY values are null?
a) The expression attempts to divide by a null value
b) The data types in the conversion function are incompatible
c) The character string none should be enclosed in single quotes (‘ ‘)
d) A null value used in an expression cannot be converted to an actual value
View Answer
Answer: a
Explanation: The expression attempts to divide by a null value is erroneous in sql.
The result of _____unknown is unknown.
a) Xor
b) Or
c) And
d) Not
View Answer
Answer: d
Explanation: Since unknown does not hold any value the value cannot have a reverse value.