---
# System prepended metadata

title: '2009-GHP-RM-WEB-FT Cookie Jar: SQL, PostgreSQL, Schema Design'

---

# 2009-GHP-RM-WEB-FT Cookie Jar: SQL, PostgreSQL, Schema Design

Put your question in a '##' tag below

Example:

## What is JavaScript?

## if we decide to use postico, we don't need psql?

## Answer

Yup! Postico will act as our interface to the PostgreSQL database. Keep it installed, though.

## Some notes on Normalization

- [Wikipedia](https://en.wikipedia.org/wiki/First_normal_form)
- [Pre-reading: Relational DB Schema Overview](https://medium.com/@kimtnguyen/relational-database-schema-design-overview-70e447ff66f9)

Reference from the Wikipedia Article:

**First normal form** enforces these criteria:
- Eliminate repeating groups in individual tables
    - This includes every column have one value instead of multiple
- Create a separate table for each set of related data
    - From our Pokémon example:
        - We technically can (in PostgreSQL) have another field inside the Team table that is an array of members but this violates first normal form. Note: This would be a way of doing it a Document (NoSQL) DB.

In addition, you adhere to this rule by emphasizing one-to-many and many-to-many relationships

Referencing the Medium Article:

**Second normal form** enforces these criteria:
- Satisfies first normal form
- All the other non-key columns depends on the primary key. If the column can "exist" without the PK, then it's a likely a candidate to be somewhere else in some other table and/or we may need to redefine relationships
    - Tweaked example from the article:
        - If we had a table with ProductID (Primary Key), ProductName, OrderNumber, how would we "describe" this table just by looking at the columns? It would be difficult to describe since it may seem like it's dealing with products but all of the sudden there's an OrderNumber in here. Product Name depends on ProductID but OrderNumber doesn't.

**Third normal form** enforces these criteria:
- Satisfies second normal form
- All the non-key columns are independent of each other. Ignorning the primary key, the non-key columns can exist by themselves. 
    - Example from the Medium article is great 

## Does a program like Photoshop use a Schema design like social media platforms? Thinking in terms of it's editing capabilities.

## Answer

I'm pretty sure any software goes through a Schema Design process. It does depend on what databases they use. If they use relational, then they probably have some sort of ERD somewhere. Even if it's non-relational, they probably have some sort document that notes all the entities. 

Anyway, Schema design is about the process of thinking about what kind of data we needand how they relate to each other before we start creating and inserting into tables. 

In terms of photoshop, though, that could very well be a very complicated schema!
