📲 Download Utility Tools Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

placement-level MCQ test (PHP + MySQL PDO)

🧠 MCQ Test: PHP + MySQL (PDO)

🔹 Section A: Basics (1–10)

1. What does PDO stand for?
A) PHP Database Object
B) PHP Data Object
C) Personal Data Object
D) Program Data Object


2. Which function is used to connect PDO?
A) mysqli_connect()
B) new PDO()
C) connect_db()
D) db_open()


3. Which fetch mode returns associative array?
A) PDO::FETCH_NUM
B) PDO::FETCH_ASSOC
C) PDO::FETCH_OBJ
D) PDO::FETCH_BOTH


4. What does AUTO_INCREMENT do?
A) Deletes rows
B) Increases value automatically
C) Encrypts data
D) Joins tables


5. Which SQL command is used to read data?
A) INSERT
B) UPDATE
C) SELECT
D) DELETE


6. Which method executes prepared statement?
A) run()
B) execute()
C) query()
D) start()


7. Which is NOT a CRUD operation?
A) CREATE
B) READ
C) MODIFY
D) DELETE


8. Which is correct PDO DSN format?
A) mysql://localhost/db
B) mysql:host=localhost;dbname=test
C) localhost:mysql:test
D) db:mysql://localhost


9. Which function fetches single row?
A) fetch()
B) fetchAll()
C) get()
D) row()


10. Which function returns last inserted ID?
A) getLastId()
B) lastInsertId()
C) insertId()
D) lastId()


🔹 Section B: Intermediate (11–20)

11. Prepared statements help prevent?
A) Syntax error
B) SQL Injection
C) Server crash
D) Memory leak


12. Which symbol is used in named parameters?
A) ?
B) :
C) @
D) #


13. bindParam() binds by?
A) Value
B) Reference
C) Copy
D) Pointer


14. Which is safer?
A) Direct query
B) Prepared statement
C) Echo SQL
D) None


15. What does rowCount() return?
A) Columns
B) Tables
C) Affected rows
D) Errors


16. Which JOIN returns all rows from left table?
A) INNER JOIN
B) RIGHT JOIN
C) LEFT JOIN
D) FULL JOIN


17. Which is used for error handling?
A) try-catch
B) echo
C) die()
D) print()


18. Which function hashes password?
A) md5()
B) hash()
C) password_hash()
D) encrypt()


19. Which verifies password?
A) password_check()
B) password_verify()
C) verify_pass()
D) check_hash()


20. Index is used for?
A) Delete data
B) Speed up query
C) Insert data
D) Backup


🔹 Section C: Advanced (21–30)

21. Transaction starts with?
A) start()
B) beginTransaction()
C) open()
D) init()


22. Which method saves transaction?
A) save()
B) commit()
C) push()
D) execute()


23. Which undoes transaction?
A) cancel()
B) rollback()
C) undo()
D) reverse()


24. VARCHAR is?
A) Fixed length
B) Dynamic length
C) Integer
D) Boolean


25. CHAR is?
A) Dynamic
B) Fixed
C) Float
D) Object


26. ACID stands for?
A) Atomic, Consistent, Isolated, Durable
B) Active, Clear, Indexed, Data
C) Auto, Control, Input, Data
D) None


27. Which is faster for large data?
A) No index
B) Index
C) Random query
D) SELECT *


28. SQL Injection occurs when?
A) Query too fast
B) User input not sanitized
C) DB full
D) Server slow


29. LIMIT is used for?
A) Delete rows
B) Restrict results
C) Join tables
D) Insert rows


30. Which is best practice?
A) Plain SQL
B) Prepared statements
C) Hardcoded values
D) No validation


Answer Key

1-B   2-B   3-B   4-B   5-C
6-B 7-C 8-B 9-A 10-B11-B 12-B 13-B 14-B 15-C
16-C 17-A 18-C 19-B 20-B21-B 22-B 23-B 24-B 25-B
26-A 27-B 28-B 29-B 30-B

🎯 Score Evaluation

  • 25–30 → 🔥 Job Ready
  • 18–24 → 👍 Good, revise advanced
  • 10–17 → ⚠️ Needs practice
  • <10 → ❌ Learn basics again


AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes