-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMySQLWeek1CodingAssignment.sql
More file actions
23 lines (15 loc) · 949 Bytes
/
Copy pathMySQLWeek1CodingAssignment.sql
File metadata and controls
23 lines (15 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SELECT * FROM employees;
SELECT * FROM employees WHERE birth_date < '1965-01-01';
SELECT * FROM employees WHERE gender = 'F' AND year(hire_date) > '1990';
SELECT * FROM employees WHERE last_name LIKE 'F%' LIMIT 50;
INSERT INTO employees (emp_no, birth_date, first_name, last_name, gender, hire_date) VALUES (100, '1993-08-15', 'DeShonn', 'Mody', 'M', '2018-03-15');
INSERT INTO employees (emp_no, birth_date, first_name, last_name, gender, hire_date) VALUES (101, '1993-08-28', 'Cassandra', 'Chama', 'F', '2018-05-15');
INSERT INTO employees (emp_no, birth_date, first_name, last_name, gender, hire_date) VALUES (102, '2019-05-22', 'Alina', 'Faye', 'F', '2021-12-25');
UPDATE employees
SET first_name = 'Bob'
WHERE emp_no = 10023;
UPDATE employees
SET hire_date = '2002-01-01'
WHERE first_name LIKE 'P%' OR last_name LIKE 'P%';
DELETE FROM employees WHERE emp_no < 10000;
DELETE FROM employees WHERE emp_no IN (10048, 10099, 10234, 20089);