Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*I did all my own research for this */
- CREATE TABLE programmers(
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- company TEXT,
- name TEXT
- );
- CREATE TABLE software(
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- name TEXT,
- programmer_id INTEGER
- );
- INSERT INTO programmers (name, company) VALUES ('Steve Jobs', 'Apple');
- INSERT INTO programmers (name, company) VALUES ('Steve Wozniak', 'Apple');
- INSERT INTO programmers (name, company) VALUES ('Bill Gates', 'Microsoft');
- INSERT INTO programmers (name, company) VALUES ('Paul Allen', 'Microsoft');
- INSERT INTO programmers (name, company) VALUES ('Larry Page', 'Google');
- INSERT INTO programmers (name, company) VALUES ('Sergey Brin', 'Google');
- INSERT INTO programmers (name, company) VALUES ('Bjarne Stroustrup', null);
- INSERT INTO programmers (name, company) VALUES ('James Gosling', 'Oracle');
- INSERT INTO programmers (name, company) VALUES ('Guido van Rossum', 'Dropbox');
- INSERT INTO programmers (name, company) VALUES ('Tim Berners-Lee', 'World Wide Web Consortium');
- INSERT INTO programmers (name, company) VALUES ('Rasmus Lerdorf', null);
- INSERT INTO programmers (name, company) VALUES ('Donald D. Chamberlin', 'IBM');
- INSERT INTO programmers (name, company) VALUES ('Raymond F. Boyce', 'IBM');
- INSERT INTO programmers (name, company) VALUES ('Brendan Eich', null);
- INSERT INTO programmers (name, company) VALUES ('Mark Zuckerberg', null);
- INSERT INTO software (name, programmer_id) VALUES ('Macintosh', 1);
- INSERT INTO software (name, programmer_id) VALUES ('Mac OSX', 2);
- INSERT INTO software (name, programmer_id) VALUES ('Windows', 3);
- INSERT INTO software (name, programmer_id) VALUES ('Microsoft Products', 4);
- INSERT INTO software (name, programmer_id) VALUES ('Google', 5);
- INSERT INTO software (name, programmer_id) VALUES ('Google Products', 6);
- INSERT INTO software (name, programmer_id) VALUES ('C++', 7);
- INSERT INTO software (name, programmer_id) VALUES ('Java', 8);
- INSERT INTO software (name, programmer_id) VALUES ('Python', 9);
- INSERT INTO software (name, programmer_id) VALUES ('HTML', 10);
- INSERT INTO software (name, programmer_id) VALUES ('PHP', 11);
- INSERT INTO software (name, programmer_id) VALUES ('SQL', 12);
- INSERT INTO software (name, programmer_id) VALUES ('SQL', 13);
- INSERT INTO software (name, programmer_id) VALUES ('JavaScript', 14);
- INSERT INTO software (name, programmer_id) VALUES ('Facebook', 15);
- SELECT programmers.name AS "Name", programmers.company AS "Company",
- software.name AS "Product" FROM programmers
- LEFT OUTER JOIN software
- ON software.programmer_id = programmers.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement