Tag Archives: PostgreSQL

PostgreSQL Example – How to Change Values

Change Values Create Table Of Elves – Create table called elves CREATE TABLE elves ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable alive varchar(255) ) Insert Rows Into Elf Table INSERT INTO elves (name, age, race, alive) VALUES (‘Dallar Woodfoot’, 25, ‘Elf’, ‘Yes’), (‘Cordin …

PostgreSQL Example – How to Add Column

Add Column Create Table – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable weapon varchar(255) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race, weapon) VALUES (‘Fjoak Doom-Wife’, 28, ‘Human’, ‘Axe’), (‘Alooneric …

PostgreSQL Example – How to View Unique Values

View Unique Values Create Table – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable weapon varchar(255) ) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race, weapon) VALUES (‘Fjoak Doom-Wife’, 28, ‘Human’, …

PostgreSQL Example – How to Use Column Aliases With Where Clause

Use Column Aliases With Where Clause Create Table – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable weapon varchar(255) ) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race, weapon) VALUES (‘Fjoak …

PostgreSQL Example – How to Sort Rows In Groups

Sort Rows In Groups Create Table – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable weapon varchar(255) ) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race, weapon) VALUES (‘Fjoak Doom-Wife’, 28, …

PostgreSQL Example – How to Sort Rows

Sort Rows Create Table – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable weapon varchar(255) ) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race, weapon) VALUES (‘Fjoak Doom-Wife’, 28, ‘Human’, ‘Axe’), …

PostgreSQL Example – How to Select Values Between Two Values

Select Values Between Two Values Create Table Of Adventurers – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255) ) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race) VALUES (‘Fjoak Doom-Wife’, 28, ‘Human’), (‘Alooneric Cortte’, …

PostgreSQL Example – How to Select Highest Value In Each Group

Select Highest Value In Each Group Create Table Of Adventurers – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255) ) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race) VALUES (‘Fjoak Doom-Wife’, 28, ‘Human’), (‘Alooneric …

PostgreSQL Example – How to Retrieve Subset Of Columns

Retrieve Subset Of Columns Create Table – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable weapon varchar(255) ) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race, weapon) VALUES (‘Fjoak Doom-Wife’, 28, …

PostgreSQL Example – How to Retrieve Rows Based On Multiple Condition

Retrieve Rows Based On Multiple Condition Create Table – Create table called adventurers CREATE TABLE adventurers ( – string variable name varchar(255), – integer variable age int, – string variable race varchar(255), – string variable weapon varchar(255) Insert Rows – Insert into the table adventurers INSERT INTO adventurers (name, age, race, weapon) VALUES (‘Fjoak Doom-Wife’, …