HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

SQL Introduction


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

It became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987

What is SQL?


  • SQL stands for Structured Query Language
  • SQL lets you access and manipulate databases
  • SQL is case insensitive. But it is a recommended practice to use keywords (like SELECT, UPDATE, CREATE, etc.) in capital letters and use user-defined keywords (like table name, column name, etc.) in small letters.
  • In different versions of SQL , it support the major commands (such as SELECT, UPDATE, DELETE, INSERT , WHERE ) in a similar manner.

What Can SQL do?


  • SQL can execute queries against a database
  • SQL can retrieve data from a database
  • SQL can create new databases
  • SQL can insert records in a database
  • SQL can update records in a database
  • SQL can create new tables in a database
  • SQL can delete records from a database
  • SQL can create stored procedures in a database
  • SQL can create views in a database
  • SQL can set permissions on tables, procedures, and views

Note:Most of the SQL database programs also have their own proprietary extensions in addition to the
SQL standard!

how to use SQL in Your Website

To make a web site that shows data from a database, you will need:

  • An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
  • To use a server-side scripting language, like PHP or ASP
  • To use SQL to get the data you want
  • To use HTML / CSS to style the page

RDBMS

RDBMS stands for Relational Database Management System.

It is the basis for SQL, MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.

The data in RDBMS is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows.

Every table is broken up into smaller entities called fields.

Example:

SELECT * FROM `employee`;

Output

employee table

In the above "Employee"table:

The fields in the Employee table consist of Employee_id,Employee_name, Address, City, PinCode and Country.
A field is a column that is designed to maintain specific information about every record in the table.

A record, also called a row, is each individual entry that exists in a table. For example, there are 6 records in the above table. A record is a horizontal entity in a table.

A column is a vertical entity in a table that contains all information associated with a specific field in a table.