wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

QPDS Topic_1 MCQ_2

Total questions: 91

Worksheet time: 46mins

Name
Class
Date
1.

What is Python primarily used for?

a)

Web development

b)

Data analysis

c)

Machine learning

d)

All of the above

2.

A CSV file contains inconsistent date formats causing parsing failures. Which Python library helps unify date formats?

a)

datetime

b)

hashlib

c)

turtle

d)

math

3.

A data analyst receives customer transaction data where dates are written in multiple formats (DD/MM/YYYY, MM-DD-YY). She must convert all formats into ISO (YYYY-MM-DD) before analysis.

a)

Data merging

b)

Data formatting

c)

Data binning

d)

Data sampling

4.

A dataset contains a column with mixed data types (strings and numbers). Which pandas function helps convert the entire column to a single numeric type while handling errors?

a)

pd.to_numeric(column, errors='coerce')

b)

pd.to_string(column)

c)

pd.astype(column, dtype=int)

d)

column.astype(int)

5.

What is the correct way to define a function in Python?

a)

def functionName[]:

b)

function functionName():

6.

A hospital system integrates patient data from multiple departments, but each department stores different column names for “Patient ID”. The analyst must standardize all names into a single field. Which step of wrangling is needed?

a)

Enrichment

b)

Normalization

c)

Standardization

d)

Validation

7.

Your team receives sales data with several missing values for "Price". You decide to compute the median price and fill the missing values. This wrangling activity is known as:

a)

Imputation

b)

Encoding

c)

Tokenization

d)

Partitioning

8.

Consider the following SQL query: SELECT name, COUNT(*) FROM employees GROUP BY name HAVING COUNT(*) > 1; What does this query return?

a)

Names of employees appearing only once

b)

Employees with duplicate names

c)

Employees with unique names

d)

All employee names

9.

Your schema analysis shows a many-to-many relationship needing decomposition. What must be created?

a)

Junction table

b)

View

c)

Trigger

10.

Which of the following is used to access rows in a pandas DataFrame?

a)

Index

b)

Column

c)

Row

d)

Index

11.

A telecom company stores call logs in CSV, customers' plans in JSON, and billing data in XML. You need to combine all three data types into one analysis table.

a)

Multi-format parsing

b)

Stream ETL

c)

Aggregation

d)

Feature scaling

12.

Which of the following data types is mutable in Python?

a)

Tuple

b)

String

c)

List

d)

Integer

13.

A researcher loads a CSV file but notices that commas inside quoted text cause misalignment of columns. Which parameter of Python’s CSV reader should solve this?

a)

delimiter

b)

quotechar

c)

escapechar

d)

lineterminator

14.

A CSV file is loaded into a pandas DataFrame, but some columns are incorrectly inferred as objects instead of integers. How can this issue be resolved?

a)

Use df.astype({'column_name': 'int'})

b)

Use df.convert_dtypes()

c)

Use df.dtypes to fix data types

d)

Use df.infer_objects()

15.

During schema understanding, you find that a database table has foreign keys linking to multiple tables but with no documentation. What must you analyze first?

a)

Primary key constraints

b)

Data cardinality

c)

Relationship structure

d)

View dependencies

16.

Consider the following SQL query: SELECT COUNT(*) FROM employees WHERE department = 'HR'; What does this query return?

a)

The total number of employees.

b)

The number of employees in the HR department.

c)

The names of employees in the HR department.

17.

A dataset uses “0” to represent missing age, which is incorrect. Which analytical decision is required?

a)

Replace zeros with NULL

b)

Delete all rows

c)

Convert all ages to strings

d)

Drop age column

18.

Your JSON data contains nested objects for user preferences. You need a flat table for analysis. Which wrangling task fits?

a)

Encoding

b)

Flattening

c)

Smoothing

d)

Interpolation

19.

Which SQL command is used to remove all records from a table without deleting the table structure?

a)

TRUNCATE

b)

DROP

c)

DELETE

d)

ALTER

20.

Which SQL command is used to remove all records from a table, including all spaces allocated for the records are removed?

a)

DROP

b)

DELETE

c)

TRUNCATE

d)

REMOVE

21.

Consider the following Python snippet: import sqlite3 conn = sqlite3.connect('database.db') cur = conn.cursor() cur.execute('INSERT INTO users (id, name) VALUES (?, ?)', (1, 'Alice')) conn.commit() A Python script throws a KeyError when accessing a dictionary. Which situation likely caused it?

a)

Wrong data type

b)

Missing key

c)

Incorrect loop

d)

Float value error

22.

A company wants to switch from an unstructured XML-based system to a structured relational model. What is the first step in understanding XML data?

a)

Reading XML tags

b)

Understanding XML schema (XSD)

c)

Parsing with DOM

d)

Checking indentation

23.

A retailer uses Python to filter products priced above ₹5000 from a list. Which Python feature is best suited?

a)

Tuples

b)

List slicing

c)

List comprehensions

d)

Sets

24.

What happens if `conn.commit()` is omitted?

a)

A) Data will still be saved permanently.

b)

B) Data will be lost after the connection is closed.

c)

C) An error will occur.

d)

D) The database file will be deleted

25.

An analyst loads a dataset with columns containing mixed types (numeric + string). He must convert them into consistent types before modeling. Which step is this?

a)

Type coercion

b)

Type imputation

c)

Type removal

d)

Type indexing

26.

Which SQL function is used to return the total number of rows in a query result?

a)

SUM()

b)

COUNT()

c)

TOTAL()

d)

NUMBER()

27.

A database table breaks 1NF rules with multivalued fields. What must be done?

a)

Remove duplicates

b)

Normalize structure

c)

Reorder rows

d)

Reintroduce foreign keys

28.

Which SQL keyword is used to combine the results of two queries?

a)

JOIN

b)

MERGE

c)

UNION

d)

COMBINE

29.

You receive a CSV file where the header row is missing. You manually add column names before processing. What is this action called?

a)

Data enrichment

b)

Data labeling

c)

Data merging

d)

Data augmentation

30.

What does the following SQL query do? SELECT name FROM students WHERE marks > 80 ORDER BY marks DESC;

a)

Returns the names of students who scored more than 80 marks, sorted in ascending order.

b)

Returns the names of students who scored more than 80 marks, sorted in descending order.

c)

Returns all student names sorted by marks.

d)

Returns all students who scored exactly 80 marks.

31.

A financial firm must ensure that daily transaction values follow business rules before storing them. What wrangling activity supports this?

a)

Data sampling

b)

Data validation

c)

Data mining

d)

Data aggregation

32.

Which Python library is used to work with JSON data?

a)

Jsonlib

b)

Simplejson

c)

Json

d)

jsonHandler

33.

While wrangling, you find duplicate entries that differ only by letter case (e.g., "Delhi" and "delhi"). Which transformation is required?

a)

Convert all entries to lowercase

b)

Remove all duplicates without transformation

c)

Sort entries alphabetically

d)

Replace spaces with underscores

34.

Which of the following is a process in NLP to reduce words to their root form?

a)

Normalization

b)

Segmentation

c)

Tokenization

d)

Standard encoding

35.

Consider the following Python SQL query execution: cur.execute('SELECT * FROM users WHERE age > ?', (30,)) What is the purpose of `(30,)` in this query?

a)

It is an incorrect syntax.

b)

It is a way to pass parameters safely to prevent SQL injection.

c)

It is used for table joins.

d)

It updates the database schema.

36.

Python code reading a CSV generates a UnicodeDecodeError. The file is encoded in UTF-16. Which change resolves it?

a)

Set encoding="UTF-16"

b)

Use delimiter=","

c)

Enable quoting

d)

Use strip()

37.

A Python beginner prints a string but receives an IndentationError. What is the most likely cause?

a)

Missing semicolon

b)

Wrong quotation

c)

Improper spacing/tab alignment

d)

Unclosed parentheses

38.

Which SQL command is used to add a new column to an existing table?

a)

ADD COLUMN

b)

ALTER TABLE ADD COLUMN

c)

MODIFY COLUMN

d)

CHANGE TABLE

39.

Which of the following is the correct way to delete a specific record from an SQL table?

a)

DELETE FROM users;

b)

DELETE FROM users WHERE id = 5;

c)

REMOVE FROM users WHERE id = 5;

d)

DROP FROM users WHERE id = 5;

40.

Which tool is most suitable for visualizing a database schema?

a)

SQL

b)

ER Diagram

c)

JSON Viewer

d)

XML Parser

41.

An XML file contains repeated nested nodes for "employee" inside multiple departments. You want to convert this to a normalized database schema. Which step is essential?

a)

Parsing root first

b)

Identifying repeating groups

c)

Removing attributes

d)

Trimming whitespace

42.

What method retrieves the root element in an XML tree?

a)

getroot()

b)

root()

c)

find()

d)

tree()

43.

Consider the Python SQLite query execution: cur.execute('DELETE FROM students WHERE age < ?', (18,)) What happens after this statement?

a)

All students are deleted.

b)

All students younger than 18 are deleted.

44.

A JSON dataset includes derived attributes that are redundant. You must remove them for efficiency. Which wrangling step is applied?

a)

Feature selection

b)

Feature scaling

c)

Feature duplication

d)

Feature isolation

45.

Your data pipeline receives corrupted JSON due to missing braces. Python raises a JSONDecodeError. Which library feature handles this?

a)

json.dump

b)

json.load

c)

try-except block

d)

json.parse

46.

Which SQL clause is used to remove duplicate values from query results?

a)

UNIQUE

b)

DISTINCT

c)

FILTER

d)

REMOVE

47.

Your system receives thousands of JSON records per hour, and you must validate structure quickly. Which approach is efficient?

a)

Manual inspection

b)

Automated schema validation

c)

Row filtering

d)

Data sorting

48.

A dataset has incorrect phone numbers that don't follow a pattern. You want to detect invalid ones. What can be used?

a)

Regex validation

b)

Metadata extraction

c)

Binning

d)

Indexing

49.

A retail dataset has many outlier values in the "Quantity" column. You evaluate whether to remove or cap them. Which step does this reflect?

a)

Data smoothing

b)

Outlier treatment

c)

Aggregation analysis

d)

Feature selection

50.

While integrating XML and JSON, you must detect whether both datasets refer to the same data concept. Which phase does this belong to?

a)

Schema mapping

b)

Data transformation

c)

Data scaling

d)

Data sorting

51.

A CSV file contains various encodings such as UTF-8 and ISO-8859. Python throws errors when reading them. What parameter helps resolve this?

a)

newline

b)

encoding

c)

quoting

d)

dialect

52.

Consider the following Python snippet: import sqlite3 conn = sqlite3.connect('mydb.db') What is the purpose of the 'conn' object in this code?

a)

It represents a connection to the SQLite database 'mydb.db'.

b)

It is used to execute SQL queries directly.

c)

It stores the results of a database query.

d)

It is a cursor object for iterating over query results.

53.

What does `cur.fetchone()` return?

a)

A list of all rows in the table

b)

A tuple containing the first row of the query result

c)

A dictionary mapping column names to values

d)

An error if the table is empty

54.

A logistic company merges data from trucks and drones. Each dataset describes location differently. Which issue must be fixed first?

a)

Cardinality mismatch

b)

Schema inconsistency

c)

Format translation

d)

Aggregation

55.

You have a JSON file listing students and their enrolled subjects as arrays. The analysis requires one subject per row. What transformation is needed?

a)

Explode operation

b)

Merge

c)

Slice

d)

Sort

56.

What is the purpose of `GROUP BY` in SQL?

a)

To filter records based on a condition

b)

To sort query results

c)

To group rows that have the same values in specified columns

d)

To delete duplicate rows

57.

Your CSV file uses semicolons (;) instead of commas. Python misreads it using default settings. Which parameter fixes this?

a)

sep

b)

prefix

c)

suffix

d)

comment

58.

A dataset contains age values such as “23 years”, “45yrs”, and “50”. You must extract only numeric values. Which technique helps?

a)

Hashing

b)

Regex extraction

c)

Windowing

d)

Token aggregation

59.

How is an element’s text accessed in an XML document in Python?

a)

a). element.text()

b)

b) . element.text

c)

c). get_text()

d)

d). element.getText()

60.

A large XML file loads very slowly using DOM parsing. Which alternative improves efficiency?

a)

SAX parsing

b)

JSON parsing

c)

Pandas parse

d)

HTML parsing

61.

Your team wants to identify whether columns in a dataset are primary keys or descriptive fields. Which process is required?

a)

Schema profiling

b)

Data sampling

62.

A CSV dataset includes trailing spaces like “Laptop ”. This affects joins with other datasets. Which transformation is appropriate?

a)

Padding

b)

Stripping

c)

Formatting

d)

Encoding

63.

What is the structure of an XML file?

a)

Key-value pairs

b)

Hierarchical tree

c)

Relational table

d)

Flat file

64.

Which SQL clause is used to filter query results based on a condition?

a)

WHERE

b)

ORDER BY

c)

GROUP BY

d)

HAVING

65.

A Python script concatenates strings and integers incorrectly, causing a TypeError. What is the solution?

a)

Remove concatenation

b)

Convert integer to string

c)

Use try-except

d)

Remove integers

66.

An automobile manufacturer wants to combine engine logs (CSV) and firmware logs (JSON) for fault analysis. Which Python library is best suited for reading both?

(a)  

67.

Which of the following is a Python library for data analysis?

a)

pandas

b)

pillow

c)

sklearn

68.

Consider the following SQL command: UPDATE employees SET salary = salary * 1.1 WHERE department = 'Sales'; What does this command do?

a)

Increases the salary of all employees.

b)

Increases the salary of employees in the Sales department by 10%.

c)

Decreases the salary of employees in the Sales department.

d)

Deletes employees from the Sales department.

69.

A JSON file contains keys in different orders, but you must compare structural integrity across files. Which concept is most relevant?

a)

Syntactic equality

b)

Structural schema validation

c)

Key sorting

d)

Literal parsing

70.

What does JSON stand for?

a)

JavaScript Online Notation

b)

JavaScript Object Notation

c)

JavaScript Object Network

d)

None of the above

71.

Which of the following is a valid way to execute an SQL query using Python SQLite module?

a)

cur.run('SELECT * FROM table')

b)

cur.query('SELECT * FROM table')

c)

cur.execute('SELECT * FROM table')

d)

cur.fetch('SELECT * FROM table')

72.

A streaming service collects logs with inconsistent timestamp formats. Analysts must unify the format.

a)

Data splitting

b)

Data standardization

c)

Data substitution

d)

Data augmentation

73.

What library is used to handle CSV files in Python?

a)

json

b)

os

c)

csv

d)

xml.etree.ElementTree

74.

A data engineer compares columns across tables to detect mismatched data types affecting joins.

a)

Data validation

b)

Data encoding

c)

Data enrichment

d)

Data sampling

75.

A student attempts to print multiple lines using Python triple quotes but mistakenly nests quotes incorrectly. What error type is expected?

a)

NameError

b)

SyntaxError

c)

RuntimeError

d)

ImportError

76.

A bank merges transaction logs but finds mismatched column sizes. Which wrangling task is required first?

a)

Alignment

b)

Extrapolation

c)

Sorting

77.

A dataset stores values like "Yes", "yes", and "YES" for the same meaning. Which transformation ensures consistency?

a)

Case normalization

b)

Standard encoding

c)

Feature extraction

d)

Value aggregation

78.

Consider the following Python snippet using SQLite: import sqlite3 conn = sqlite3.connect(':memory:') cur = conn.cursor() cur.execute('CREATE TABLE users (id INTEGER, name TEXT)') What does ':memory:' do in this code?

a)

Creates a database file named memory.db

b)

Stores the database in RAM instead of a file

c)

Clears all database data after execution

d)

Creates an encrypted SQLite database

79.

While creating a Python dictionary, a beginner repeats a key unknowingly. The dictionary stores only the last value. What Python property explains this?

a)

Ordered collection

b)

Mutable nature

c)

Unique key constraint

d)

Immutable keys

80.

Your JSON dataset uses arrays for employee skills. You need counts of skills per employee. Which transformation is required?

a)

Length calculation

b)

Array flattening

c)

Feature extraction

81.

A JSON API response contains both mandatory and optional fields. You must verify the fields before using them. What should you perform?

a)

Schema checking

b)

Encoding

c)

Parsing

d)

Transformation

82.

An analyst loads employee data but the “Salary” column has values like “NA”, “NULL”, and blanks. Which cleaning step comes first?

a)

Missing value unification

b)

Outlier removal

c)

Discretization

d)

Enrichment

83.

How do you create a comment in Python?

a)

# This is a comment

b)

// This is a comment

c)

/* This is a comment */

d)

84.

Python list operations on a large dataset perform slowly. You decide to switch to NumPy arrays. Which benefit are you utilizing?

a)

Recursive operations

b)

Vectorized computation

c)

Memory segmentation

d)

Automatic parsing

85.

How do you parse a JSON string in Python?

a)

json.parse()

b)

json.load()

86.

Which of the following is used to parse a JSON string into a Python dictionary?

a)

json.loads()

b)

json.read()

87.

A dataset contains a column with mixed data types (strings and numbers). Which pandas function helps convert the entire column to a single numeric type while handling errors?

a)

pd.to_numeric(column, errors='coerce')

b)

pd.to_string(column)

c)

pd.astype(column, dtype=int)

d)

column.astype(int)

88.

You find that a dataset's “Salary” field stored as a string includes commas, like “40,000”. Which step should you perform to convert it to numeric?

a)

Remove punctuation

b)

Indexing

c)

Sorting

d)

Resampling

89.

Consider the following Python snippet: import pandas as pd data = {'ID': [1, 2, 3], 'Name': ['A', 'B', 'C']} df = pd.DataFrame(data) df.to_csv('output.csv', index=False) What will be the result?

a)

A CSV file named 'output.csv' with an extra index column

b)

A CSV file named 'output.csv' without an index column

c)

A JSON file named 'output.csv'

d)

An XML file named 'output.csv'

90.

An XML structure contains optional tags that are missing in several entries. Which step is required before loading into a database?

a)

Add NULL placeholders

b)

Trim whitespace

91.

C) Remove attributes D) Minify XML

a)

A

b)

B

c)

C

d)

D