Overview of SQL Commands
These four commands are the foundation of SQL:
SELECT: Retrieve data.
INSERT: Add new data.
UPDATE: Modify existing data.
DELETE: Remove data.
Examples:
SELECT Name, Email FROM users;
INSERT INTO users (Name, Email) VALUES ('Alice', '[email protected]');
UPDATE users SET Email = '[email protected]' WHERE Name = 'Alice';
DELETE FROM users WHERE Name = 'Alice';
Challenge: Practice CRUD Operations
Use a sample products table to:
Add a new product.
Update its price.
Retrieve all products priced above $50.
Delete a product based on its ID.