0:00
Hi friends, welcome to tutors funny
0:02
channel. In our last video I explained
0:05
how to how to install the postgsql. In
0:09
this video I'm going to teach how to
0:14
and tables. So the first I'm going to
0:18
have a look at the console base. So I'm
0:20
going to go to so we have two ways to uh
0:24
create the tables. First one is a
0:26
console base another way is a GI base.
0:28
Okay. So first you have to look at the
0:31
SQL. We have typed the SQL. You can see
0:34
here SQL cell. Psql mean is nothing but
0:38
the postsql start short formats of psql.
0:43
Click on it. Here the local
0:46
that's our now here where I'm going to
0:50
configure the server. So server is a
0:53
local host mean our current machine
0:54
localiz. Okay. No need to do anything
0:57
else. Press enter key. Database we have
1:01
it automatically comes as a port ch.
1:04
Press enter key. Port is a default port
1:05
is a default port. Press enter key.
1:07
Username. I haven't given any user name.
1:10
Keep uh press enter key. Password. What
1:13
is the password you gave while
1:15
installing? Give the password 1 2 3.
1:17
Press enter key. Here we are. Here we
1:20
have created the database. So you have
1:21
to create the database. You have to
1:22
press tap key on your keyboard and type
1:26
uh letter as capital. Create a tab base.
1:31
Here I'm going to database. You have to
1:32
create as a of the cap block and type as
1:36
simple. I'm going to type the uh
1:39
database which is a super
1:49
post like that. So here I'm making this
1:54
column. Okay. Here I'm making the post
1:57
for the supermarket you are imaging. So
2:00
I'm creating the database for super.
2:02
What is the business you are going on
2:04
doing? Based on the business you are
2:07
doing the databases. Okay. So you can
2:10
press enter key. Your database has been
2:13
created. Success message. Inside the
2:15
database we have created the table. So
2:17
table creation you go inside the
2:19
database. You have to save.
2:21
Okay. The command you have type this
2:23
database which does super
2:36
Okay. Press enter key. Now you are
2:39
connected to database supermarket post
2:41
as a user here. Now you go inside here.
2:45
Now inside here if you are not
2:47
implemented this one it is not go inside
2:50
this one. So you go yeah you have
2:52
created the database. So inside the
2:54
database you are going to create the
2:56
table. So how to go inside the database
2:59
you have to write okay / C okay go
3:03
inside the database you create the
3:04
database name. So now you are connected
3:06
to the database. This database you
3:08
connected as a post okay as a user. So
3:11
now here I'm going to create the table.
3:13
So table also the creation this one I
3:17
paste it how to create the table create
3:19
table products inside the supermarket
3:23
I'm going to create the products table
3:26
products these are the products ID
3:28
products name and products private
3:32
press enter key now the table creation
3:35
also done the simple process to we have
3:38
to achieve the database and table using
3:42
command command command line cell we are
3:45
called as command line or cell okay this
3:48
is the first way you have to get in done
3:50
by the creating the tables as well so
3:53
next process we are going to do the GI
3:58
now let's open the GUI
4:04
here this is the our install pgr click
4:11
now the dashboard is opening load. Wait.
4:20
Right. It's loaded successfully. Now
4:22
this is our PG admin. So here you can
4:28
Okay. So okay here you will be able to
4:29
see that is the database you currently
4:31
created on CLI. It's there you here
4:35
supermarket cost. This is the data we
4:37
are created by the using CL command
4:42
prompt which nothing but a CL uh command
4:45
prompt which is nothing but a GI okay so
4:50
there is a view so that you can see that
4:52
uh schema there is a field the table is
4:55
resided resided here this a table the
4:58
table which will be created products
5:00
okay so now I'm going to go to create
5:02
the tables database so how to create the
5:04
database of uh uh GUI select the
5:08
database right click create database
5:12
you have to specify the name of the
5:13
database so I'm going to create this
5:25
demo so okay so I have given that this
5:28
is I created by GUI CLI this is a GUI
5:33
application just yet you can create any
5:35
I just get this like this. Okay. Now
5:44
Congrats. Here you have successfully
5:46
created the database which is a
5:50
supermarket demo. Okay. So now inside
5:54
the database I'm going to what I'm going
5:55
to do is I'm going to get the table. So
5:57
inside the database you go to the schema
6:01
schemas. Inside the schema we have a
6:03
table option. Click on it
6:11
here. This is a table. So there's no
6:13
tables. We can't expand. Right click
6:16
create tables. Now we have to create a
6:19
table name which is I'm going to create
6:25
Click columns. What are the columns you
6:27
have to going to create? So click add
6:33
ID? you with ID column data type I'm
6:36
going to create as a integer
6:42
say integer if if you if you want you
6:45
can specify the length can write if you
6:47
want to specify the length here the not
6:53
okay necessary things are not null and
6:55
primary you define the primary ID for
6:58
the ID column so product description
7:03
You have to write that text. Oh, watch
7:07
out. Okay. So, third one, I'm going to
7:13
price of the product. It should be the
7:20
uh can write uh uh this one should be
7:34
So this how we have done it done the all
7:38
the products related columns are
7:40
created. Hit save button.
7:44
Now the products columns are
7:46
successfully created.
7:48
Okay, here the columns are successfully
7:50
created. This how we have done the
7:53
things well. Okay, I hope guys you
7:56
understood the things well. How to
7:58
create the uh database and table using
8:01
CLI as well as a GI. Thanks for