Jul 12, 2024
UPDATE student SET major = 'Bio' WHERE major = 'Biology'
DELETE FROM student WHERE student_id = 5
SELECT * FROM student
(Retrieves all records)SELECT name FROM student WHERE major = 'Biology'
SELECT * FROM student ORDER BY name ASC
SELECT * FROM student LIMIT 5
SELECT DISTINCT major FROM student
SELECT COUNT(*) FROM student
SELECT AVG(salary) FROM employee
SELECT SUM(salary) FROM employee
SELECT sex, COUNT(*) FROM employee GROUP BY sex
%
(any number of characters), _
(single character)
SELECT * FROM client WHERE client_name LIKE '%LLC'
SELECT first_name FROM employee UNION SELECT branch_name FROM branch
SELECT employee.name, branch.name FROM employee INNER JOIN branch ON employee.branch_id = branch.branch_id
SELECT * FROM employee WHERE emp_id IN (SELECT emp_id FROM works_with WHERE total_sales > 30000)