• +91 9723535972
  • info@interviewmaterial.com

Database Interview Questions and Answers

Database Interview Questions and Answers

Question - 21 : - What is SQL?

Answer - 21 : - Structured Query language, SQL is an ANSI(American National Standard Institute) standard programming language that is designed specifically for storing and managing the data in the relational database management system (RDBMS) using all kinds of data operations.

Question - 22 : - Enlist some commands of DDL, DML, and DCL.

Answer - 22 : -

Data Definition Language (DDL) commands:

  • CREATE to create a new table or database.
  • ALTER for alteration.
  • TRUNCATE to delete data from the table.
  • DROP to drop a table.
  • RENAME to rename a table.
Data Manipulation Language (DML) commands:

  • INSERT to insert a new row.
  • UPDATE to update an existing row.
  • DELETE to delete a row.
  • MERGE for merging two rows or two tables.
Data Control Language (DCL) commands:

  • COMMIT to permanently save.
  • ROLLBACK to undo the change.
  • SAVEPOINT to save temporarily.

Question - 23 : - What do you understand by Functional dependency?

Answer - 23 : -

A relation is said to be in functional dependency when one attribute uniquely defines another attribute.

For Example, R is a Relation, X and Y are two attributes. T1 and T2 are two tuples. Then,

T1[X]=T2[X] and T1[Y]=T2[Y]

Means, the value of component X uniquely define the value of component Y.

Also, X->Y means Y is functionally dependent on X.

Question - 24 : - What are the advantages and disadvantages of views in the database?

Answer - 24 : -

Advantages of Views:

  1. As there is no physical location where the data in the view is stored, it generates output without wasting resources.
  2. Data access is restricted as it does not allow commands like insertion, updation, and deletion.
Disadvantages of Views:

  1. The view becomes irrelevant if we drop a table related to that view.
  2. Much memory space is occupied when the view is created for large tables.

Question - 25 : - Define the relationship between ‘View’ and ‘Data Independence’.

Answer - 25 : -

View is a virtual table that does not have its data on its own rather the data is defined from one or more underlying base tables.

Views account for logical data independence as the growth and restructuring of base tables are not reflected in views.

Question - 26 : - What do you understand by Data Independence? What are its two types?

Answer - 26 : -

Data Independence refers to the ability to modify the schema definition in one level in such a way that it does not affect the schema definition in the next higher level.

The 2 types of Data Independence are:

  • Physical Data Independence: It modifies the schema at the physical level without affecting the schema at the conceptual level.
  • Logical Data Independence: It modifies the schema at the conceptual level without affecting or causing changes in the schema at the view level.

Question - 27 : - Explain the terms ‘Record’, ‘Field’ and ‘Table’ in terms of database.

Answer - 27 : -

Record: Record is a collection of values or fields of a specific entity. For Example, An employee, Salary account, etc.

Field: A field refers to an area within a record that is reserved for specific data. For Example, Employee ID.

Table: Table is the collection of records of specific types. For Example, the Employee table is a collection of records related to all the employees.

Question - 28 : - Enlist the advantages of SQL.

Answer - 28 : -

Advantages of SQL are:

  • Simple SQL queries can be used to retrieve a large amount of data from the database very quickly and efficiently.
  • SQL is easy to learn and almost every DBMS supports SQL.
  • It is easier to manage the database using SQL as no large amount of coding is required.

Question - 29 : - What is DDL interpreter?

Answer - 29 : - DDL Interpreter interprets the DDL statements and records the generated statements in the table containing metadata.

Question - 30 : - Define DML Compiler.

Answer - 30 : - DML compiler translates DML statements in a query language into a low-level instruction and the generated instruction can be understood by Query Evaluation Engine.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners