Created
September 12, 2018 18:45
-
-
Save mdewey/e5531a01ed98c29cc2ae270baf89edca to your computer and use it in GitHub Desktop.
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
CREATE TABLE books ( | |
id SERIAL PRIMARY KEY, | |
title VARCHAR(100) NOT NULL, | |
primary_author VARCHAR(100) NULL | |
); | |
SELECT * FROM books WHERE title = 'goosebumps' | |
INSERT INTO books(title, author) VALUES | |
('goosebumps', 'R. L. Stine'); | |
INSERT INTO books(title, primary_author) VALUES | |
('animorphs', 'K. A. applegate'); | |
INSERT INTO books(title, primary_author) VALUES | |
('baby sitters club', 'Anne Martin'); | |
UPDATE books SET title = 'Animorphs' WHERE id = 2; | |
ALTER TABLE books ADD COLUMN RATING INT NULL | |
UPDATE books SET rating = 3; | |
INSERT INTO books (title, primary_author, rating) | |
VALUES ('Harry Potter', 'JK Rowling', 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment