November 21, 2024

What is Structured Query Language (SQL) ?

Structured Query Language (SQL) is a language used to view or change data in database. The statements used in this language are called SQL queries.

In Sql programming language so many query are there but basic use of SQL queries is below

1 INSERT INTO Table_Name(column1) VALUES (value1);
2 DELETE Column_Name FROM Table_Name,
3 UPDATE Table_Name SET Column_Name1 = value1 WHERE condition;
4 SELECT * FROM Table_Name,


Examples :




This is a simple SQL Query which is used to show all values stored in column named ‘Column_Name’ from the data table named ‘ Table_Name’,

SELECT Column_Name FROM Table_Name;

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 Table_Name (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 Table_Name 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).



Leave a Reply

Your email address will not be published. Required fields are marked *