16 Program for Foreign Key in PostgreSQL

Program: create table customers(CID int primary key, name text, contact int); create table orders(OID int primary key, item text, pric...
Read More

15 Program for Default Constraint in PostgreSQL

Program: create table cars(id int, mileage int default 0); insert into cars (id) values(1); select * from cars; insert into cars...
Read More

14 Program for Serial Constraint in PostgreSQL

Program: create table books( ID serial primary key, name text); insert into books (name) values('Book1'); insert into books...
Read More

13 Program for Primary Key Constraint in PostgreSQL

Program: create table people( ID int primary key, name text, number int); insert into people values(1, 'Atharva', 54955); i...
Read More

12 Program for Unique Constraint in PostgreSQL

Program: create table food(name  text unique,price int); insert into food values('Apple',5); insert into food values('M...
Read More

11 Program for Not Null Constrain in PostgreSQL

Program: create table people(name text, age int not null); insert into people values('Jim', 40); insert into people values(...
Read More

10 Program to demonstrate Math Function in PostgreSQL

Program: select avg(age) from students; select count(name) from students; select min(age) from students; select max(age) from st...
Read More

9 Program to Update Data in PostgreSQL

Program: select * from students; UPDATE students SET number='3333' Where name='Kim'; Output:
Read More

8 Program to demonstrate Operators in PostgreSQL

Program: select * from students where name='Atharva' and age='18'; select * from students where name='Atharva'...
Read More

7 Program for Where and Where NOT Clause in PostgreSQL

Program: select * from students; select * from students where name='Atharva'; select * from students where name='Atharv...
Read More

6 Program to show Where Clause in PostgreSQL

Program: select * from students; select * from students where name='Atharva'; select * from students where age>18; Ou...
Read More

5 Program to show Select Distinct Clause in PostgreSQL

Program: select * from students; select name from students; select distinct(name) from students; Output:
Read More

4 Program for Select Clause in PostgreSQL

Program: INSERT INTO students values('John', 19, 97999),('Kim', 20,9898),('Atharva',200,989122); select * from...
Read More

3 Program to Insert Data in Table of PostgreSQL

Program: INSERT INTO students values('Atharva', 18, 99999); select * from students; Output:
Read More

2 Program to create and describe table in PostgreSQL

Program: create table students(name text,age int,number int);  -- To create table \d students -- To describe table Output:
Read More

1 Program to create and delete PostgreSQL Database

Program:  create database demo2; -- Creating Database \l -- To View All Database \c demo1 -- To use Demo1 Database drop databas...
Read More