TristanDeAugustine / Assignments

0 stars 0 forks source link

Postgres #28

Open TristanDeAugustine opened 4 years ago

TristanDeAugustine commented 4 years ago

+----------+--------+--------+---------+ | Schema | Name | Type | Owner | |----------+--------+--------+---------| +----------+--------+--------+---------+ SELECT 0 Time: 0.035s postgres@(none):postgres> CREATE TABLE (Employees) syntax error at or near "(" LINE 1: CREATE TABLE (Employees) ^

Time: 0.003s postgres@(none):postgres> \dt +----------+--------+--------+---------+ | Schema | Name | Type | Owner | |----------+--------+--------+---------| +----------+--------+--------+---------+ SELECT 0 Time: 0.030s postgres@(none):postgres> CREATE TABLE Employees(Full_Name TEXT, Salary INTEGER, Job_Position TEXT, Phone_Extension INT EGER, Part_Time BOOL syntax error at end of input LINE 1: ..., Job_Position TEXT, Phone_Extension INTEGER, Part_Time BOOL ^

Time: 0.003s postgres@(none):postgres> CREATE TABLE Employees(Full_Name TEXT, Salary INTEGER, Job_Position TEXT, Phone_Extension INT EGER, Part_Time BOOL); CREATE TABLE Time: 0.019s postgres@(none):postgres> \DT syntax error at or near "\" LINE 1: \DT ^

Time: 0.002s postgres@(none):postgres> \dt +----------+-----------+--------+----------+ | Schema | Name | Type | Owner | |----------+-----------+--------+----------| | public | employees | table | postgres | +----------+-----------+--------+----------+ SELECT 1 Time: 0.032s postgres@(none):postgres> SELECT * FROM employees; +-------------+----------+----------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-------------+----------+----------------+-------------------+-------------| +-------------+----------+----------------+-------------------+-------------+ SELECT 0 Time: 0.030s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Stephen_Gacio, 5000, 'CTO', 941-123-4567, false); syntax error at or near "CTO" LINE 1: ...tension, part_time) VALUES('Stephen_Gacio, 5000, 'CTO', 941-... ^

Time: 0.003s postgres@(none):postgres> SELECT FROM employees; +-------------+----------+----------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-------------+----------+----------------+-------------------+-------------| +-------------+----------+----------------+-------------------+-------------+ SELECT 0 Time: 0.032s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Stephen_Gacio', 5000, 'CTO', 941-123-4567, false); INSERT 0 1 Time: 0.005s postgres@(none):postgres> SELECT FROM employees; +---------------+----------+----------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |---------------+----------+----------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | +---------------+----------+----------------+-------------------+-------------+ SELECT 1 Time: 0.032s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Albert_Strange', 4600, 'Model', 941-234-6789, false); INSERT 0 1 Time: 0.004s postgres@(none):postgres> SELECT FROM employees; +----------------+----------+----------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |----------------+----------+----------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | +----------------+----------+----------------+-------------------+-------------+ SELECT 2 Time: 0.031s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Rick_Ortiz', 6800, 'Stripper', 941-567-2901, true); INSERT 0 1 Time: 0.003s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Nick_Weber', 3200, 'Plug', 941-967-8008, false); INSERT 0 1 Time: 0.013s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Chris_Something', 10000, 'Soundcloud', 941-876-6969, false); INSERT 0 1 Time: 0.008s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+----------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+----------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | +-----------------+----------+----------------+-------------------+-------------+ SELECT 5 Time: 0.034s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Chris_Something', 10000, 'Soundcloud', 941-876-6969, false); postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+----------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+----------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | +-----------------+----------+----------------+-------------------+-------------+ SELECT 5 Time: 0.034s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Future_Drake', 450, 'Software Developer', 941-201-9563, true); INSERT 0 1 Time: 0.008s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 6 Time: 0.034s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Chef', , 'Cook', 941-420-6969, true); syntax error at or near "," LINE 1: ...ition, phone_extension, part_time) VALUES('Chef', , 'Cook', ... ^

Time: 0.003s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Chef', 200 , 'Cook', 941-420-6969, true); INSERT 0 1 Time: 0.003s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | | Chef | 200 | Cook | -6448 | True | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 7 Time: 0.036s postgres@(none):postgres> UPDATE employees SET salary= 500 WHERE job_position= 'Cook'; UPDATE 1 Time: 0.004s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | | Chef | 500 | Cook | -6448 | True | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 7 Time: 0.038s postgres@(none):postgres> INSERT INTO employees (full_name, salary, job_position, phone_extension, part_time) VALUES('Lazy Lynn', 800 , 'lazy', 941-946-9876, false); INSERT 0 1 Time: 0.013s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | | Chef | 500 | Cook | -6448 | True | | Lazy Lynn | 800 | lazy | -9881 | False | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 8 Time: 0.035s postgres@(none):postgres> DELETE FROM employees WHERE full_name='Lzzy Lynn'; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! syntax error at or near "" LINE 1: DELETE FROM employees WHERE full_name='Lzzy Lynn' ^

Time: 0.004s postgres@(none):postgres> DELETE FROM employees WHERE full_name='Lzzy Lynn'; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! DELETE 0 Time: 0.001s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | | Chef | 500 | Cook | -6448 | True | | Lazy Lynn | 800 | lazy | -9881 | False | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 8 Time: 0.050s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | | Chef | 500 | Cook | -6448 | True | | Lazy Lynn | 800 | lazy | -9881 | False | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 8 Time: 0.049s postgres@(none):postgres> \ syntax error at or near "\" LINE 1: \ ^

Time: 0.002s postgres@(none):postgres> \ syntax error at or near "\" LINE 1: \ ^

Time: 0.002s postgres@(none):postgres> SELECT * FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | | Chef | 500 | Cook | -6448 | True | | Lazy Lynn | 800 | lazy | -9881 | False | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 8 Time: 0.040s postgres@(none):postgres> DELETE FROM employees WHERE full_name='Lzzy Lynn'; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! DELETE 0 Time: 0.001s postgres@(none):postgres> DELETE FROM employees WHERE; full_name='Lzzy Lynn'; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! syntax error at end of input LINE 1: DELETE FROM employees WHERE ^

Time: 0.003s postgres@(none):postgres> DELETE FROM employees WHERE full_name ='Lazy Lynn'; You're about to run a destructive command. Do you want to proceed? (y/n): y Your call! DELETE 1 Time: 0.002s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | True | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Future_Drake | 450 | Software Developer | -8823 | True | | Chef | 500 | Cook | -6448 | True | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 7 Time: 0.035s postgres@(none):postgres> UPDATE employees SET part_time = false WHERE part_time = true; UPDATE 3 Time: 0.007s postgres@(none):postgres> SELECT FROM employees; +-----------------+----------+--------------------+-------------------+-------------+ | full_name | salary | job_position | phone_extension | part_time | |-----------------+----------+--------------------+-------------------+-------------| | Stephen_Gacio | 5000 | CTO | -3749 | False | | Albert_Strange | 4600 | Model | -6082 | False | | Nick_Weber | 3200 | Plug | -8034 | False | | Chris_Something | 10000 | Soundcloud | -6904 | False | | Rick_Ortiz | 6800 | Stripper | -2527 | False | | Future_Drake | 450 | Software Developer | -8823 | False | | Chef | 500 | Cook | -6448 | False | +-----------------+----------+--------------------+-------------------+-------------+ SELECT 7 Time: 0.035s postgres@(none):postgres> UPDATE employees SET part_time = false WHERE part_time = true