SQL
1. Introduction

Introduction

SQL is a standard language for storing, manipulating and retrieving data in databases.

Why do we need SQL?

  • To do CRUD operations on databases
  • To create and modify databases
  • To retrieve data from databases
  • To manage databases

What is SQL?

SQL stands for Structured Query Language. It is a standard language for storing, manipulating and retrieving data in databases.

Difference between SQL and MySQL

SQLMySQL
SQL is a standard language for storing, manipulating and retrieving data in databases.MySQL is a database management system that uses SQL.
SQL is a query language.MySQL is a database management system.
SQL is used to perform CRUD operations on databases.MySQL is used to create and modify databases.
SQL is used to retrieve data from databases.MySQL is used to manage databases.

Difference between SQL and NoSQL

SQLNoSQL
SQL databases are relational databases.NoSQL databases are non-relational databases.
SQL databases use structured query language.NoSQL databases use unstructured query language.
SQL databases are table-based databases.NoSQL databases are document-based, key-value pairs, graph databases or wide-column stores.
SQL databases are vertically scalable.NoSQL databases are horizontally scalable.
SQL databases are not suited for hierarchical data storage.NoSQL databases are well suited for hierarchical data storage.

How does SQL work?

SQL works by executing queries on a database. A query is a request for data or information from a database table or combination of tables.

How does SELECT query work in background?

When you execute a SELECT query, the database engine first parses the query and then executes it. The database engine uses the query optimizer to determine the most efficient way to execute the query.

What is query parse?

  • Query parse is a process of breaking down a query into its components.

What is query optimizer?

  • Query optimizer is a part of the database engine that determines the most efficient way to execute a query.

What is query execution plan?

  • Query execution plan is a plan that shows how the database engine will execute a query.