In this tutorial, you will going to look at what is meant by SQL, its History, why we use SQL to communicate with RDBMS, SQL Syntax, and SQL internal processes.
Those who are new to SQ L world wondering right now what is SQL!.. Right? Let’s see..!
What is SQL?
SQL stands for Structured Query Language. It is mainly used to access, manipulate and store data in the Relational Database Management System (RDBMS).
Basically, SQL language is used to communicate with Database, similar to how we use human language to communicate with other person.
SQL Syntax: (SELECT Statemen example)
Basically, SQL language is used to communicate with Database, similar to how we use human language to communicate with other person.
SQL Syntax: (SELECT Statemen example)
SELECT -- select clause column_name FROM -- from clause table_name WHERE -- where clause condition;
Some people pronounce it as 'SEQUAL' and some others pronounce it as 'S-Q-L'. But SQL was initially pronounced as 'SEQUAL' only because it was known as Structured English Query Language. Later, the name 'SEQUAL' was changed to
'SQL'
because it was a trademark of a UK-based Engineering company.Refer to the comparison code to understand why SQL is an English-like language.
Sample Java code to check prime number
public static void main(String[] args) { int num = 29; boolean flag = false; for (int i = 2; i <= num / 2; ++i) { if (num % i == 0) { flag = true; break; } } if (!flag) System.out.println(num + " is a prime number."); else System.out.println(num + " is not a prime number."); } }
Sample SQL code to check prime number
with number_table as (select level as inputnum from dual connect by level <= 10) select decode(mod(inputnum,2),0, inputnum || ' is a prime number' ,inputnum || ' is not primenumber') from number_table;
Why SQL?
- It allows to access and manipulate the data.
- Allows to manage data in a database effectively.
- It allows to create database objects like tables, indexes, views, materialized views, global temporary tables, sequences, etc..,
- It can store data securely by providing necessary permissions to database objects accordingly.
History of SQL
- In the early 1970s, Edgar F.codd developed a relational model for databases at IBM.
- In 1974, SEQUAL was developed at IBM by Donald D.chamberlin and Raymond F.Boyce.
- Relational software Inc (Oracle Corporation), released the first RBBMS and made it available to US government agencies in 1979.