I am a newbie to DB and SQL. I have the following as a starting point:
CREATE DOMAIN student_numbers AS CHAR(4)
CHECK (SUBSTR(VALUE, 1, 1) = 'S'
What I would like to do is instead checking for ‘S’ only, I would like to check for ‘A’ to ‘Z’.
Also what needs to be done in case I want to check for ‘AAAA’ to ‘ZZZZ’? I gather it maybe possible to assume AAA1 to be a valid value within range, which is not the correct behaviour.
Any guidence or further reading resources would be most welcome.
Thanking you.
I think you can use a regular expression in the CREATE DOMAIN statement, so something like:
or for the second one: