You are on page 1of 8

Database engine presentation documentation guide

A. coverage
A.1 database engine
A.2 group members

I General Information

1.1 What 1.1 definition


1.2 advantages
1.3 disadvantages
1.2 when - timeline
1.3 where 1.3.1 Places of origin
1.3.2 Industry application of database engine
1.4 who - persons or company who developed
1.5 why - reason for development
1.6 How - it works
1.6.1 System requirements
1.6.1.1 Hardware requirements
1.6.1.2 OS/software requirements

2. Installation of PostgreSQL
2.1 Download Site
PostGIS is an extension to the PostgreSQL relation database management system.
This section will first walk through the installation of PostgreSQL and then PostGIS
on a Windows XP environment using the provided installer. The latest PostgreSQL
installer can be downloaded from http://www.postgresql.org/download/windows
2.2 Installation

1st Step - In the directory C:\Download\PostGIS\software\ you will find the


PostgreSQL installer, called postgresql-9.4.4-windows.exe. Double click to
execute.
2nd Step - Enjoy the warm welcome, courtesy of Enterprise DB, then click Next.

3rd Step - In the event that you want to install PostgreSQL application binaries into
a non-standard directory, enter the path here. For the purposes of this workshop we
will use the default. Click Next.

4th Step - The directory where PostgreSQL data will reside can also be installed into
a non-standard directory. This is especially useful to drop your data on a RAID
array. We have no such hardware, so we will be using the default path. Click Next.

5th Step - Enter a password for the newly-created postgres superuser account.
Remember this password! We will use the password postgres in our examples, so
we will recommend you use this as well

6th Step - This is your opportunity to enter a non-standard port for PostgreSQL. For
our purposes we will accept the default (5432) and click Next.

7th Step - The Default Locale option will reflect the locale (location) setting of the
host operating system and is sufficient for this workshop. Uncheck the option that
says Install pl/pgsql in template1 database. Click Next.

8th Step - And now were ready to go. Click Next...

9th Step - ...and wait for the installation to complete.

10th Sleep - Ensure that the Launch Stack Builder at exit? Option is selected, then
click Finish.

3. GUI
3.1 Screenshots
3.2 creating database and table
3.3 altering table

3.4 inserting, updating, deleting data


3.5 creating queries
4. CLI
4.1 what is CLI?
A CLI (command line interface) is a user interface to a computer's operating system or an application in
which the user responds to a visual prompt by typing in a command on a specified line, receives a
response back from the system, and then enters another command, and so forth.

4.2 how to use postgresql in command line interface


After you open your command line, type psql U postgres h localhost
4.3 encountered errors.
You may encounter an error stating that psql not recognized as an internal
or external command.
That is a common problem because when you install postgres, the path is not
directly recognized by your computer. In order to fix this you must do this
steps.
My computer(right click)
Advance system settings(left side)
Environment values
Search path(click edit)
Insert the folder location of postgresql (eg. C:\Program
Files\PostgreSQL\9.4\bin;C:\Program Files\PostgreSQL\9.4\lib)
After that you are now using postgres inside cmd but a new error might occur (this happens to
some) stating 'more' is not recognized as an internal or external command, operable program or
batch file.
The problem here is that the file more in system32 is not connected to
postgres so you just have to go to Advance system settings and edit path
again just add C:\Windows\System32; C:\Program
Files\PostgreSQL\9.4\bin;C:\Program Files\PostgreSQL\9.4\lib)
After that you are good to go. You can now completely use postgres in command
line without interference(except for making a lot of errors that pisses you off).

4.2 creating database and table


Create Database AdmissionSlip;
\l
\c AdmissionSlip;
Create Schema Slip;
Create Table Slip.Applicant( "ApplicantID" integer NOT NULL, "StudentName"
text,StudentNumber text, "Course" text, CONSTRAINT "pk_ApplicantID" PRIMARY KEY
("ApplicantID"));
\d Slip.Applicant;
Select * from Slip.Applicant;

4.3 altering table


ADD COLUMN - This form adds a new column to the table.
DROP COLUMN [IF EXISTS] - This form drops a column from a table. Indexes and table constraints
involving the column will be automatically dropped as well.
SET DATA TYPE - This form changes the type of a column of a table.
SET/DROP NOT NULL - These forms change whether a column is marked to allow null values or to
reject null values.
RENAME the RENAME forms change the name of a table (or an index, sequence, or view) or the
name of an individual column in a table. There is no effect on the stored data.
SET SCHEMA - This form moves the table into another schema. Associated indexes, constraints, and
sequences owned by table columns are moved as well.

4.4 inserting, updating, deleting data


Insert into Slip.Applicant values( same as what we did in mysql.) but in here there is an
alternative and easier way.
4.5 creating queries
SELECT * FROM slip."Admission", slip."Applicant", slip."Category", slip."Evaluation",
slip."Requirements" WHERE "Applicant"."ApplicantID" = "Admission"."ApplicantID" AND
"Category"."CategoryID" = "Admission"."CategoryID" AND "Evaluation"."EvaluationID" =
"Admission"."EvaluationID" AND "Requirements"."RequirementsID" = "Admission"."RequirementsID"
ORDER BY "Applicant"."StudentName" ASC, "Applicant"."Course" ASC, "Category"."Category"
ASC, "Evaluation"."EvaluatedBy:" ASC, "Evaluation"."DateAmittedBy:"
ASC,"Evaluation"."Checkedby:" ASC, "Evaluation"."DateChecked" ASC,
"Requirements"."Credentials" ASC;

You might also like