PostgreSQL - SPLessons

PostgreSQL Create Table

Chapter 8

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

PostgreSQL Create Table

PostgreSQL Create Table

shape Description

PostgreSQL Create Table can be created using pgAdmin3. And these pgAdmin is a graphical interface, that provides the user to easily understand and  to access the database features conveniently.

PostgreSQL Create Table Database Example

shape Description

By viewing the below steps of PostgreSQL Create Table, the concept of creating a table into the postgreSQL database can be easily understand.

shape Step - 1

In postgreSQL, a database by name SQLDB has been created.

shape Step - 2

For creating PostgreSQL Create Table, expand SQLDB and it display a list of collections.

shape Step - 3

From the collections expand schemas and it will display public collections.

shape Step - 4

Expand public it will display public related collections.

shape Step - 5

Right click on tables and select New Tables.

shape Step - 6

And mention the New Table name as Employee.

shape Step - 7

Click on columns and click Add button for inserting new columns names.

shape Step - 8

Creating the first column as emp_id with datatype as integer. And click on Ok button.

shape Step - 9

Column name emp_id as been successfully inserted and click on Add button for adding another column name.

shape Step - 10

Creating the second column as name with datatype as character varying. And click on Ok button.

shape Step - 11

Column name Name as been successfully inserted and click on Add button for adding another column name.

shape Step - 12

Creating the third column as Age with datatype as integer. And click on Ok button.

shape Step - 13

Column name Age as been successfully inserted and click on Add button for adding another column name Or click on Ok button then it will display all the three column names of the tables.

shape Step - 14

Table name employee as been successfully created.

shape Step - 15

Expand Tables then employee table will get displayed.

shape Step - 16

Expand employee then list of collections will get displayed.

shape Step - 17

Expand columns then the column names get displayed.

shape Step - 18

Right click on Employee table and select scripts followed by Insert script.

shape Step - 19

Inserting first employee values and click on execute the query.

shape Step - 20

Inserting second employee values and click on execute the query.

shape Step - 21

Inserting third employee values and click on execute the query.

shape Step - 22

Again right click on Employee table, and select View Data followed by View Top 100 Rows.

shape Step - 23

Then it will display all the column values like emp_id, Name and Age of all employees.

Summary

shape Key Points

  • PostgreSQL Creating the tables – Means creating a new table in the database server.
  • PostgreSQL Creating the tables – Can also be performed in command prompt.