Created
June 10, 2019 20:07
-
-
Save philkrause/1921d98edb3ba89b7a3cede929a28bb1 to your computer and use it in GitHub Desktop.
Phil Krause - VALUES ('SQL')
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select all columns for all employees // | |
SELECT * FROM employees | |
Select only the Full Name and Phone Extension for only Full Time employees // | |
SELECT full_name, phone_extension FROM employees WHERE part_time = true; | |
Insert a new part time employee, as a software developer, part time, with a salary of 450 // | |
INSERT INTO employees(full_name, salary, job_position, part_time) | |
VALUES('Joe Black', 450, 'software_developer', true); | |
Update all employees that are the cooks to have a salary of 500 // | |
UPDATE employees SET salary = 20000 WHERE job_position = 'Owner'; | |
Delete all employees that have the full name of "Lazy Lynn" // | |
DELETE FROM employees WHERE full_name = ‘Lazy Lynn’ | |
Update all employees to be full time // | |
SELECT FROM employees UPDATE SET part_time = 'false'; | |
Add a column to the table: parking_spot_number as a string that up to 10 characters long // | |
ALTER TABLE employees ADD COLUMN parking_spot_number CHAR(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment