Załóżmy, że istnieje tabela o nazwiedwóch kolumn nie może być null w tym samym czasie w sql
Pracownik
ID number, name varchar(24 char), address varchar2(100 char), alternateAddress(100 char), sex varchar2(10 char)
Teraz chcę umieścić ograniczenie takie, że zarówno adres i alternateAddress nie może być null tj możliwym przypadki są:
- adres jest nieważna i alternateAddress nie jest null
- alternateAddress jest null nd adres nie jest null
- alternateAddress nie jest null i adres nie jest null
Ale nie może się zdarzyć, że każdy rekord w tabeli Employee wstawiony alternateAddress i zająć zarówno zerowy
proszę określić RDBMS podczas zadawania takich pytań, np. MySQL, SQL-Server, Oracle, Postgres itp. – ChrisProsser