Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.
Databases for Web ApplicationsEasy
Q1. What is MySQL?
- A.A CSS framework for responsive web page layouts
- B.A web server for hosting application endpoints
- C.An open-source relational database management system✓ Correct
- D.A JavaScript library for building web interfaces
Explanation
MySQL is a popular open-source RDBMS that uses SQL.
Report an error in this question
Databases for Web ApplicationsEasy
Q2. What is MongoDB?
- A.A NoSQL document database storing JSON-like data✓ Correct
- B.A CSS framework for building styled components
- C.A web server for serving static content files
- D.A SQL relational database using table schemas
Explanation
MongoDB stores data in flexible, JSON-like BSON documents.
Report an error in this question
Databases for Web ApplicationsEasy
Q3. What does SQL stand for?
- A.Simple Query Language
- B.Structured Query Language✓ Correct
- C.Server Query Logic
- D.Standard Question Language
Explanation
SQL stands for Structured Query Language.
Report an error in this question
Databases for Web ApplicationsEasy
Q4. Which SQL command retrieves data?
- A.RETRIEVE
- B.FETCH
- C.GET
- D.SELECT✓ Correct
Explanation
The SELECT statement retrieves data from database tables.
Report an error in this question
Databases for Web ApplicationsEasy
Q5. What is a primary key?
- A.The first column created in a database table
- B.A password used for database authentication
- C.A unique identifier for each record in a table✓ Correct
- D.A foreign key linking to another related table
Explanation
A primary key uniquely identifies each record in a table.
Report an error in this question
Databases for Web ApplicationsEasy
Q6. What SQL command inserts new data?
- A.CREATE INTO
- B.ADD INTO
- C.INSERT INTO✓ Correct
- D.PUT INTO
Explanation
INSERT INTO adds new records to a database table.
Report an error in this question
Databases for Web ApplicationsEasy
Q7. What is a table in a relational database?
- A.A JavaScript object for storing key-value pairs
- B.A CSS grid for laying out page components
- C.An HTML table element for displaying data
- D.A structured collection of rows and columns✓ Correct
Explanation
A database table organizes data into rows and columns with a defined schema.
Report an error in this question
Databases for Web ApplicationsEasy
Q8. What is PostgreSQL?
- A.A CSS preprocessor for advanced style features
- B.An advanced open-source relational database system✓ Correct
- C.A JavaScript framework for building web apps
- D.A web browser for viewing internet content
Explanation
PostgreSQL is a powerful, open-source object-relational database.
Report an error in this question
Databases for Web ApplicationsEasy
Q9. What SQL command deletes data?
- A.DESTROY
- B.DELETE✓ Correct
- C.DROP DATA
- D.REMOVE
Explanation
The DELETE command removes records from a database table.
Report an error in this question
Databases for Web ApplicationsEasy
Q10. What is a database schema?
- A.The structure defining data organization and relations✓ Correct
- B.An HTML template for rendering dynamic page content
- C.A JavaScript object for storing config data
- D.A CSS layout blueprint for page structure
Explanation
A schema defines the database structure: tables, columns, data types, and relationships.
Report an error in this question
Databases for Web ApplicationsMedium
Q11. What is a foreign key?
- A.A column linking two tables via another primary key✓ Correct
- B.A key imported from another country or locale
- C.An encrypted key used for securing data at rest
- D.A backup key for recovering lost database records
Explanation
A foreign key establishes a relationship between tables.
Report an error in this question
Databases for Web ApplicationsMedium
Q12. What is database indexing?
- A.Creating structures that speed up data retrieval✓ Correct
- B.Numbering database rows in sequential order
- C.Organizing files on disk for better storage
- D.A CSS technique for ordering layout elements
Explanation
An index creates a data structure that allows the database to find rows faster.
Report an error in this question
Databases for Web ApplicationsMedium
Q13. What is a JOIN in SQL?
- A.A JavaScript method for merging arrays together
- B.Combining multiple CSS files into a single bundle
- C.A string concatenation operator for joining text
- D.A clause combining rows from tables based on columns✓ Correct
Explanation
JOIN combines rows from multiple tables based on a related column.
Report an error in this question
Databases for Web ApplicationsMedium
Q14. What is the difference between INNER JOIN and LEFT JOIN?
- A.LEFT JOIN returns only the matching rows from both sources
- B.They are identical in their result sets
- C.INNER JOIN includes NULL values from non-matching entries
- D.INNER returns matches only; LEFT returns all left rows plus matches✓ Correct
Explanation
INNER JOIN returns only matching rows, while LEFT JOIN returns all left table rows.
Report an error in this question
Databases for Web ApplicationsMedium
Q15. What is database normalization?
- A.Normalizing CSS values for cross-browser consistency
- B.Formatting JSON data for human-readable pretty output
- C.Making data look normal in the display output
- D.Organizing data to reduce redundancy via normal forms✓ Correct
Explanation
Normalization organizes tables to minimize data redundancy.
Report an error in this question
Databases for Web ApplicationsMedium
Q16. What is an ODM?
- A.A JavaScript operator for object comparison
- B.A CSS framework for responsive layout design
- C.A type of relational database engine
- D.Object-Document Mapper for objects and NoSQL docs✓ Correct
Explanation
An ODM like Mongoose maps application objects to database documents.
Report an error in this question
Databases for Web ApplicationsMedium
Q17. What is a transaction in databases?
- A.A CSS transition for animating property changes
- B.A data transfer between server and client machines
- C.A sequence of operations treated as a single unit✓ Correct
- D.A financial payment between two bank accounts
Explanation
A transaction groups operations into an atomic unit.
Report an error in this question
Databases for Web ApplicationsMedium
Q18. What are ACID properties?
- A.A type of document-oriented database engine system for storing data
- B.A security protocol for encrypting network traffic between services
- C.Atomicity, Consistency, Isolation, Durability for reliable transactions✓ Correct
- D.A chemistry concept related to pH levels
Explanation
ACID ensures transactions are Atomic, Consistent, Isolated, and Durable.
Report an error in this question
Databases for Web ApplicationsMedium
Q19. What is Redis commonly used for?
- A.As a primary database for all application data
- B.As an in-memory store for caching and sessions✓ Correct
- C.As a CSS preprocessor for compiling styles
- D.As a web server for hosting static content
Explanation
Redis is an in-memory store used for caching, sessions, and rate limiting.
Report an error in this question
Databases for Web ApplicationsMedium
Q20. What is SQL injection?
- A.A vulnerability where malicious SQL is inserted into queries✓ Correct
- B.A database optimization technique for faster lookups
- C.A JavaScript technique for dynamically building queries
- D.Injecting CSS styles into SQL query statements
Explanation
SQL injection exploits unsanitized user input to inject malicious SQL.
Report an error in this question
Databases for Web ApplicationsHard
Q21. What is database sharding?
- A.Encrypting data for security and privacy compliance
- B.Compressing tables to reduce disk storage space
- C.Splitting a database into smaller distributed pieces✓ Correct
- D.Breaking a database beyond repair permanently
Explanation
Sharding horizontally partitions data across multiple servers.
Report an error in this question
Databases for Web ApplicationsHard
Q22. What is the difference between horizontal and vertical partitioning?
- A.Horizontal splits columns; vertical splits rows across servers
- B.Neither approach has any effect on query performance
- C.Horizontal splits rows across servers; vertical splits columns✓ Correct
- D.They are identical in partitioning strategy
Explanation
Horizontal partitioning distributes rows, while vertical partitioning separates columns.
Report an error in this question
Databases for Web ApplicationsHard
Q23. What is eventual consistency?
- A.A CSS consistency model for cross-browser rendering
- B.Data is always immediately consistent everywhere
- C.All replicas converge to the same value given enough time✓ Correct
- D.Data is never consistent across any of the replicas
Explanation
Eventual consistency guarantees all replicas will eventually converge to the same value.
Report an error in this question
Databases for Web ApplicationsHard
Q24. What is a database migration?
- A.A data backup process for disaster recovery planning
- B.A CSS migration from one framework to another tool
- C.Version-controlled changes to schema that can be rolled back✓ Correct
- D.Moving a database to a new physical data center
Explanation
Migrations modify the schema in a version-controlled way.
Report an error in this question
Databases for Web ApplicationsHard
Q25. What is the N+1 query problem and how is it solved?
- A.A JavaScript error caused by off-by-one array access
- B.A CSS specificity issue with deeply nested selectors
- C.A mathematical formula for calculating query cost
- D.N extra queries for related data; solved by eager loading✓ Correct
Explanation
The N+1 problem is solved using eager loading, JOINs, or batching queries.
Report an error in this question
Databases for Web ApplicationsHard
Q26. What is a materialized view?
- A.A database object storing query results physically✓ Correct
- B.A CSS view for presenting styled HTML content
- C.A template engine view for generating dynamic pages
- D.A JavaScript view for rendering reactive UI components
Explanation
A materialized view pre-computes and stores query results as a physical table.
Report an error in this question
Databases for Web ApplicationsHard
Q27. What is connection pooling in database management?
- A.A swimming pool database for aquatic records
- B.A CSS pooling technique for shared style rule resources
- C.A JavaScript object pool for reusing DOM element references
- D.Maintaining reusable connections to avoid per-request overhead✓ Correct
Explanation
Connection pooling reuses established database connections from a pool.
Report an error in this question
Databases for Web ApplicationsHard
Q28. What is a write-ahead log (WAL)?
- A.A CSS log file for tracking style computation results
- B.A blogging technique for writing web content
- C.Changes are written to a log before applying to the DB✓ Correct
- D.A JavaScript console log for outputting debug messages
Explanation
WAL records modifications to a log file before applying them to the database.
Report an error in this question
Databases for Web ApplicationsHard
Q29. What is database replication?
- A.A backup tool for creating periodic data archive snapshots
- B.A version control system for tracking file change history
- C.Copying and maintaining data across servers for redundancy✓ Correct
- D.Copying CSS files across multiple project directories
Explanation
Replication copies data across servers for fault tolerance and high availability.
Report an error in this question
Databases for Web ApplicationsHard
Q30. What is the difference between optimistic and pessimistic locking?
- A.They only apply to NoSQL databases not relational ones
- B.They are identical in concurrency control approach
- C.Optimistic always locks; pessimistic never locks anything
- D.Optimistic checks at commit; pessimistic locks immediately✓ Correct
Explanation
Optimistic checks conflicts at write time, while pessimistic acquires locks before reading.
Report an error in this question