SQL Interview Questions – Set 06

What is the usage of NVL() function?

The NVL() function is used to convert NULL value to the other value. NVL() function is used in Oracle it is not in SQL and MySQL server.

Instead of NVL() function MySQL have IFNULL() and SQL Server have ISNULL() function.

What are the set operators in SQL?

SQL queries which contain set operations are called compound queries.

Union, Union All, Intersect or Minus operators are the set operators used in the SQL.

What are the usages of SQL?

SQL is responsible for maintaining the relational data and the data structures present in the database.

  • To execute queries against a database
  • To retrieve data from a database
  • To inserts records in a database
  • To updates records in a database
  • To delete records from a database
  • To create new databases
  • To create new tables in a database
  • To create views in a database
  • To perform complex operations on the database.

What is an inconsistent dependency?

Inconsistent dependency refers to the difficulty of accessing particular data as the path to reach the data may be missing or broken. Inconsistent dependency will leads users to search the data in the wrong table which will afterward give the error as an output.

What are tables and fields in the database?

A table is a set of organized data. It has rows and columns. Rows here refers to the tuples which represent the simple data item and columns are the attribute of the data items present in particular row. Columns can categorize as vertical, and Rows are horizontal.

A table contains a specified number of the column called fields but can have any number of rows which is known as the record. So, the columns in the table of the database are known as the fields and they represent the attribute or characteristics of the entity in the record.

Which are the different types of indexes in SQL?

There are three types of Indexes in SQL:

  • Unique Index
  • Clustered Index
  • NonClustered Index
  • Bit-Map index
  • Normal index
  • Composite index
  • B-tree index
  • function based index

What is DBMS?

DBMS stands for Database Management System. This is a program which is used to control them. It is like a File Manager that manages data in a database rather than saving it in file systems.

Database management system is an interface between the database and the user. It makes the data retrieval, data access easier.

Database management system is a software which provides us the power to perform operations such as creation, maintenance and use of a data of the database using a simple query in almost no time.

Without the database management system, it would be far more difficult for the user to access the data of the database.

Is it possible to sort a column using a column alias?

Yes. You can use the column alias in the ORDER BY instead of WHERE clause for sorting.