SQL

Stands for "Structured Query Language."

SQL is a query language used to access and modify information in a database. Web developers use SQL to connect websites and web applications to databases, creating dynamic webpages that can display up-to-date information each time they load. SQL is a standard language for database queries, used by many different database management systems like Oracle Database and MySQL.

Websites and web apps use SQL statements to query relational databases, which store data in tables, rows (representing database entries), and columns (for those entries' attributes). For example, an e-commerce website that manages its inventory in a database would store its products in a table — each product as a row and information about each product, like price, size, and color, as columns. When you view an item's webpage, the web server uses a scripting language like PHP to make one or more SQL queries to retrieve that product's information, then includes the results in the HTML page. If that product's price changes in the database, that new information will appear the next time you load that webpage.

An SQL query statement in MySQL Workbench and several rows of results
An SQL query statement in MySQL Workbench and several rows of results

The most common SQL command is SELECT, which retrieves information from a table. It can pull all the information in a table, or only records that meet certain criteria. For example, the following query retrieves all customer records from the specified ZIP code.

SELECT * FROM Customers WHERE Zip='55400';

The query below fetches the price of a particular product:

SELECT Price FROM Products WHERE ProductID=47988;

The UPDATE command changes the information stored in a specified table, row, and column. INSERT INTO creates new records, while DELETE FROM removes a record.

NOTE: If a website's developer does not properly validate user input and control access to their databases, it may be vulnerable to an SQL injection attack. An SQL injection allows an attacker to send malicious SQL statements to a database that would normally not be allowed — for example, retrieving a full list of customer names, addresses, and credit card numbers.

Updated March 16, 2023 by Brian P.

quizTest Your Knowledge

Which version of Windows was the first to center the task bar by default?

A
Windows 7
0%
B
Windows 8
0%
C
Windows 10
0%
D
Windows 11
0%
Correct! Incorrect!     View the Windows 11 definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of SQL on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.