Skip to main content

Database Modeling and Design MCQs with Answers

Practice important Database Modeling and Design MCQs with answers and explanations.

Chapter: 16
Q221:
What does DDL stand for in the context of databases?
A. Data Definition Language
B. Data Development Language
C. Data Deployment Language
D. Data Design Language
Correct Answer: A
Chapter: 16
Q222:
Which statement is used to create a new table in a database?
A. Alter Table
B. Create Table
C. Drop Table
D. Modify Table
Correct Answer: B
Chapter: 16
Q223:
Which datatype is used to store variable length character data?
A. Number
B. VarChar2
C. Date
D. Integer
Correct Answer: B
Chapter: 16
Q224:
What is the syntax to create a table named "Building" with columns bname, address, and phone number?
A. Create Table Building (bname varchar2 (30) primary key, address varchar2 (40), phone number number (10))
B. Create Table Building (bname varchar2 (30), address varchar2 (40), phone number number (10))
C. Create Table Building (bname varchar2 (30), address varchar2 (40), phone number varchar2 (10))
D. Create Table Building (bname varchar2 (30) primary key, address varchar2 (40), phone number varchar2 (10))
Correct Answer: A
Chapter: 16
Q225:
What is the purpose of the "Alter Table" command?
A. To delete a table
B. To create a table
C. To modify an existing table
D. To rename a table
Correct Answer: C
Chapter: 16
Q226:
Which command is used to remove a table from a database?
A. Drop Table
B. Create Table
C. Alter Table
D. Modify Table
Correct Answer: A
Chapter: 16
Q227:
To add a new column named "rent" to the "Building" table, which DDL command should be used?
A. Alter Table Building add (rent number (10));
B. Drop Table Building
C. add Column Building (rent number (10));
D. Create Table Building add (rent number (10));
Correct Answer: A
Chapter: 16
Q228:
Which DDL command will modify the datatype of an existing column?
A. Alter Table
B. Create Table
C. Drop Table
D. Select Table
Correct Answer: A
Chapter: 16
Q229:
In a table creation statement, what does the "primary key" constraint ensure?
A. Unique values for the column
B. No null values allowed
C. Foreign key reference
D. Column is indexed
Correct Answer: A
Chapter: 16
Q230:
Which statement is correct about the order of dropping tables?
A. Drop the parent table first and then child tables
B. Drop the child table first and then parent table
C. Drop tables in alphabetical order
D. Drop all tables simultaneously
Correct Answer: B
Chapter: 16
Q231:
To create a table named "Floor" with a composite primary key, which DDL statement is correct?
A. Create table Floor (floorno number (10), no_of_apt number (10), bname varchar2 (30) references building (bname), primary key (floorno, bname));
B. Create table Floor (floorno number (10), no_of_apt number (10), bname varchar2 (30), primary key (floorno, bname));
C. Create table Floor (floorno number (10), no_of_apt number (10), bname varchar2 (30) references Building (bname), primary key (floorno));
D. Create table Floor (floorno number (10), no_of_apt number (10), bname varchar2 (30), foreign key (bname) references Building (bname));
Correct Answer: A
Chapter: 16
Q232:
Fill in the blank: In the command `Create table Building (bname varchar2 (30) primary key, address varchar2 (40), phone number number (10));`, the datatype for the `bname` column is _______.
A. Number
B. Date
C. VarChar2
D. Integer
Correct Answer: B
Chapter: 16
Q233:
Fill in the blank: The "Alter Table" command is used to _______ a table by adding new columns or modifying existing ones.
A. delete
B. create
C. modify
D. remove
Correct Answer: C
Chapter: 16
Q234:
Fill in the blank: To store a fixed-size number in Oracle, you would use the _______ datatype.
A. Number
B. VarChar2
C. Date
D. FixedNumber
Correct Answer: A
Chapter: 17
Q235:
What is the purpose of the INSERT statement in SQL?
A. To delete rows from a table
B. To update existing data
C. To add new data into a table
D. To create new tables
Correct Answer: C
Chapter: 17
Q236:
What must be true about the values in an INSERT statement?
A. Values can be omitted for any column
B. Every column must have a corresponding value
C. Only primary key columns must be filled
D. Referential integrity constraints are optional
Correct Answer: B
Chapter: 17
Q237:
How can you verify the data insertion in a table?
A. SELECT * FROM TableName;
B. DELETE FROM TableName;
C. UPDATE TableName SET column=value;
D. TRUNCATE TABLE TableName;
Correct Answer: A
Chapter: 17
Q238:
What command would you use to add values to only some columns in a table?
A. INSERT INTO TableName (column1, column2) VALUES (value1, value2);
B. INSERT INTO TableName VALUES (value1, value2);
C. INSERT INTO TableName VALUES ();
D. INSERT INTO TableName (column1, column2) VALUES ();
Correct Answer: A
Chapter: 17
Q239:
What does the UPDATE statement do in SQL?
A. Removes all rows from a table
B. Adds new rows to a table
C. Modifies existing rows in a table
D. Creates a new table
Correct Answer: C
Chapter: 17
Q240:
How can you update multiple columns in a table?
A. UPDATE TableName SET column1=value1, column2=value2 WHERE condition;
B. UPDATE TableName VALUES (value1, value2);
C. INSERT INTO TableName (column1, column2) VALUES (value1, value2);
D. DELETE FROM TableName WHERE condition;
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Database Modeling and Design

🚀 Start Quiz Now