MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Aditi wants to apply a constraint on a table “student”, where in she wants to restrict the marks entered as values between only 1 and 100. Which of the following constraints should she use?
A
Default
B
Check
C
Primary Key
D
Unique
Explanation: 

Detailed explanation-1: -The CHECK constraint is used to limit the value range that can be placed in a column.

Detailed explanation-2: -CHECK constraints enforce domain integrity by limiting the values that are accepted by one or more columns.

Detailed explanation-3: -NOT NULL Constraint in SQL This means that you should provide a valid SQL NOT NULL value to that column in the INSERT or UPDATE statements, as the column will always contain data.

Detailed explanation-4: -15. Which SQL constraint do we use to set some value to a field whose value has not been added explicitly? Explanation: The DEFAULT constraint is used to set a default value for a column which comes into use when a value for a field in that column is not set.

There is 1 question to complete.