Loading...

Interview Questions


What is Database?


A database is an organized collection of data, stored and retrieved digitally from a remote or local computer system. Databases can be vast and complex, and such databases are developed using fixed design and modeling approaches.

 

What is SQL?


SQL stands for Structured Query Language. It is the standard language for relational database management systems. It is especially useful in handling organized data comprised of entities (variables) and relations between different entities of the data

What is the difference between SQL and MySQL?


SQL is a standard language for retrieving and manipulating structured databases. On the contrary, MySQL is a relational database management system, like SQL Server, Oracle or IBM DB2, that is used to manage SQL databases.

What are Joins in SQL?


Join in SQL  is used to combine rows from two or more tables based on a related column between them. There are various types of Joins that can be used to retrieve data, and it depends on the relationship between tables.

There are four types of Joins:

  • Inner Join
  • Left Join
  • Right Join
  • Full Join

What are the subsets of SQL?


  • Data Definition Language (DDL)
    DDL queries are made up of SQL commands that can be used to define the structure of the database and modify it.

     

    • CREATE Creates databases, tables, schema, etc.
    • DROP: Drops tables and other database objects
    • DROP COLUMN: Drops a column from any table structure
    • ALTER: Alters the definition of database objects
    • TRUNCATE: Removes tables, views, procedures, and other database objects
    • ADD COLUMN: Adds any column to the table schema
  • Data Manipulation Language (DML)
    These SQL queries are used to manipulate data in a database.

     

    • SELECT INTO: Selects data from one table and inserts it into another
    • INSERT: Inserts data or records into a table
    • UPDATE: Updates the value of any record in the database
    • DELETE: Deletes records from a table
  • Data Control Language (DCL)
    These SQL queries manage the access rights and permission control of the database.

     

    • GRANT: Grants access rights to database objects
    • REVOKE: Withdraws permission from database objects
  • Transaction Control Language (TCL)
    TCL is a set of commands that essentially manages the transactions in a database and the changes made by the DML statements. TCL allows statements to be grouped together into logical transactions. 

     

    • COMMIT: Commits an irreversible transaction, i.e., the previous image of the database prior to the transaction cannot be retrieved
    • ROLLBACK: Reverts the steps in a transaction in case of an error
    • SAVEPOINT: Sets a savepoint in the transaction to which rollback can be executed
    • SET TRANSACTION: Sets the characteristics of the transaction

What are the applications of SQL?


The major applications of SQL include:

  • Writing data integration scripts
  • Setting and running analytical queries
  • Retrieving subsets of information within a database for analytics applications and transaction processing
  • Adding, updating, and deleting rows and columns of data in a database

What is meant by table and field in SQL?


An organized data in the form of rows and columns is said to be a table. Simply put, it is a collection of related data in a table format.

Here rows and columns are referred to as tuples and attributes, and the number of columns in a table is referred to as a field. In the record, fields represent the characteristics and attributes and contain specific information about the data.

What are the subsets of SQL?


The main subsets of SQL are:

  • Data Definition Language (DDL)
  • Data Manipulation Language (DML)
  • Data Control Language (DCL)
  • Transaction Control Language (TCL)

What are the usages of SQL?


The following operations can be performed by using SQL database:

  • Creating new databases
  • Inserting new data
  • Deleting existing data
  • Updating records
  • Retrieving the data
  • Creating and dropping tables
  • Creating functions and views
  • Converting data types

What do you mean by data integrity?


Data integrity is the assurance of accuracy and consistency of data over its whole life cycle. It is a critical aspect of the design, implementation, and usage of systems that store, process, or retrieve data.

Data integrity also defines integrity constraints for enforcing business rules on data when it is entered into a database or application.


Categories ( 117 )