Last active
March 31, 2017 16:28
-
-
Save BenjaminVerble/4f9cd35b158cab1eaba76a0cb4f25b94 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 | |
(author_id varchar(55) PRIMARY KEY, title varchar(55)) | |
; | |
INSERT INTO books | |
('author_id', 'title') | |
VALUES | |
('1asdfasdfasdfasdas', 'How to make your life better'), | |
('asdfasdf23423456gf', 'How to Cook'), | |
('2134dfg45675fa4352', 'Hi, what is your name, I am joe') | |
; | |
CREATE TABLE authors | |
(id varchar(55), author varchar(55)); | |
INSERT INTO authors | |
('id', 'author') | |
VALUES | |
('1asdfasdfasdfasdas', 'John Smith'), | |
('asdfasdf23423456gf', 'Jane Smith'), | |
('2134dfg45675fa4352', 'Joe Sixpack') | |
; | |
UPDATE authors SET author = 'Fran Sixpack' where id = '2134dfg45675fa4352'; | |
SELECT | |
authors.id, books.title, authors.author | |
FROM | |
books | |
JOIN authors ON | |
books.author_id == authors.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment