What is SQL?

SQL is a database language which is use for accessing various types of relational databases. The full form of SQL is Structured Query Language.

Accessing a database means, performing an SQL operation on database to manipulate and define the data. You can insert, update and delete the data from the database using SQL queries, this process is know as manipulation of database.

SQL was first developed at IBM in the 1970s with Oracle as a major contributor. Learn more about SQL History.

Many enhancements was happened to make SQL more powerful and hence, It is one of the most useful database language in today's world.

It has its own commands, statements, keywords and functions etc. All these are used to make a SQL query to perform on the database to get the desired result. Database returns the result in tabular format, it is also known as result sets.

You must also understand the concept of Data, Database and Relational Database, explained as below.

What is Data?

Data is a collection of information on particular topic. For example, Information about students, teachers, school etc. These are actual data that has to be stored somewhere, either you can stored in a pieces of paper or you can stored in the database.

Storing data in the database is easy, effective and anytime accessible from anywhere.

What is Database?

A database is a collection of tables, views and stored procedures. It is a storage platform where you can save the data in a structured format.

A database is an organized collection of structured information, or data in the form of table.

A database is usually controlled by a database management system (DBMS).

Data within the databases is typically modeled in rows and columns in a series of tables to make processing and data querying efficient.

The data can then be easily accessed, managed, modified, updated, controlled, and organized using SQL.

Most databases use structured query language (SQL) for writing and querying data.

What is Relational Database?

A relational database is a collection of tables and each table is having relation with other tables using primary key and foreign key concept. The relational databases are Oracle, MySQL, MS SQL Server, PostgreSQL, IBM DB2 and MongoDB etc.

All these databases provide a user-friendly platform to write queries to access databases using SQL language.

MySQL and PostgreSQL are open source databases, you can download it from the official website and use it for practicing.

One thing you should remember that all these databases having their own data types and functions. Hence, you have to be very careful while writing a query. For example, MySQL supports the LIMIT clause to select a limited number of records, while Oracle uses ROWNUM.

Interaction of SQL query with Database

Following diagram explains how SQL query interact with database and how database return the output in tabular format to user.

Importance of SQL in today's world

The SQL plays a vital role in database technologies because of it's powerful built-in commands, statements, keywords and functions etc. It is a kind of medium, through which you can talk with the databases easily.

SQL is very to easy learn and understand and hence it is been used by many people since long time.

Most of the people who work in IT industries, they must have good knowledge of SQL. Because while working on projects, many times they deal with database systems. If they know SQL, it would be easy for them to manage their work.

If you are also looking for a good career in the IT industry, you should start learning SQL and practicing the SQL queries.

Which operations SQL can perform?

  • The most important operation of SQL is to run queries against a database.
  • Retrieve the records from the database
  • Insert records in the database
  • Update the record in the database
  • Delete the record from the database
  • Creation of new databases
  • Creation of tables, stored procedures and views in a database
  • Set permissions on tables, procedures, and views

Important SQL commands or statements

  • SELECT is used for retrieving data from the database
  • INSERT is used for storing the data in tables
  • UPDATE and DELETE are used for manipulating databases
  • CREATE DATABASE is used to create a database
  • CREATE TABLE is used to create a table
  • GRANT and REVOKE are used to set permissions on databases, tables, procedures, and views

Guidelines to follow while writing SQL query

SQL is case insensitive language that means you can write a query in a small as well as capital letters. But for best practices, keywords should be in capital and expressions should be in small letters.

SQL statements also include the semicolon(;) at the end of the query. Also, it automatically ignores the white space in the query.

SQL Query Examples

1) Select query to retrieve all the records from the student table.

select query to retrieve data

2) Select query with where clause, to retrieve all the records from the student table where student division is B.

select query with where condition
Previous Post Next Post

Contact Form