Search Header Logo

constraints

Authored by NV CHALLA

Computers

University

Used 1+ times

constraints
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q1. What does a primary key do?

A primary key is used to store large amounts of data.
A primary key uniquely identifies each record in a database table.
A primary key can be duplicated across records.
A primary key is a type of foreign key.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q2. Which of the following constraints prevents NULL values in a column?

DEFAULT
NOT NULL
PRIMARY KEY
UNIQUE

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q3. Which of the following constraints can be used to provide a default value for a column?

DEFAULT constraint
PRIMARY KEY constraint
CHECK constraint
UNIQUE constraint

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q4. Which of the following is TRUE about UNIQUE constraint?

The UNIQUE constraint can be applied to multiple columns but allows one duplicate value.
The UNIQUE constraint allows duplicate values in a column.
The UNIQUE constraint prevents duplicate values in a column.
The UNIQUE constraint is only applicable to primary keys.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q5. Which constraint ensures referential integrity between two tables?

Primary key constraint
Unique constraint
Check constraint
Foreign key constraint

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q6. What happens if we try to insert a NULL into a NOT NULL column?

The operation will succeed without any issues.
A default value will be inserted instead.
The operation will fail with an error.
The NULL value will be converted to an empty string.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q7. Which statement correctly creates a table with a default value?

CREATE TABLE example (id INT, name VARCHAR(100) DEFAULT 'unknown');
CREATE TABLE example (id INT DEFAULT NULL, name VARCHAR(100));
CREATE TABLE example (id INT DEFAULT 1, name TEXT);

CREATE TABLE example (id INT DEFAULT 100, name VARCHAR(100));

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?