Coder Social home page Coder Social logo

amex-w05d01-cheesy-sql's Introduction

psql practice

You know that problem, where there's so many different types of cheeses in your fridge, that you lose track of 'em?!

Yeah, me neither, I've never had that issue. Never. Never, never, ever.

But say we did. To solve this "hypothetical" problem, let's build a psql database that will organize all the cheeses.

Mission

Create a cheeses_db database as a collection to store cheeses. Each document should store a name, color, origin, and stink_level.

Keep track of your commands! Write out your answers in the provided cheeses.sql.

Setup

Work directly in PSQL. Run psql in your terminal.

Exception - Wanna write a seed file for all the cheese info (located in the section below)? Go for it!

Buying Cheese

Add these cheeses to your database:

  • Roquefort, a yellow french cheese with a stink level of 5
  • Epoisses, an orange french cheese with a stink level of 9
  • Charolais, a white french cheese with a stink level of 5
  • Maroilles, a white french cheese with a stink level of 10
  • Durrus, a yellow Irish cheese with a stink level of 2
  • Hooligan, a yellow American cheese with a stink level of 3
  • Teleme, a white american cheese with a stink level of 2
  • Stichelton, a white English cheese with a stink level of 4

Choosing Cheese

Now write PostgreSQL queries to accomplish the following:

  • Find all the cheeses
  • Find all the French cheeses
  • Find all the English cheeses
  • Find all cheeses with a stink level of 2
  • Find all cheeses with a stink level of 10
  • Find all French cheeses with a stink level of 5
  • Find all Irish cheeses with a stink level of 6
  • Find all cheeses with a stink level of at least 4, but no greater than 8.
  • Find all American and English cheeses.
  • Find all cheeses that are not from France.

TIP Stuck? Check the PG documentation!

Restocking Cheese

The cheese game is changing constantly. Let's update our cheeses. Save your queries after you get them working in the command line.

  • Change the stink level of Roquefort to 3
  • Change the color of Teleme to "mauve"
  • Delete the Hooligan cheese
  • Change the stink level of Stichelton to be 7
  • Add the cheese "Monterey Jack", an American cheese with a stink level of 0
  • Delete Durrus
  • Change the stink level of Teleme to be 1
  • Delete Epoisses
  • Change "Monterey Jack" to "Pepper Jack"

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.