It's a beginner who started studying databases.
I'm very sorry for the sudden question, but are the psql and sql commands the same? Or is it something else?
I used this site as a reference.
PostgreSQL Commands
SQL Commands
http://qiita.com/KENJU/items/313b5640da05834a53aa
The psql command is a program called psql that runs on the OS.
Launch psql to connect to PostgreSQL and do more.
By the way, there are programs called mysql
for MySQL, sqlcmd.exe
for SQL Server, and sql.exe
for Oracle.
SQL commands are database languages for manipulating and defining data that is available throughout the Relational Database Management System (RDBMS).Standardized for use in a variety of RDBMS, not just PostgreSQL.It also has an extended syntax for each RDBMS.
Typical SQL Commands
SELECT...
:query queryINSERT...
:adding recordsUPDATE...
:updating columnsDELETE...
:deleting recordsThe actual usage is an image that runs the psql command on the OS to connect to PostgreSQL and then queries the database using SQL commands.
Example Start psql & Connect to PostgreSQL
$psql-h localhost-Udbuser-ddbname
Password for user dbuser—Enter password here
Example Run the SQL command (SELECT statement) on the hoge table on psql.
dbname=>SELECT* FROM hoge;← Run SQL here.ddbname=> は is the psql prompt.
id | city ← SQL results below
----------+-------
1 | Tokyo
2 | osaka
3 | sapporo
In my experience, in the case of postgresql, when you say "psql" and "SQL" commands, you may sometimes say (sometimes) the following different uses:I don't know any other DBs, so I can't say anything.
Note:
psql (PostgreSQL 9.2.4)
SQL Commands (PostgreSQL 9.2.4)
© 2024 OneMinuteCode. All rights reserved.