Database schema and SQL vs NoSQL

Andrea Bizzotto
A free video tutorial from Andrea Bizzotto
Flutter GDE, Developer and Instructor
4.7 instructor rating • 3 courses • 24,971 students

Learn more from the full course

Flutter & Firebase: Build a Complete App for iOS & Android

Learn Dart, Flutter & Firebase by Google, and build a real-world, production ready app

20:46:18 of on-demand video • Updated March 2021

  • Build a complete, real-world app with Flutter & Firebase
  • Write iOS & Android apps with a single codebase
  • Write production-ready code following best practices and become a competent Flutter developer
  • Fast-track your Flutter learning with practical tips and proven techniques
English [Auto] Now that we have listed all the requirements for our application I want to talk about databases because I think that these will be useful to understand what we need to build. So over here I have a diagram which is composed of three main entities and just so you know this diagram is called the schema of the database and it is just a representation of all the various types of entities in the database with their relationships. So the first entity is called user and it represents a user that is signed in without one application and a user can create and manage any number of jobs and we can think of a job as a data model that has four properties a job I.D. and then are you idea which represents the user that created that job and then the job name and the rate per hour then for each job a user can create any number of entries and each entry will have an idea. Job idea which refers to the job and then starts time and an end time and then a comment that explains what the entry is about. In addition to these entities I've added some arrows and these arrows represents the relationships between the and it is in our database. So if we wanted to describe this relationship on the left we could say that a user can have zero to end jobs but a job is always associated to one and only one user. Similarly we can say that a job can have zero to an entries and an entry is always associated to one and only one job. So once again this diagram is called the schema of the database and the schema describes all the entities in the database and their relationships on the other hand down here. I have created a sample snapshot that represents the jobs and entries that we have stored in the database at any one point in time. So here for example I have two jobs called blogging and promotion and these represent the entries that I can see over here just two of them actually. And then I have one entry for Job 1 2 3 which is blogging and then 2 entries for Job 1 2 4 which is promotion. So once again these tables represent a snapshot of the actual data that is in the database. At any point in time. Now if we get back to the list of requirements that we have specified over here we could try to work out how to get the data that we need. Given this database. So for example getting the list of all the jobs is simply a matter of reading out the jobs table that we have down here. However if we wanted to show all the entries for a given job we would have to know what the correct job idea is and then take only the entries that match that job by these and more in general depending on which operation we want to make. We might need to combine together data from different tables in order to get the results that we want and when using relational databases. This is normally accomplished with a language called ask you out which is a domain specific language that is used to query data inside the database. So by writing and executing an appropriate ask you out query on the database we can get the data that we need. OK so this completes my brief overview of our relational databases and relational databases are a very broad topic that could be the subject of an entire course in itself. And the reason I wanted to talk about them here is that in this course we will see how to use fired ways called five store as a database. However cloud 5 there is not a relational database and in fact it is known as a no sequel database. And what this means is that we will need to learn how cloud Firestone can be used to store the data that we need and how it is different from relational databases. But you any Firestone is not a relational database. We will refer back to this diagram because it is a good representation of the data that we want to manipulate. So our job will be not only to learn how to use five story in general but to see how we can represent these entities and relationships in five star. Okay so let's continue on the next video.