SQL QUERIES

0
489
sql
sql

SQL QUERIES

SQL queries are the most common and essential SQL operations. Through an SQL query, you can search the database for a required information.

SQL Queries are executed with the “SELECT” statement. An SQL query can be more specific with the help of many clauses:

FROM- Indicates this table where it will be searched on.

WHERE – This is used to define rows, which will be searched in. All the rows for which WHERE clause is not true will be excluded.

ORDER BY – This is the only way to sort the result in SQL otherwise, they will return to a random order.

example of sql

SELECT * FROM

WHERE active

ORDER BY LastNme, FirstNme

Some of the most important SQL commands-

SELECT – extract data from the database.

UPDATE – Updates the data in the database.

DELETE – Deletes data from the database.

INSERT INTO – Injects new data to the database.

CREATE DATABASE – Creates a new database.

ALTER DATABASE – Modifies the database.

CREATE TABLE – Creates a new table.

ALTER TABLE – Tables modification

DROP TABLE – Deletes the table.

CREATE INDEX – creates an index (search key)

DROP INDEX – Deletes the index.

LEAVE A REPLY

Please enter your comment!
Please enter your name here