Giter Site home page Giter Site logo

dg-message-board-sql's Introduction

sql_conversion_assignment

Given the mongo delete lecture activity, convert the mongo-based addPerson ajax call to use the Postgres database. You’ll need to get PSQL running on your computer, set up a new database and create a table for the people as such:

CREATE TABLE people
(
  id serial NOT NULL,
  name character varying(255) NOT NULL,
  location character varying(255) NOT NULL,
  age integer,
  CONSTRAINT people_pkey PRIMARY KEY (id)
);
  1. Add 2 new fields (using the ALTER command or using PgAdmin) to the people table to store the spirit animal as a varchar(255) and address as varchar(255).
  2. In order to use these columns, you'll have to update the form and client app.js to append these to the DOM.

NOTE: The "/data" get route is already updated to select fields with SQL for you. You’ll need to update the SELECT command to work with the new fields, however.

#HARD MODE Convert the Delete route to Postgres using the correct SQL command. You’ll have to change the _id in index.html to id and make sure the DOM has the correct id from your database for each person.

#PRO MODE Create a get “/find” route that takes a name and runs a SELECT command, using SQL’s LIKE feature to find similar names.

dg-message-board-sql's People

Contributors

dgamberg avatar kdszafranski avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.