PostgreSQL

https://www.w3schools.com/postgresql/postgresql_getstarted.php

Table, entities, relations

Entity is a logical concept of relational database model. And table is used to express it, but there is a slight difference. Table expresses not only entities, but also relations.

For example, assume that you want to make a database of projects and employees of a company. Entity is a unit of information that has meanings by itself. In this case, there will be two entities - "Project" and "Employee". Each entity has its own attributes.

In relational DB model, there is another idea, 'relation'. If employees participate in several projects, then we can say that there is a relation with a name 'works_on'.

https://www.geeksforgeeks.org/postgresql-psql-commands/

\l

List all databases

\c [devon_db]

打开[devon_db]

\d

Lists all tables, views, and sequences in the current schema.

\dt

List available tables

\ds

List all sequences in the current schema.

\x

Expand display