Engineering Questions with Answers - Multiple Choice Questions

MCQs on Null Values Operations

1 - Question

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.




2 - Question

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.




3 - Question

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.




4 - Question

 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.




5 - Question

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.




6 - Question

Answer: b
Explanation: Not null constraint removes the tuples of null values.

View Answer
Answer: d
Explanation: Unique is a constraint.

 




7 - Question

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.






8 - Question

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.




9 - Question

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.




10 - Question

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.

Get weekly updates about new MCQs and other posts by joining 18000+ community of active learners