Member Avatar for Lioshenka

Stupid question, really...

Say, if I have a Department tuple with "Faculty" field- how can I declare it on the design stage so it only can take the values of "Science", "Arts" or "Psychology"?

Department {
<letter_ID : CHAR( 2)>,
<english_name: VARCHAR2 (50)>,
<enw_cymraeg: VARCHAR2 (50)>,
<faculty: "science" or "arts" or "psychology
}

I am sure the way I declared it isn't correct. Also, can someone give me an example of the SQL code to do similar kind of thing?

I vaguely remember that in MS Acess you can create a drop down menu, so I guess it is posible, but I never knew what goes on under the GUI.

Many thanks!

you need to create a check constraint with the desired values on the desired column of the table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.