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

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

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

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

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

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

6 - Question

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

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

```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

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

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