FULL VIDEO:
STEP #1: DIGITALOCEAN
Go to this link: https://m.do.co/c/1e56c4c455b5 ($100 coupon for 60 days for Digital Ocean)
No-affiliate link (without coupon): https://www.digitalocean.com/
STEP #2: COMMAND LINE (with root user)
adduser tomi
usermod -aG sudo tomi
exit
STEP #3: COMMAND LINE (with new user)
sudo apt-get update
sudo apt-get install mc
sudo apt-get install postgresql postgresql-contrib
sudo -i -u postgres
psql
STEP #4: SQL (with postgres user)
CREATE USER tomi WITH PASSWORD 'my_secret_pw';
\q
exit
STEP #5: SQL (with new user)
psql -U tomi -d postgres
CREATE TABLE test(column1 TEXT, column2 INT); INSERT INTO test VALUES ('Hello', 111); INSERT INTO test VALUES ('World', 222); SELECT * FROM test;
\q
STEP #6: SQL Workbench configurations
echo "listen_addresses = '*'" >> /etc/postgresql/*/main/postgresql.conf
echo 'host all all 0.0.0.0/0 md5' >> /etc/postgresql/*/main/pg_hba.conf
sudo /etc/init.d/postgresql restart
exit
STEP #7: SQL Workbench installation
- Download & install Java8+: https://java.com/en/download
- Download & install SQL Workbench: https://www.sql-workbench.eu/download-archive.html
- Download (but do not install) the driver: https://jdbc.postgresql.org/download.html#current
URL: jdbc:postgresql://138.197.180.215:5432/postgres
STEP #8: Test
SELECT * FROM test;
CREATE TABLE test_results ( name TEXT, student_id INTEGER PRIMARY KEY, birth_date DATE, test_result DECIMAL NOT NULL, grade TEXT NOT NULL, passed BOOLEAN NOT NULL );
INSERT INTO test_results VALUES ('Jesse', 2, '1988-02-11', 74.00, 'C', TRUE), ('Todd', 3, '1987-06-13', 60.00, 'D', TRUE), ('Tuco', 4, '1970-11-11', 15.50, 'F', FALSE), ('Gus', 5, '1975-08-08', 80.00, 'B', TRUE) ;
SELECT * FROM test_results;
LINKS MENTIONED IN THE EPISODE
- Longer, more detailed server installation guide (with Python, pandas, SQL, R, etc.)
- SQL Workbench installation tutorial
- SQL tutorial series
- 7-day SQL course
- Newsletter (+ SQL cheat sheet access)
- If you want to learn more about how to become a data scientist, take my 50-minute video course: How to Become a Data Scientist. (It’s free!)
- Also check out my 6-week online course: The Junior Data Scientist’s First Month video course.
Cheers,
Tomi Mester
Cheers,
Tomi Mester