What is SQL
What is SQL
SQL (Structured Query Language) is a powerful language used for managing and interacting
with relational databases. It is the standard language for accessing and manipulating data
stored in databases such as MySQL, PostgreSQL, SQL Server, SQLite, Oracle, and others.
Used to define, alter, or delete database structures (like tables, schemas, etc.).
Example:
Example:
INSERT INTO Employees (ID, Name, Age, Salary)
VALUES (1, 'Ayush', 25, 50000);
UPDATE Employees
SET Salary = 55000
WHERE ID = 1;
Example:
Example:
Example:
BEGIN;
ROLLBACK TO Salary_Update;
COMMIT;
Query: Show all employees from the IT department earning more than
50,000, sorted by salary in descending order.
SELECT Name, Salary
FROM Employees
WHERE Department = 'IT' AND Salary > 50000
ORDER BY Salary DESC;
Output:
Name Salary
Neha 55000