PG Admin Password: welcome
To create a Database: Right click on Databases CreateDatabase
To Create a Table: Right click on SampleQuery Tool
Table is created.
To see the Table: 1) Refresh Sample Database
2) Click SampleClick Schema Click Public Click Tables
Here we can find the table that is created.
3) Right click the Student_table View/Edit DataAll Rows
Table with field names is created successfully.
Exercise: 1
Create a Database ‘Classroom’
Create a table named ‘SQL _class’ with 3 properties Roll_No, Name, SQL_marks
To insert values into the table:
Procedure 1: Single Row without column names specified
Procedure 2: Single Row with column names specified
(Note: This is the case where the student doesn’t have a second name for example)
Procedure 3: Multiple rows
Importing CSV file into Table:
STEP 1: Create one excel file and text file
STEP 2: Place these two files where PostgreSQL is installed (Create a folder by name
COPYDATA in DATA folder and place it)
Excel File Content
Text File Content:
To import CSV file:
To import Text File:
Exercise: 2
Insert 15 students data into SQL_class using insert into command
Import data from csv file to SQL_class to inset data of next 10 students