Postgresql Database Notes
Postgresql Database Notes
---------------------------------------------------------------------
postgres=# \l //to view all databases
postgres=# \c SQL-Lab1 //switch to SQL-Lab1 database
SQL-Lab1=# \i D:/Gallery/Downloads/EmployeeDetails.sql
----------------------------------------------------------------------
postgres=# \c webmonth
You are now connected to database "webmonth" as user "postgres".
=================================================
webmonth=# SELECT SUM(age) from users;
sum
-----
57
(1 row)
=================OR==============================
webmonth=# SELECT SUM(age) as TOTAL from users;
total
-------
57
(1 row)
=================================================