0
0
DBMS Theoryknowledge~10 mins

DDL (CREATE, ALTER, DROP) in DBMS Theory - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new table named 'students' with columns 'id' and 'name'.

DBMS Theory
CREATE TABLE [1] (id INT, name VARCHAR(50));
Drag options to blanks, or click blank then click option'
Astudent_list
Bstudent
Cstudents
Dstudent_table
Attempts:
3 left
💡 Hint
Common Mistakes
Using singular form 'student' instead of 'students'.
Using unrelated table names.
2fill in blank
medium

Complete the code to add a new column 'email' of type VARCHAR(100) to the 'students' table.

DBMS Theory
ALTER TABLE students [1] email VARCHAR(100);
Drag options to blanks, or click blank then click option'
AADD
BMODIFY
CCHANGE
DDROP
Attempts:
3 left
💡 Hint
Common Mistakes
Using MODIFY instead of ADD.
Using DROP which deletes columns.
3fill in blank
hard

Fix the error in the code to drop the 'email' column from the 'students' table.

DBMS Theory
ALTER TABLE students [1] COLUMN email;
Drag options to blanks, or click blank then click option'
ADROP
BREMOVE
CERASE
DDELETE
Attempts:
3 left
💡 Hint
Common Mistakes
Using REMOVE or DELETE which are not valid in this context.
Omitting the COLUMN keyword after DROP.
4fill in blank
hard

Fill both blanks to rename the table 'students' to 'alumni'.

DBMS Theory
ALTER TABLE [1] [2] TO alumni;
Drag options to blanks, or click blank then click option'
Astudents
BRENAME
CTO
Dalumni
Attempts:
3 left
💡 Hint
Common Mistakes
Using the new table name in the first blank.
Using TO in the second blank instead of RENAME.
5fill in blank
hard

Fill all three blanks to create a table 'courses' with columns 'course_id' (INT) and 'course_name' (VARCHAR(100)).

DBMS Theory
CREATE TABLE [1] ([2] INT, [3] VARCHAR(100));
Drag options to blanks, or click blank then click option'
Acourses
Bcourse_id
Ccourse_name
Dstudents
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'students' as table name instead of 'courses'.
Swapping column names or using wrong data types.