Skip to main content

Database Modeling and Design MCQs with Answers

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

Chapter: 19
Q281:
In a Self-Join, what is a common use case?
A. Comparing rows in a table with rows in another table
B. Combining data from two unrelated tables
C. Comparing values in the same column of a table
D. None of the above
Correct Answer: C
Chapter: 20
Q282:
What is a view in SQL?
A. A virtual table created by a query
B. A physical table with its own data
C. A stored procedure that updates data
D. A function that calculates values
Correct Answer: A
Chapter: 20
Q283:
What does a view in SQL derive its data from?
A. Views themselves
B. Base tables
C. Indexes
D. Sequences
Correct Answer: B
Chapter: 20
Q284:
What is the purpose of using a SQL view?
A. To create new tables
B. To summarize data from various tables
C. To store data permanently
D. To index tables
Correct Answer: B
Chapter: 20
Q285:
What is the correct syntax to create a view in SQL?
A. CREATE VIEW view_name AS SELECT columns FROM tables WHERE conditions;
B. CREATE TABLE view_name AS SELECT columns FROM tables WHERE conditions;
C. CREATE VIEW view_name SELECT columns FROM tables WHERE conditions;
D. CREATE VIEW view_name AS INSERT INTO tables (columns);
Correct Answer: A
Chapter: 20
Q286:
How do you access data from a SQL view?
A. By querying the view as if it were a table
B. By directly updating the base tables
C. By modifying the SQL syntax used to create the view
D. By using a different database schema
Correct Answer: A
Chapter: 20
Q287:
What does the WITH CHECK OPTION clause ensure in a view?
A. That INSERT and UPDATE statements comply with the view’s constraints
B. That the view can be queried without conditions
C. That the view’s data is stored in a separate table
D. That the view automatically updates the base tables
Correct Answer: A
Chapter: 20
Q288:
What will happen if you attempt to insert data into a view with a CHECK OPTION that does not meet the view's criteria?
A. The insertion will succeed and the view will update
B. The insertion will fail and an error will be returned
C. The insertion will succeed but the data will be ignored
D. The insertion will automatically correct the data
Correct Answer: B
Chapter: 20
Q289:
Which SQL statement will successfully insert a row into the ACCOUNTS_STAFF view?
A. INSERT INTO Accounts_staff VALUES (110, 'ASHI', 10);
B. INSERT INTO Accounts_staff VALUES (111, 'SAMI', 30);
C. INSERT INTO Accounts_staff VALUES (112, 'ALI', 20);
D. INSERT INTO Accounts_staff VALUES (113, 'KASHIF', 40);
Correct Answer: A
Chapter: 20
Q290:
What is the purpose of a data dictionary in Oracle databases?
A. To provide a read-only set of tables with information about the database
B. To store user passwords and access levels
C. To create and modify database tables and views
D. To directly access and modify the database schema
Correct Answer: A
Chapter: 20
Q291:
Which of the following is NOT a typical use of a data dictionary?
A. Accessing data about schema objects
B. Modifying data definitions
C. Providing direct access to the base tables
D. Serving as a read-only reference
Correct Answer: C
Chapter: 20
Q292:
What does the SQL statement `SELECT * FROM user_tables;` display?
A. All relational tables accessible to the user
B. All tables owned by the current user
C. All constraint definitions on tables
D. All data dictionary views
Correct Answer: B
Chapter: 21
Q293:
What is a sequence used for in Oracle databases?
A. Generating unique auto-number values on demand
B. Storing large amounts of data
C. Backing up database tables
D. Encrypting database information
Correct Answer: A
Chapter: 21
Q294:
What is the purpose of the `MINVALUE` clause in a sequence?
A. Specify the maximum value of the sequence
B. Specify the interval between sequence numbers
C. Specify the minimum value of the sequence
D. Specify how many values to cache
Correct Answer: C
Chapter: 21
Q295:
What does the `START WITH` clause define in a sequence?
A. The first sequence number to be generated
B. The maximum value the sequence can generate
C. The number of values to cache
D. The interval between sequence numbers
Correct Answer: A
Chapter: 21
Q296:
How does the `INCREMENT BY` clause affect a sequence?
A. It defines the interval between sequence numbers
B. It specifies the minimum value of the sequence
C. It sets the maximum value of the sequence
D. It determines how many values are cached
Correct Answer: A
Chapter: 21
Q297:
What does the `CACHE` clause do in a sequence?
A. It specifies how many values to pre-allocate and keep in memory for faster access
B. It determines the maximum value of the sequence
C. It defines the starting value of the sequence
D. It sets the increment interval
Correct Answer: B
Chapter: 21
Q298:
What is the effect of the `CYCLE` option in a sequence?
A. The sequence continues generating values after reaching its maximum or minimum value
B. The sequence stops generating values after reaching its maximum or minimum value
C. The sequence value is reset to zero after reaching its maximum value
D. The sequence automatically increments by two values instead of one
Correct Answer: A
Chapter: 21
Q299:
What will happen if you use the `NO CYCLE` option in a sequence?
A. The sequence will stop generating values after reaching its maximum or minimum value
B. The sequence will generate values continuously without interruption
C. The sequence will reset to its minimum value after reaching its maximum value
D. The sequence will automatically start from zero again
Correct Answer: B
Chapter: 21
Q300:
What does the `CREATE SEQUENCE customers_seq START WITH 1000 INCREMENT BY 1 NOCACHE NOCYCLE;` statement do?
A. Creates a sequence starting at 1000, incrementing by 1, with no caching and no cycling
B. Creates a table with customer ID numbers starting at 1000, incrementing by 1
C. Creates a view with customer data starting at 1000, incrementing by 1
D. Creates a stored procedure with a sequence starting at 1000, incrementing by 1
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Database Modeling and Design

🚀 Start Quiz Now