

We need to follow the below steps to create a schema: In this, we are going to create a schema in the latest version of pgAdmin. Firstly, open pgAdmin in our local system and connect PostgreSQL to the localhost server.

After that, we will expand the databases by clicking on the down-arrow icon, as shown in the below screenshot. In the above image, we can see that there are two databases available in PostgreSQL. And here, we are taking the first database, which is javatpoint. Now, we will expand the database javatpoint. Once we expand the javatpoint database, we can see the Schemas. After that, for creating a schema, we will right-click on the Schemas option, and then select Create, and then click on schema option from the list. Once we clicked on the schema, the Create-schema window will appear on the screen where we will provide all the necessary details like Name, etc., and click on the Save. The myschema has been created once we clicked on the Save button, as shown in the below screenshot. After executing the above command, we can see the list of schema in the below screenshot.Firstly, we will connect to the javatpoint database, and create a new schema as Jtp with the help of below command. In PostgreSQL, we can create a table in the schema in two different ways: Here we are going to create a table in the particular schema (which we created earlier in this section). Once we clicked on the table option, the Create-Table window will appear on the screen where we will enter all the necessary details like Table name.Now, we will right-click on the Tables option under the myschema, and where we will select the Create option from the given drop-down and then click on the Table as we can see in the below image.Firstly, we are expanding the newly created schema myschema, and we can see the myschema contains the following.And for this we are going to follow the below steps: Once we are done creating the schema in pgAdmin, we are going to create a table in the particular schema. And we can see that the Student table is created under the Table.And then click on Save to complete the process of creating a table as we can see in the below screenshot.And we can select the Data types from the given drop-down list as well as we can change the columns Not-null preference and also set the Primary key.After that, we will move to the Column tab in the same window then click on the + sign to add columns in a particular table.In our case, we will create a table called Student. Now, we will create a table in the psql schema, which we created above.
