Deutsch
Germany.ruФорумы → Архив Досок→ Программирование

Вопрос по SQL

02.06.20 17:38
Re: Вопрос по SQL
 
  moose коренной житель
в ответ Программист 02.06.20 16:21, Последний раз изменено 02.06.20 17:45 (moose)

а как же это? из книжки martin gruber 'understanding sql':


ch. 19foreign key as a column constraintthe column-constraint version of the foreign key constraint is also called the references constraint, because it does not actually contain the words foreign key; it simply uses the word references, and then names the parent key, like this:

create table customers (cnum integer not null primary key, cname char(10, city char(10), snum integer references salespeople(snum) );

the above defines customers.snum as a foreign key whose parent key is salespeople.snum. it is equivalent to this table constraint:

foreign key (snum) referendex salespeople (snum)

я думал, раз не заругалась база при создатии таким образом, значит должно иметь какой-то эффект, а оно, как немцы говорят, ин ди хозэ : (


но проверил: если задать как foreign key as a TABLE constraint, то все красиво (пока).

я так понимаю, что должна была заругаться. а если проглотила - должна выполнить корректно. глючит, понимаю, мария.

 

Перейти на