Skip to content

Instantly share code, notes, and snippets.

@StPeteFrank
Last active December 13, 2018 14:52
Show Gist options
  • Save StPeteFrank/054bbe7a017e39c8464c7e575f0dc602 to your computer and use it in GitHub Desktop.
Save StPeteFrank/054bbe7a017e39c8464c7e575f0dc602 to your computer and use it in GitHub Desktop.
createdb CompanyDatabase
pgcli CompanyDatabase
CREATE TABLE Employees (Id INT, FullName TEXT, Salary INT, Department TEXT, PhoneExtension INT, IsPartTime BOOLEAN);
SELECT * FROM employees
SELECT fullname, phoneextension FROM employees WHERE isparttime = false;
INSERT INTO employees (id, fullname, salary, department, phoneextension, isparttime) VALUES (8, 'Gorgeous George', 450, 'software developer', 108, true);
UPDATE employees SET salary=500 WHERE department = 'cook';
DELETE FROM employees WHERE fullname = 'Lazy Lynn';
UPDATE employees SET isparttime=false;
ALTER TABLE employees ADD ParkingSpotNumber VARCHAR(10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment