SQL Important Commands
Here is the list of some important SQL Commands:
Commands |
Descriptions |
---|---|
SELECT |
Used to retrieve data from a database. |
INSERT |
Adds new records or rows to a table. |
UPDATE |
Modifies existing records in a table. |
DELETE |
Removes records from a table. |
CREATE TABLE |
Creates a new table in the database. |
ALTER TABLE |
Modifies an existing table structure. |
DROP TABLE |
Deletes a table from the database. |
CREATE INDEX |
Creates an index on a table column to speed up data retrieval. |
DROP INDEX |
Removes an index from a table. |
CREATE VIEW |
Creates a virtual table based on the result of a SQL statement. |
DROP VIEW |
Deletes a view from the database. |
INSERT INTO SELECT |
Inserts data from one table into another based on a query. |
TRUNCATE TABLE |
Removes all records from a table, but keeps the table structure intact. |
ALTER TABLE ADD CONSTRAINT |
Adds a constraint to a table after it has been created. |
GRANT |
Gives specific privileges to database users. |
REVOKE |
Removes specific privileges from database users. |
COMMIT |
Saves all changes made since the last commit. |
ROLLBACK |
Discards all changes made since the last commit. |
BEGIN TRANSACTION |
Starts a new transaction. |
SET TRANSACTION |
Sets characteristics for the transaction. |
SQL Tutorial
In this SQL tutorial, you’ll learn all the basic to advanced SQL concepts like SQL queries, SQL join, SQL injection, SQL insert, and creating tables in SQL. SQL is easy to learn, there are no prerequisites to learning SQL.
So, SQL is a standard database language used to access and manipulate data in databases. SQL stands for Structured Query Language. It was developed by IBM Computer Scientists in the 1970s. By executing queries SQL can create, update, delete, and retrieve data in databases like MySQL, Oracle, PostgreSQL, etc. Overall, SQL is a query language that communicates with databases.
What is a Database?
Before deep diving into this free SQL tutorial, let’s understand what a database is.
So, data is the new fuel of this world, but data is unorganized information, so to organize that data, we make a database. A database is an organized collection of structured data, usually controlled by a database management system (DBMS). Databases help us easily store, access, and manipulate data held on a computer.