Structured Query Language (SQL) is a language used to view or change data in databases. The statements used in this language are called SQL queries.
Basic use of SQL queries is, to:
INSERT data INTO a database,
DELETE data FROM a database,
UPDATE data in a database,
SELECT (extract) data FROM a database.
Examples Edit
This is a simple SQL Query which is used to show all values stored in column named 'my_column' from the data table named 'my_table'.
SELECT my_column FROM my_table;
Here is an example of inserting new information into a table called 'people.' The query first specifies the table as 'people', then the columns in which data is going to be inserted into, and the data that is going into these columns. As a result, data will be added into the columns in the same order the column names are listed in the first brackets: (first_name, last_name, age, favorite_food).
INSERT INTO people (first_name, last_name, age, favorite_food) VALUES ("Bob", "Page", "42", "Hamburgers");
In the example below the columns aren't listed. This would result in an attempt to add the data into the table in the order the values are listed.
INSERT INTO people VALUES ("Bob", "Page", "42", "Hamburgers");
Doing the above (without naming the columns) might result in inputting the data in an incorrect column or the statement might not run correctly - when the value types are mismatched (for example trying to input a word into a column storing only numbers).
Basic use of SQL queries is, to:
INSERT data INTO a database,
DELETE data FROM a database,
UPDATE data in a database,
SELECT (extract) data FROM a database.
Examples Edit
This is a simple SQL Query which is used to show all values stored in column named 'my_column' from the data table named 'my_table'.
SELECT my_column FROM my_table;
Here is an example of inserting new information into a table called 'people.' The query first specifies the table as 'people', then the columns in which data is going to be inserted into, and the data that is going into these columns. As a result, data will be added into the columns in the same order the column names are listed in the first brackets: (first_name, last_name, age, favorite_food).
INSERT INTO people (first_name, last_name, age, favorite_food) VALUES ("Bob", "Page", "42", "Hamburgers");
In the example below the columns aren't listed. This would result in an attempt to add the data into the table in the order the values are listed.
INSERT INTO people VALUES ("Bob", "Page", "42", "Hamburgers");
Doing the above (without naming the columns) might result in inputting the data in an incorrect column or the statement might not run correctly - when the value types are mismatched (for example trying to input a word into a column storing only numbers).
Similar Readings (5 items)
The World Depends on Old Code No One Knows Anymore, and We Need AI To Fix It
Python is coming to Microsoft Excel
7 List Functions Every Python Programmer Should Know
XSLT - simple wikipedia
What is JavaScript and why should I learn it?
Summary
SQL is a language for accessing and manipulating databases. Basic SQL operations include: INSERT, DELETE, UPDATE, SELECT. An example of an INSERT query would be adding data to the 'people' table with columns first_name, last_name, age, and favorite_food. However, it is important to explicitly list
Statistics
244
Words1
Read CountDetails
ID: 61d6cf18-b098-4d63-ac91-373935ed5dbd
Category ID:
URL: https://simple.m.wikipedia.org/wiki/Structured_Query_Language
Created: 2022/01/06 20:14
Updated: 2025/12/09 18:20
Last Read: 2022/01/06 20:17