Skip to content

Instantly share code, notes, and snippets.

@rogerwschmidt
Last active April 12, 2018 16:53
Show Gist options
  • Save rogerwschmidt/905f5043253024a6cee6dd871db2d7a3 to your computer and use it in GitHub Desktop.
Save rogerwschmidt/905f5043253024a6cee6dd871db2d7a3 to your computer and use it in GitHub Desktop.

Installing postgres, DDL, and ERD Instructor Notes

Objectives

  • Install postgres
  • Explain what a Relational Database Management System is and why it is useful
  • List, Create and drop databases
  • Create database tables
  • Explain what Entity Replationship Diagram is, and why it is useful
  • Create an ERD

How do you install Postgress

Gavin -> https://docs.google.com/document/d/1XFplEWPyfZtavL4J5gFSseV2_tNZJcCyc4IDwp3noBQ/edit

Everyone else -> brew install postgres, then brew services start postgresql

Together ->

> createdb test
> git clone  https://github.com/rogerwschmidt/dbtest.git
> npm install
> ./node_modules/.bin/knex migrate:latest

What is a Relational Database Management System? and why is it useful?

  • With your group, create a definiton for RDMS, and establish why someone will use them. If it helps to narrow your answer, think of alternatives that can be used for data persistence.

How do you list, create and drop databases?

  • > psql -l
  • > createdb
  • > dropdb

How do you create a database table?

  • What is the relationship between databases and tables?
  • With your table, create a resource with some properties
  • Create a SQL table given the resource you created.
  • What are primary and foreign keys.

What are Entity Replationship Diagram? and why are they useful?

  • With your group, create a definition for ERD, and establish why someone will use them.

How do you create and ERD

  • As a class, lets create an ERD for twitter (users, tweets, friends)
  • As groups, lets create and ERD for a classroom (instructor, students, cohorts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment