Day_2_SQL_Notes
Day_2_SQL_Notes
Syntax:
Example:
Exercise:
- Insert a student with ID 2, named "Bob", aged 21, in the "Junior" grade level.
Syntax:
UPDATE table_name
Example:
UPDATE students
SET age = 21
WHERE student_id = 1;
Exercise:
Syntax:
WHERE condition;
Example:
WHERE student_id = 1;
Exercise:
Example:
Example:
Example:
Exercise:
Example:
Example:
Example:
Exercise:
Example:
SELECT NOW();
Example:
SELECT CURDATE();
Exercise:
author VARCHAR(255),
price DECIMAL(10, 2)
);
VALUES
UPDATE books
WHERE book_id = 3;
WHERE book_id = 2;
SELECT CURDATE();