- Open pgAdmin
- Connect to database server
- Edit => New Object => New database
- done
Or use plain SQL when connection to any database: CREATE DATABASE my_database;
postgresql - How to create a database or role in pgAdmin4? - Database Administrators Stack Exchange
What's the best way to set up this SQL database in PgAdmin4?
Help with pgAdmin 4 - never asked to create a master password
pgAdmin Generate ERD stuck on load
Videos
- Open pgAdmin
- Connect to database server
- Edit => New Object => New database
- done
Or use plain SQL when connection to any database: CREATE DATABASE my_database;
HI ... Verify that u have done above steps to install the postgresql properly ... and follow the below instructions to create a database in POSTGRESQL
INSTALL POSTGRESQL
1.Install latest PostgreSQL 9.1 in console:
sudo apt-get install postgresql libpq-dev
2.PostgreSQL has a super user is called postgres. Change user to the PostgreSQL user:
sudo su - postgres
3.Change password of postgres user:
psql -d postgres -U postgres
psql (9.1.3) Type "help" for help
postgres=# alter user postgres with password 'YOUR_NEW_PASSWORD';
ALTER ROLE
postgres=# \q
#logout postgres user
logout
4.Restart the PostgreSQL server:
sudo /etc/init.d/postgresql restart
pgAdmin III: PostgreSQL administration and management tools
If pgAdminIII is not installed, the installation is easy:
sudo apt-get install pgadmin3
ADD A SEVER
Open pgAdminIII and add new localhost server. Go to menu File > Add Server
Set up pgAdmin III server instrumentation:
When connecting to a PostgreSQL database using pgAdmin you may receive an error letting you know that the server instrumentation is not installed.
Install postgresql-contrib package:
sudo apt-get install postgresql-contrib
Install adminpack extension:
sudo -u postgres psql
postgres=# CREATE EXTENSION "adminpack";
postgres=# \q
CREATE DATABASE
1.Double Click your database in Left pane on PGAdmin to select it
2.Now click the a Icon named "SQL" ,probably 6th icon, and type CREATE table query in resultant window
EXAMPLE:
3.Create table query
CREATE TABLE explore(
SUBJECT TEXT NOT NULL,
COMPANY CHAR(50) NOT NULL,
PNAME TEXT NOT NULL,
PHONE INT NOT NULL,
EMAIL CHAR(50) NOT NULL,
REMARKS CHAR(200) NOT NULL
);
Post any queries below.............Have a error free day.
I’m newbie in SQL and would be awesome a help about how to approach this.
I'm working with a database with 9 million lines with the following structure:
-
I have one table for each year from 2008 to 2022 (15 separate tables in total)
-
All tables have the same columns
-
Each table has nutritional information about thousands of people
-
Each line represents a medical appointment, with the person data across the columns
-
Each column is a type of info about a person (City, BMI, height, weight, race, gender, etc.)
-
Each person has a unique ID Code
-
Each record also has a unique ID
-
In the same year the person can show in more than one line, meaning that she had multiple medical appointments that year, so it will have same person ID, different appointment ID.
-
Different appointments, even from the same person, have different ID Codes
-
There are columns with blank values, when that info doesn’t apply for that person.
-
Not all the people who appear in a year will show in the other years, but some do.
What I need from this data: perform several different analysis, mainly descriptive, like:
a) Historical analysys - I need to see for each year the composition of the population, so, from 2008 to 2022, for each year: how was the % of male and female? Of black, white and yellow people? Of children, teenagers, adults and elderly? And other questions like those.
b) Evolution of groups - What happened to the teenagers who were malnourished in 2014 after 5 years? I want to take a sample and track the evolution by the ID of the person
c) 2022 in depth-analysis - How all factors influences each other? How malnutrition affects black girls? What about black girls in cities from the countryside? I want to make “cross-analysis” like those for just 1 or 2 years. Sample of how the tables are structured
So, what’s the best approach? Do I make one big table with everything? Do I keep them separated by year and make relationships between them? If so, how, given that they represent medical appointments of multiple people across the years, but there’s only a few people who's present in all the years? Would be faster to create one table with all the people from all the years and other connected tables grouped by something else than year?
Thanks in advance :)))