CDCDAC Prep
PGCP-ITISSCMCE (CCE Modules Exam)•32 Questions

Programming Concepts: Python and MySQL Practice MCQs

Topic Covered in this Question Set

MySQL Database Design, Schemas and Data Definition

Click on an option to check your answer immediately. Full solution & explanation provided for every question.

Interactive Practice Mode

Programming Concepts: Python and MySQL Free MCQs

Select an option to test your knowledge with real exam questions and instant explanations.

Total32
Correct0
Wrong0
Progress: 0 of 32 answered0% Accuracy
Q1 of 32

A company uses MySQL to store employee records in company_db. Which description correctly separates these terms?

Open topic in App →
Q2 of 32

A newly created table has six columns and no rows. What are its degree and cardinality?

Open topic in App →
Q3 of 32

Which statement about CREATE SCHEMA and CREATE DATABASE is correct in MySQL?

Open topic in App →
Q4 of 32

Each department has many employees, while each employee belongs to at most one department. Where should the department reference normally be stored?

Open topic in App →
Q5 of 32

An employee may have several independently managed phone numbers. Which design best represents this?

Open topic in App →
Q6 of 32

An order line is identified by an order ID together with a line number that repeats across orders. Which explanation fits?

Open topic in App →
Q7 of 32

Which declaration can identify an employee–project assignment without preventing either side from appearing in other assignments?

Open topic in App →
Q8 of 32

Which requirement distinguishes a candidate key from an arbitrary superkey?

Open topic in App →
Q9 of 32

A table declares PRIMARY KEY (employee_id, project_id). Which pair can be added when (101, 7) already exists, assuming both referenced parents exist?

Open topic in App →
Q10 of 32

Which statement about primary keys is correct?

Open topic in App →
Q11 of 32

An employee table allows department_id to be NULL and references department. Which insertion is valid, assuming all other column rules are satisfied?

Open topic in App →
Q12 of 32

Two employees belong to department 10. Must their department_id values differ?

Open topic in App →
Q13 of 32

Which type is most appropriate for an exact amount requiring two decimal places?

Open topic in App →
Q14 of 32

How many digits before the decimal point can DECIMAL(10,2) represent?

Open topic in App →
Q15 of 32

Why is a phone number such as 0012345 often stored as VARCHAR instead of INT?

Open topic in App →
Q16 of 32

Which practice remains safe across MySQL installations with different operating systems and configurations?

Open topic in App →
Q17 of 32

A nullable email column has UNIQUE. What happens when two different rows omit email and receive NULL?

Open topic in App →
Q18 of 32

A nullable status column has DEFAULT 'active'. An INSERT explicitly supplies NULL for status. What does the default alone require?

Open topic in App →
Q19 of 32

On modern MySQL with an enforced CHECK (salary >= 0), salary is nullable. Which input violates this check?

Open topic in App →
Q20 of 32

Why is a server version relevant when relying on a CHECK constraint?

Open topic in App →
Q21 of 32

After CREATE DATABASE company_db, which statement selects it for unqualified table names in the current connection?

Open topic in App →
Q22 of 32

Why is department created before employee in the worked design?

Open topic in App →
Q23 of 32

A table uses an integer primary key and a nullable foreign key. Which condition necessarily prevents inserting a new row?

Open topic in App →
Q24 of 32

Deleting department 10 succeeds under ON DELETE CASCADE. Which employees are affected by that referential action?

Open topic in App →
Q25 of 32

A design requires ON DELETE SET NULL on a department foreign key. Which column rule conflicts with that action?

Open topic in App →
Q26 of 32

A parent identifier changes under ON UPDATE CASCADE. What should happen to its matching child references?

Open topic in App →
Q27 of 32

Which statement is most useful for verifying the actual named foreign-key definition of employee?

Open topic in App →
Q28 of 32

CREATE TABLE employee_copy LIKE employee succeeds. Which conclusion is correct in MySQL?

Open topic in App →
Q29 of 32

The name column must allow 120 characters while remaining mandatory. Which command expresses this?

Open topic in App →
Q30 of 32

Adding UNIQUE(email) to an existing table fails because two non-NULL emails are identical. What explains the failure?

Open topic in App →
Q31 of 32

Which operation removes a column's stored values while retaining the employee table and its other columns?

Open topic in App →
Q32 of 32

Which statement about DROP TABLE IF EXISTS employee_copy is correct?

Open topic in App →
Need to review the concepts?

Read Programming Concepts: Python and MySQL Study Notes

Review complete topic notes, syntax guides, code examples, and summary tables.

Read Free Study Notes →