I've taught over 3500 people to code in person
& nearly a million online
I've been a CTO for hot, VC-funded silicon valley startups twice,
I helped found Hackbright Academy and wrote the curriculum for Galvanize's Web Development Immersive
I wrote the fraud prevention system for 8 of the top 10 banks in the country
and yeah, people still ask me if I'm technical.
Girl Develop It is here to provide affordable and accessible programs to learn software through professional industry mentorship and hands-on instruction.
We have a Code of Conduct here
In Summary:
You'll revisit these!
1. State the specific problem or project
2. Determine the abstract categories of objects related to the specific problem or project
3. Determine the characteristics of those objects
4. Determine the relationships between those objects
5. Write 'em down, & talk to another person to see if they make sense!
What is a party?
Guests
Objects from a party:
Guests
Weddings
House Parties
Fundraisers
Concerts
Meetups
Classes
Which Attributes Apply to Which Event Types?
1. State the specific problem or project
2. Determine the abstract categories of objects related to the specific problem or project
3. Determine the characteristics of those objects
4. Determine the relationships between those objects
5. Write 'em down, & talk to another person to see if they make sense!
Let's be clear on the boundaries of our relationships
Name
Friend
Spouse
Username
Password
How many of each can we have?
One, or Many?
ID | Name | Phone | Zip | |
---|---|---|---|---|
1 | Liz | liz@liz.com | 555-2323 | 94110 |
2 | Pamela | pamela@fox.com | 555-3232 | 94110 |
3 | Ayesugul | ayesugul@yonnet.com | 555-4455 | 94110 |
Relationships
ID | Name | |
---|---|---|
1 | Liz | liz@liz.com |
2 | Pamela | pamela@fox.com |
3 | Ayesugul | ayesugul@yonnet.com |
ID | User_ID | Phone |
---|---|---|
1 | 1 | 555-2323 |
2 | 1 | 555-4612 |
3 | 2 | 555-3232 |
4 | 2 | 555-6187 |
Different Relationships have different characteristics
Users
Following ( a table of relationships)
ID | Username | Verified |
---|---|---|
1 | lizTheDeveloper | false |
2 | gdi | true |
3 | gdisf | false |
ID | Follower | Following | Blocked |
---|---|---|---|
1 | 1 | 2 | false |
2 | 3 | 1 | false |
3 | 1 | 3 | false |
There are lots of different types of relationships
User : Password
User : Email
User : Name
User : Bookmarks
Almost everything you think is a 1:1
There are lots of different types of relationships
Friends : Friends
Projects : Collaborators
Jobs : Applicants
Products : Suppliers : Orders : Customers
Tinder Matches : Tinder Matches
Amazon.com
WorldsWithoutEnd.com
Your guesses about how to structure your data will need to adapt when you start using it
It's ok to change when the volume of data is small
It's still ok to change the model when the volume of data is big, but it is a bigger undertaking
Pick from one of the below problems:
Create a data model by just listing the objects and their attributes
We'll discuss and compare at the end
(write it down and keep it for the next exercise)
1. State the specific problem or project
2. Determine the abstract categories of objects related to the specific problem or project
3. Determine the characteristics of those objects
4. Determine the relationships between those objects
5. Write 'em down, & talk to another person to see if they make sense!
You'll revisit these!
Text and Numbers aren't the same
7 + 6 = 13
"7" + "6" = "76"
Dates aren't Numbers
3/25/19 15:45:00:00 + 1 = ????
1 what? 1 year? 1 day? 1 millisecond?
Keep a cheatsheet handy for your DB
Create your data model from before in Airtable
After you've agreed this is a good data model, let's throw it in QuickDBD
app.quickdatabasediagrams.com
Choose Datatypes from Postgres or MySQL
At the end, hit Export!
You'll revisit these!
Let's Analyze the Schema you produced & Discuss
CREATE TABLE pokemon (
id SERIAL PRIMARY KEY,
name TEXT,
pokedex_number VARCHAR(10),
type1 TEXT,
type2 TEXT
);
Defining A Table
quickdatabasediagrams.com
https://sqlzoo.net/ - Query Datasets with SQL
Happy to give feedback on any data models you might have that you feel are too complex for you to solve for yourself.
Try mocking them up first in quickDBD or AirTable and using them
Next, email me at lizthedeveloper@gmail.com