Category: 3. Postgres SQL

  • INSERT Query

    The PostgreSQL INSERT INTO statement allows one to insert new rows into a table. One can insert a single row at a time or several rows as a result of a query. Syntax You may not need to specify the column(s) name in the SQL query if you are adding values for all the columns of the…

  • Schema

    A schema is a named collection of tables. A schema can also contain views, indexes, sequences, data types, operators, and functions. Schemas are analogous to directories at the operating system level, except that schemas cannot be nested. PostgreSQL statement CREATE SCHEMA creates a schema. Syntax The basic syntax of CREATE SCHEMA is as follows −CREATE SCHEMA name;…

  • CREATE Table

    The PostgreSQL CREATE TABLE statement is used to create a new table in any of the given database. Syntax Basic syntax of CREATE TABLE statement is as follows −CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ….. columnN datatype, PRIMARY KEY( one or more columns ) ); CREATE TABLE is a keyword, telling the…

  • SELECT Database

    This chapter explains various methods of accessing the database. Assume that we have already created a database in our previous chapter. You can select the database using either of the following methods − Database SQL Prompt Assume you have already launched your PostgreSQL client and you have landed at the following SQL prompt −postgres=# OS…

  • CREATE Database

    This chapter discusses about how to create a new database in your PostgreSQL. PostgreSQL provides two ways of creating a new database − Using CREATE DATABASE This command will create a database from PostgreSQL shell prompt, but you should have appropriate privilege to create a database. By default, the new database will be created by…

  • Data Type

    In this chapter, we will discuss about the data types used in PostgreSQL. While creating table, for each column, you specify a data type, i.e., what kind of data you want to store in the table fields. This enables several benefits − PostgreSQL supports a wide set of Data Types. Besides, users can create their…

  • Environment Setup

    To start understanding the PostgreSQL basics, first let us install the PostgreSQL. This chapter explains about installing the PostgreSQL on Linux, Windows and Mac OS platforms. Installing PostgreSQL on Linux/Unix Follow the given steps to install PostgreSQL on your Linux machine. Make sure you are logged in as root before you proceed for the installation. Please wait…

  • PostgreSQL Introduction

    PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development phase and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. This tutorial will give you a quick start with PostgreSQL and make you comfortable with PostgreSQL programming. What is…