1. Please explain what is a NULL value?

A field with a NULL value is a field with no value. A NULL value is different from a zero value or a field that contains spaces. A field with a NULL value is one that has been left blank during record creation. Assume, there is a field in a table is optional and it is possible to insert a record without adding a value to the optional field then the field will be saved with a NULL value.

2. Tell us how to Test for NULL Values?

A field with a NULL value is a field with no value. NULL value cannot be compared with other NULL values. Hence, It is not possible to test for NULL values with comparison operators, such as =, <, or <>. For this, we have to use the IS NULL and IS NOT NULL operators.

3. Tell me what are the advantages of Views?

Some of the advantages of Views are

☛ Views occupy no space
☛ Views are used to simply retrieve the results of complicated queries that need to be executed often.
☛ Views are used to restrict access to the database or to hide data complexity.

4. Tell me what is the difference between NULL value, Zero, and Blank space?

As I mentioned earlier, Null value is field with no value which is different from zero value and blank space.
Null value is a field with no value.
Zero is a number
Blank space is the value we provide. The ASCII value of space is CHAR(32).

5. Explain me what is the difference between Rename and Alias?

‘Rename' is a permanent name given to a table or column
‘Alias' is a temporary name given to a table or column.

6. Tell me can a table contain multiple PRIMARY KEY's?

The short answer is no, a table is not allowed to contain multiple primary keys but it allows to have one composite primary key consisting of two or more columns.

7. Tell us what is an Index?

An index is used to speed up the performance of queries. It makes faster retrieval of data from the table. The index can be created on one column or a group of columns.

8. Can you tell me the ACID properties and explain?

Following are the four properties of ACID. These guarantees that the database transactions are processed reliably.

☛ Atomicity
☛ Consistency
☛ Isolation
☛ Durability

9. Tell us what are the different DML commands in SQL?

DML commands are used for managing data present in the database.

☛ SELECT: To select specific data from a database
☛ INSERT: To insert new records into a table
☛ UPDATE: To update existing records
☛ DELETE: To delete existing records from a table

10. Explain me what is Stored procedure?

A Stored Procedure is a collection of SQL statements that have been created and stored in the database to perform a particular task. The stored procedure accepts input parameters and processes them and returns a single value such as a number or text value or a result set (set of rows).

Download Interview PDF