Which query adds a primary key constraint to the 'id' column
in the 'students' table?
DAY 22 MySQL: Constraints, Normalization (9th JULY 24)
Quiz
•
Professional Development
•
University
•
Hard
KVCH CORPORATE
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query adds a primary key constraint to the 'id' column
in the 'students' table?
ALTER TABLE students ADD CONSTRAINT PRIMARY
KEY (id);
ALTER TABLE students ADD PRIMARY KEY (id);
UPDATE TABLE students SET PRIMARY KEY (id);
MODIFY TABLE students SET PRIMARY KEY (id);
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query creates a table 'enrollments' with a foreign key
constraint referencing 'students' ?
CREATE TABLE enrollments (student_id INT, course_id
INT, FOREIGN KEY (student_id) REFERENCES
students(id));
CREATE TABLE enrollments (student_id INT, course_id
INT, SET FOREIGN KEY (student_id) TO students(id));
CREATE TABLE enrollments (student_id INT, course_id
INT, ADD FOREIGN KEY (student_id) REFERENCES
students(id));
CREATE TABLE enrollments (student_id INT, course_id
INT, ADD CONSTRAINT FOREIGN KEY (student_id)
REFERENCES students(id));
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query removes a unique constraint from the 'email'
column in the 'students' table?
ALTER TABLE students DROP UNIQUE (email);
ALTER TABLE students REMOVE UNIQUE (email);
ALTER TABLE students DELETE UNIQUE (email);
ALTER TABLE students DROP CONSTRAINT UNIQUE
(email);
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query sets a default value of 'Active' for the 'status'
column in the 'students' table?
ALTER TABLE students SET DEFAULT 'Active' FOR
status;
ALTER TABLE students CHANGE DEFAULT 'Active' FOR
status;
ALTER TABLE students MODIFY status SET DEFAULT
'Active';
ALTER TABLE students ALTER COLUMN status SET
DEFAULT 'Active';
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query ensures that the 'age' column in the 'students'
table cannot have null values?
ALTER TABLE students SET NOT NULL (age);
ALTER TABLE students MODIFY age NOT NULL;
ALTER TABLE students ALTER COLUMN age SET NOT
NULL;
ALTER TABLE students UPDATE age SET NOT NULL;
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which normalization form ensures that all non-key attributes
are fully functional dependent on the primary key?
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query removes the foreign key constraint from the
'student_id' column in the 'enrollments' table?
ALTER TABLE enrollments DROP FOREIGN KEY
(student_id);
ALTER TABLE enrollments REMOVE FOREIGN KEY
(student_id);
ALTER TABLE enrollments DROP CONSTRAINT
FOREIGN KEY (student_id);
ALTER TABLE enrollments DROP CONSTRAINT
student_id;
14 questions
Topic 6 - Slides
Quiz
•
University
10 questions
Topic 5 - slides
Quiz
•
University
12 questions
Veri tabanı yönetim sistemleri
Quiz
•
University
14 questions
SLU 101 Recap Quiz
Quiz
•
University
5 questions
BD1_UTP2022
Quiz
•
University
12 questions
Pengenalan Google Classroom
Quiz
•
5th Grade - Professio...
11 questions
PPR Practice
Quiz
•
KG - University
9 questions
Warm Up Exercise SED4074
Quiz
•
University
25 questions
Equations of Circles
Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)
Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System
Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers
Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons
Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)
Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review
Quiz
•
10th Grade