PostgreSQL

Скачать в pdf «PostgreSQL»
2.4    Exiting a Session


This chapter would not be complete without showing you how to exit psql. Use backslash-q (q) to quit the session and exit psql. Backslashg (go), p (print), r (reset), and q (quit) should be all you need for now.

2.5 Summary


This chapter has introduced the most important features of psql. This knowledge will allow you to try all the examples in this book. In addition, psql has many other features to assist you. Section
16.1 covers psql in detail. You may want to consult that chapter while reading through the book.

Chapter 3

Basie SQL Commands


Sql stands for Structured Query Language, It is the most common way to communicate with database servers, and is supported by almost all database systems. In this chapter, you will learn about relational database systems and how to issue the most important SQL commands.

3.1 Relational Databases


As mentioned in Section
1.1, the purpose of a database is rapid data storage and retrieval. Today, most database systems are relational databases, While the term “relational database” has a mathematical foundation, in practice it means that all data stored in the database is arranged in a uniform structure.


Figure 3.1 shows a database server with access to three databases: demo, finance, and test, You could issue the command psql finance and be connected to the finance database. You have already dealt with this issue in Chapter 2. Using psql, you chose to connect to database test with the command psql test. To see a list of databases available at your site, type psql -l. The first column lists the database names. However, you may not have permission to connect to all of them.

Скачать в pdf «PostgreSQL»