** Day 15 of Calendar Planning 2020 ** It's been about 3 months since I started studying programming, so I will leave a note of what I learned in the article as an output. I would be happy if I could help anyone entering the world of programming. Please let me know if there are any words that are wrong, wrong, or misunderstood ^^ I'm sorry if it's hard to read the words for a long time. I will do my best to get used to it little by little.
The model is briefly described here
Where to handle application data. It plays a role in processing such as registering, acquiring, updating, and deleting data in the database. For example I think it's an image of managing a huge warehouse called a database. It feels like it retrieves and stores the information you need when you need it.
It is basically an exchange with the DB.
DB is the data storage destination. Thanks to DB, data can be saved and searched efficiently.
Is it the place where the memory card or save data in the game is saved? model is the game console It doesn't come out this time, but Controller is a controller I wonder if the code displayed on the TV screen and the TV will be View! That's the image.
In rails, the data saved in the DB is collected in ** "table" ** and the tables are saved in relation to each other.
The table keeps the data organized, making it easier to retrieve the data.
Isn't it difficult to find the latest one if the past save data is in a mess in the game? In order to eliminate such a thing, it is called a table, so related things are saved in an easy-to-understand manner.
Imagine a blog site.
--Title
Suppose you have this information.
If you try to make these into a table
ID | title | Text | Contributor | Posted date |
---|---|---|---|---|
1 | Nice to meet you | I will start blogging from today | yuta | 12/1 |
2 | Such a sky is amazing | Blue sky this morning | yuta | 12/5 |
3 | Where are you today? | Look at the photo and guess | yuta | 12/9 |
4 | from morning,,, | I work silently | yuta | 12/12 |
I feel like this. It's like Excel! But that's exactly the image! !! By doing this, it's easy to see where and when you posted the title! This is to keep things tidy and easy to understand.
The table also has a name The whole thing is called ** table **. Column: It is called ** column **. Row: Say ** record **.
In rails, ID is automatically generated when a table is created and data is created. What is the record with ID1?
ID | title | Text | Contributor | Posted date |
---|---|---|---|---|
1 | Nice to meet you | I will start blogging from today | yuta | 12/1 |
What are the column names in this table?
ID | title | Text | Contributor | Posted date |
---|---|---|---|---|
It will be this.
What's in the title column?
title |
---|
Nice to meet you |
Such a sky is amazing |
Where are you today? |
from morning,,, |
These are extracted.
Data is exchanged with the DB in the database language (SQL).
To be honest, I remembered that it was difficult at first to understand the column ^^; You can see it here, but what if you actually make it? I was often confused. ^^;
Recommended Posts