booktown=# INSERT INTO distinguished_authors
booktown-* VALUES (1809. 'Geisel'.
booktown(# 'Theodor Seuss', 'Pulitzer Prize');
INSERT 3629488 1
booktown=# SELECT * FROM authors
booktown-# WHERE lastjname = 'Geisel':
id | lastjname | firstjiame
1809 | Geisel | Theodor Seuss 1809 | Geisel |
Theodor Seuss
(2 rows)
booktown=# DELETE FROM ONLY authors
booktown-# WHERE lastjiame = 'Geisel';
DELETE 1
В итоге после выполнения листинга 7.15 запись появляется в таблице distinguished_authors и удаляется из таблицы authors:
booktown=# SELECT * FROM authors
booktown-# WHERE lastjiame = 'Geisel':
id | lastjiame | firstjiame
1809 Geisel | Theodor Seuss
(1 row)
booktown=# SELECT * FROM distinguishedjauthors
booktown-# WHERE lastjiame = 'Geisel1;
id | lastjiame | firstjiame | award
1809 | Geisel | Theodor Seuss | Pulitzer Prize
(1 row)