Ready to build a rock-solid foundation for our Full Stack Job Portal? In part 3 of this series, we're moving from theory to practice by designing our complete database schema.
In this tutorial, you'll learn how to create a professional Entity-Relationship (ER) Diagram from scratch using the Eraser.io tool. We'll map out all our tables (like Users, Jobs, Applications), define the relationships between them (one-to-many, many-to-many), and most importantly, assign the correct MySQL data types for every single field. Choosing the right data type is crucial for data integrity, performance, and storage, and we'll cover key types like VARCHAR, TEXT, INT, DATETIME, and ENUM.
This is a critical step in building any full-stack application. By the end of this video, you'll have a complete database blueprint for our Next.js Job Portal! ------------------------------------------------------------------------ 🚀 Boost Your Skills with these Pre-Requisite Videos:
⌛TIMELINE⏳ 0:00 - Intro to Data Types & ER Diagrams 2:30 - Using the Eraser.io Tool for Database Design 3:00 - Creating a New ER Diagram in Eraser 5:20 - Building an ER Diagram with Code (Text-to-Diagram) 9:10 - Our Final Job Portal ER Diagram 11:00 - How Relationships Work (One-to-Many, etc.) 11:50 - What is an ENUM Data Type? 13:00 - Challenge: Pause and Assign Your Data Types!
Hello, what's up guys? Today is our day 4 on Nexus project, which is called Job Portal.
So far we have seen 3 videos where I told you clearly that we have to do some planning before coding.
After that, we saw that we have to play with the database a little bit.
We did planning and understanding in which we saw all this.
What fields can be there, what tables can be there, we understood that.
In yesterday's video, we understood that if you create fields once,
then it is very important to give data types.
What is its value, what is its importance, I told you in this video.
So finally, in this video, I am going to tell you how to assign data types to the fields you created.
For example, it is important to give int to id.
Give string to title.
In MySQL, string is not a data type.
In string, we have a where, char, char or text.
But here, it is a reserve.
Basically, it is an ORM.
Here, we have given a data type.
It will come a little ahead.
But in description, text.
In text, you can see minimum salary or maximum salary.
What should be its data type?
And what should be the data type of multiple things is very important.
Through this, you can save a lot of your storage.
You can also make sure that the validation is correct.
You can improve the performance.
Just because you assign the correct data type of every field.
So these things are called entity relationships.
Today, I will tell you how to create it.
Which is very important.
Here, you can tell the relations.
If a user becomes an applicant in the future.
Or what is the relation between the two tables.
If someone asks you like this.
Then you can see that it is a one-by-one relationship.
Being a full-stack developer is very important.
Especially before starting a project.
We need to know all these things.
How does it happen? What happens?
And then we go ahead and create an API based on it.
So we have reached here in three videos.
In fact, I told you in yesterday's video.
Now your task will be this.
All the data types that I told you in yesterday's video.
Please write it yourself.
What is there and what is not.
So today I will tell you how you can do this.
At least here is a website.
It is not sponsored.
I will tell you how you can create it.
So guys, now I will tell you how you can create it.
You come to this website.
I will give the link in the description below.
There is no sponsor.
You don't have to click on the link below.
You can search it on Google.
When you do this, log in.
You will get multiple options.
You can see the plus icon here.
You can see something like this for insert.
If you click here,
You will come to this page.
If you click on the Ctrl K page,
You can see a new file.
If you click on it,
A new file will be created like this.
Here you can see a very important thing.
On one side, you can see an untitled file.
The other side is totally empty.
If you click on the document here,
You can see only the document.
You can see only this on the canvas.
Now what will happen here?
You can see the plus icon here.
You can see it very clearly.
You have to click here.
When you click,
You can see so many options.
If you remember, when we used to work in the beginning,
Before creating any project,
We used to make a chart.
We used to make a flow chart.
We used to make it like that.
We have to create it here.
If you click here,
You can see the diagram as code.
If you write the code, your diagram will be created automatically.
If you click here,
You can see so many options.
You can see flow chart, cloud architecture,
Entity relationship.
You can make a sequence here.
We have to create entity relationships.
If you click here,
The moment you create it,
You can see it automatically.
If you see here,
The code is written on the right-hand side.
If you write something here,
You can see the entity relationship.
When I was doing my masters,
I had this.
When I was doing my bachelors, I had this.
This is very important.
If you see here,
If you see carefully,
We have this user over here.
If you want to make a user entity relationship,
You can see the user here.
here you can see only users
see here
if you see here
how it will be written
you can do it on your own
with notebook
but I thought to show you
a new way
many people use this
for example, I want to create a table of users
so I will write users
and then we have this square bracket
where you can see
this is your key, this is your value
means in our table
which icon do you want
I said I want user icon
and then
the table you are creating
entity relationship
which color do you want
I said I want blue color
you are passing key value pair
then we have this curly braces
here very easily
like we have id
so what can be an id
first of all id is string
in our case we will keep it as int
pk means
your primary key
finally we will finish it
it will be ready
but at least I want to show you
how you can create a table
display name is string
but we know that
I don't need any of these
so I have user with user icon
and here you can see blue background color
I again
right click here
open editor
not right click
open editor
in our case
user
we have a name
as soon as I wrote name
automatic option came
it has to be
varchar
100
and obviously
id
you can unsigned
like this
I told you
unsigned means
no negative value
I wrote 100
then
here user name
it can be common
user name is
everyone's own name
like insta
it is user name
I will do varchar
if you want
you can write
any value
like this
unique
you can see
no semicolon
then
password
what will you do
put varchar
and 255 is more than enough
password can be hash
it is more than enough
if you put simple text
we don't write
simple text
we write hash tag
then your email will come
put varchar
I don't think
more than 100
you can put 255
then we have
a role
I am writing
I am creating
an enum
and assign it
I have passed it
role is done
phone number
many of you will write int
you don't have to
phone number can be
plus special character
like plus 91
you can write
we can't write
in int
it is a variable character
I guess it will be fine
many more
email verified
when was it verified
verified
it is a part
I know
it can be changed
it can be updated
always go with timestamp
it is perfect
created at
updated
update
it will be in timestamp
see
whatever you are writing
it is a table
how beautiful it is
see
it is going up and down
see
how beautiful it is
it is so easy
if you keep it
when you create schema
for our database
it is so easy
we can
create it step by step
we have created it
we are putting
data type
I can see it
it works like this
if I show you final
it will look like this
I have written
don't worry
it is written for drizzle
I have written it for mysql
basically data type of mysql
it works like this
we can write it like this
if I click anywhere
we have open code editor
it will be same
I have told you
how it is an application
where you can
diagrams
if you know
which tables
which fields
or which data type
you have to assign
you can do it easily
throughout this course
if you know me
I have tried my best
from starting
when we make a full stack project
how we tackle it
I am making it for beginners
so that you know
what you are going to make
what you need
it is important to know all these
I am doing it
I have shown you how you can create it
and finally
tomorrow I will tell you
the relationship
don't worry
you have to do only this
only this
with user id
one to one
but why
what is the meaning of one to one
what is the meaning of one to many
I will tell you tomorrow
we will jump on code
we will create schema
we will connect with database
many things are going to happen
but if you do it yourself
you will feel good
I have mentioned
data type of job portal
this is
real fun
one last thing
this role part
I have used enum
enum means
I want to give multiple options
our user role
will be either admin
or applicant
or employer
one of these three
how will I know
what is it
if it is more than 2
we use enum
with help of which we can tackle
yes this is applicant
or admin
or employer
this is how we create enum
and you saw
we read data type
we prepared file
this is a proud moment
for you
please
if you have not assigned
data type
and finally tomorrow
I will share this file
so you can check
what was going to happen
and what was not
you can pause the video
and understand
what I have written
if you missed something
you can see
data type is for drizzle ORM
not for mysql
you can see
rest fields name
you can see
this is it for today
I am very happy
we are moving forward
we are working together
please share with your friends
and tell me
what you felt
I am very happy
if you like the video
please like
and share with your friends
next target is 8 lakh subscribers
see you in next video
till then guys thank you so much
take care