In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Psql testdb, system login user, local database, connect to testdb database
Psql-U testuser testdb, user testuser, connect to the local database testdb
Psql-U testuser-h 172.28.18.51 testdb, user testuser, connect to remote testdb database
Enumerate databases: / l
Select database: / c database name
Display table structure information: / d table name
Exit psgl:/q
Display character set: / encoding [sroot@AAEP7151 craft] # su postgres
Bash-4.1$ psql VoicePortal
Psql (9.2.14)
Type "help" for help.
VoicePortal=#\ d
Common instruction
Select pg_database_size ('VoicePortal')
SELECT Sname,2016-Sage
From Student; indicates the year of birth
Select DISTINCT Sno eliminates duplicate lines
FROM SC
Select Sname,Sdept,Sage
FROM Student
WHERE Sage NOT BETWEEN 20 AND 23; determine the range is not useful greater than less than, using between and
Selcet Sname .Sex
FROM Student
WHERE Sdept IN ('CS','MA','IS'); the selected major is in this collection
Select Sname
FROM Student
WHERE Sdept = 'CS' OR Sdept =' MA'
List the conditions with or or and
SELECT *
FROM Student
ORDER BY Grade DESC; sort ascending order is ASC descending order is DESC, note that Null is considered to be the largest, ascending order comes last, descending order comes first.
Aggregate function
SELECT COUNT (*)
FROM Sdudent
SELECT AVG (Grade)
FROM SC
WHERE Cno ='1'
Configuration file
/ var/lib/pgsql/data/postgresql.conf
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.