Structured Query Language is a domain-specific language used to manage data, especially in a relational database management system.It allows users to delete,update,insert and retrive data.
Store Data: Organize data in tables.
Retrieve Data: Fetch specific records using queries.
Update Data: Modify existing records.
Delete Data: Remove unnecessary records.
Manage Permissions: Control user access to the database.
SQL Fiddle – For testing SQL queries online
DB Fiddle – Supports multiple SQL dialects
Mode Analytics – For data analysis using SQL
W3Schools SQL Tryit Editor – For basic SQL practice
Create a Table:
CREATE TABLE Students (
ID INT PRIMARY KEY,
Name VARCHAR(50),
Age INT
);
Insert Data:
sql
INSERT INTO Students (ID, Name, Age) VALUES (1, 'John', 14);
Retrieve Data:
SELECT * FROM Students;
Update Data:
UPDATE Students SET Age = 15 WHERE ID = 1;
Delete Data:
DELETE FROM Students WHERE ID = 1;
Returns only the rows where there is a match in both tables.
Example:
SELECT customers.id, customers.name, orders.order_id
FROM customers
INNER JOIN orders ON customers.id = orders.customer_id;
Returns all rows from the left table, and matching rows from the right table. If there's no match, NULL is returned for the right table's columns.
Example:
SELECT customers.id, customers.name, orders.order_id
FROM customers
LEFT JOIN orders ON customers.id = orders.customer_id;