Make it Real Elite — ninth week — SQL Databases
This was a week one of the best weeks on the course. At the beginning, I didn’t think too much on learning SQL databases because I have some experience with NoSQL databases (I thought that SQL databases where more difficult to learn than a NoSQL).
The best way to start with a SQL database is creating a database diagram, making this will help you to find the tables and the data you need before start coding; so, in the moment of start filling the tables with the data, you don’t need to make any change to them (the tables). The main idea behind the diagram is to create all the tables with the columns in each one; create a primary key (in some tables) and connect it with a foreign key on another table. After creating this diagram is easier to make the query to the database because you know the relationships between the tables and the data in each table.
Learning SQL databases was easier that I thought; I found that in some cases the best way to store the information is on a SQL, instead of a NoSQL (before learning this, I thought that NoSQL was the best option).
Queries
I learned how to make some queries; now I can SELECT some specific columns of a table, all the table, INNER JOIN multiples tables to get the information of them, sum a column with and without filters, get the average value of a column with and without filters and much more, this is only the beginning of things that I had learn in this week. Something important that I learned was a database normalization, what does this mean? It is to organize the data in different tables with relationships to reduce the data redundancy.
Thanks to this week I’m starting with a project where I store on the database the users info, their profile info, and other tables related to each user and whit other things that a user can create; using a SQL database was the best way to return the data, using some queries and storing the user id in each row where the user created something, by this way I can retrieve the data I need, only knowing the user id.
