Contents
Structure Query Language (SQL)
Structured Query Language (SQL), in the database, is a sublanguage used in querying, updating, and managing relational databases. It was derived from an IBM research project that created Structured English Query Language (SEQUEL) in the 1970s. SQL is an accepted standard in database products. Although it is not a programming language in the same sense as C or Pascal. SQL can either be used in formulating interactive queries or be embedded in an application as instructions for handling data. The SQL standard also contains components for defining, alerting, controlling, and securing data. SQL is designed for both technical and non-technical users.
Some database system provides a special window or form for creating queries. Because of similar of almost all databases, a common type of query language is developed which are called structured English Query language. The most commonly used command in SQL is the select statements, which is used to retrieve data from tables.
The basic structures of SQL language are as follows.
SELECT field1, field2, … …FROM table-nameWHERE condition
Query from one table
SELECT name, class, roll, secFROM studentWhere sec=’a’
This query shows the name, class, roll, sec from student tables which section is A only.
Query from two tables
SELECT name, subject, marksFROM student, subjectWHERE stid.dtudent=subid.subject
Use of SQL
SQL has the following use for database purposes.
- To create database objects such as relations, indexes, etc.
- To retrieve or extract data from the database which is called querying the database.
- To perform data management tasks such as insertion, modification, and deletion of data from the database.
- To work as a prototype.
- To provide an easy way to learn commands.