Chapter 2. SQL ����

Table of Contents
2.1. ����
2.2. ����
2.3. �����±�
2.4. ����������
2.5. ��ѯһ����
2.6. �ڱ�֮������
2.7. �ۼ�����
2.8. ����
2.9. ɾ��

2.1. ����

�����ṩһ�����ʹ�� SQL ִ�м򵥲����ĸ����� ���̵̳�Ŀ��ֻ�Ǹ���һ�����ܣ����������� SQL �̡̳��������� SQL ���飬���� Understanding the New SQL �� A Guide to the SQL Standard�������㻹Ҫ֪����Щ PostgreSQL���������ǶԱ�׼����չ��

��������������Ǽ������Ѿ���������Ϊ mydb �����ݿ⣬������ǰ�����������ܵ�һ���������Ѿ������� psql��

���ֲ������Ҳ������PostgreSQL Դ���뷢�����Ŀ¼ src/tutorial/ ���ҵ��� Ҫʹ����Щ�ļ������Ƚ����Ŀ¼Ȼ������ make��

$ cd ..../src/tutorial
$ make

�����ʹ�������Щ�ű��Լ������˰����û����庯�������͵� C �ļ��� �������ʹ�� GNU make ����������� — �������ϵͳ�Ͽ�������������ʲô������������ gmake���� Ҫ��ʼ����̳̣���������˵�Ľ��У�

$ cd ..../src/tutorial
$ psql -s mydb
...

mydb=> \i basics.sql

\i �����ָ�����ļ��ж�ȡ��� -s ѡ��������ڵ���ģʽ�����������������ÿ�����֮ǰ��ͣ�� �ڱ���ʹ�õ�������ļ� basics.sql �С�