Web Databases and Applications # MCQs Practice set

Q.1 What is a web database primarily used for?

Storing files locally on a computer
Managing and retrieving data via web applications
Running standalone desktop applications
Designing graphics for websites
Explanation - A web database allows web applications to store, manage, and retrieve dynamic data over the internet.
Correct answer is: Managing and retrieving data via web applications

Q.2 Which language is commonly used to query a web database?

HTML
SQL
CSS
JavaScript only
Explanation - SQL (Structured Query Language) is used to query and manipulate databases, including those used in web applications.
Correct answer is: SQL

Q.3 Which of the following is a common server-side scripting language for web databases?

PHP
HTML
CSS
React
Explanation - PHP is a widely used server-side scripting language that interacts with databases to generate dynamic web content.
Correct answer is: PHP

Q.4 What does CRUD stand for in web databases?

Create, Read, Update, Delete
Copy, Run, Upload, Download
Connect, Render, Update, Display
Compile, Run, Undo, Debug
Explanation - CRUD represents the four basic operations performed on data in a database: Create, Read, Update, and Delete.
Correct answer is: Create, Read, Update, Delete

Q.5 Which of the following is NOT a relational database commonly used in web applications?

MySQL
PostgreSQL
MongoDB
Oracle
Explanation - MongoDB is a NoSQL database and does not use relational tables, unlike MySQL, PostgreSQL, and Oracle.
Correct answer is: MongoDB

Q.6 AJAX in web applications is used to:

Style web pages dynamically
Load data asynchronously without refreshing the page
Manage server security
Create offline desktop applications
Explanation - AJAX allows web applications to fetch data from the server in the background, updating the web page dynamically.
Correct answer is: Load data asynchronously without refreshing the page

Q.7 Which HTTP method is commonly used to send data to a web database?

GET
POST
PUT
DELETE
Explanation - POST requests are used to send data to the server, often to be stored in a web database.
Correct answer is: POST

Q.8 What is the main advantage of using a web database over a static database?

Static appearance of web pages
Dynamic content generation and user interaction
Requires no server
No need for scripting languages
Explanation - Web databases allow websites to generate dynamic content that responds to user input and interactions.
Correct answer is: Dynamic content generation and user interaction

Q.9 Which of the following is a key feature of a web application connected to a database?

Offline-only usage
Interactive and dynamic data presentation
Static HTML pages only
Requires no backend server
Explanation - Web applications use databases to provide interactive, dynamic content based on user input or other data sources.
Correct answer is: Interactive and dynamic data presentation

Q.10 What role does a web server play in web databases?

Hosts web pages and handles requests to interact with the database
Stores all user data locally on their machine
Styles the web page using CSS
Provides only offline access to data
Explanation - A web server processes HTTP requests, serves web pages, and connects to the backend database to retrieve or store data.
Correct answer is: Hosts web pages and handles requests to interact with the database

Q.11 Which of the following best describes a dynamic web page?

A page that changes content based on user input or database data
A page with fixed content
A page without any HTML
A page that can only be accessed offline
Explanation - Dynamic web pages pull data from databases or user interactions to update the displayed content in real-time.
Correct answer is: A page that changes content based on user input or database data

Q.12 What is the main purpose of using a session in web applications?

To store temporary user-specific data between page requests
To permanently store user data in the database
To style the web page dynamically
To manage server logs
Explanation - Sessions help maintain user-specific data like login status or preferences during their interaction with a web application.
Correct answer is: To store temporary user-specific data between page requests

Q.13 Which of these is an example of a NoSQL database used in web applications?

MySQL
MongoDB
Oracle
PostgreSQL
Explanation - MongoDB is a NoSQL database commonly used in web applications for flexible schema and scalability.
Correct answer is: MongoDB

Q.14 What is the function of middleware in web database applications?

It connects the web server with the database
It styles the front-end interface
It hosts static HTML pages
It manages only client-side scripts
Explanation - Middleware serves as an intermediary to facilitate communication between the web server and the database backend.
Correct answer is: It connects the web server with the database

Q.15 Which of the following is a key security concern in web databases?

SQL injection attacks
High-quality graphics
Faster loading fonts
Offline storage only
Explanation - SQL injection is a common web database security threat where attackers can manipulate queries to access or modify unauthorized data.
Correct answer is: SQL injection attacks

Q.16 RESTful APIs in web applications are mainly used to:

Provide a standard way to interact with databases over HTTP
Design the frontend layout
Compress images for the web
Encrypt server files
Explanation - REST APIs allow web applications to send requests and receive responses from a database or server using standard HTTP methods.
Correct answer is: Provide a standard way to interact with databases over HTTP

Q.17 Which of the following helps improve web database performance?

Indexing database tables
Using only static HTML pages
Avoiding database queries
Storing all data in text files
Explanation - Indexes improve the speed of data retrieval operations on database tables, enhancing web application performance.
Correct answer is: Indexing database tables

Q.18 In web applications, cookies are used to:

Store small pieces of data on the client side
Perform server-side calculations
Replace database tables
Style the user interface
Explanation - Cookies store data like user preferences or session identifiers on the client’s browser to maintain state.
Correct answer is: Store small pieces of data on the client side

Q.19 Which component is NOT part of a typical web database architecture?

Web server
Database server
Client browser
Compiler
Explanation - A compiler is not a component in web database architecture; typical components include client, web server, and database server.
Correct answer is: Compiler

Q.20 Which of the following is true about server-side scripting?

It runs on the client’s browser
It runs on the web server and can interact with databases
It does not interact with databases
It is used only for styling web pages
Explanation - Server-side scripts execute on the server to handle requests, generate dynamic content, and interact with databases.
Correct answer is: It runs on the web server and can interact with databases

Q.21 Which of the following ensures data integrity in a web database?

Constraints and validations
Using multiple fonts
Adding more images
Storing data in text files only
Explanation - Constraints and validations ensure that the data entered into the database meets certain rules, maintaining data integrity.
Correct answer is: Constraints and validations

Q.22 Which is the main difference between static and dynamic web pages?

Static pages do not change content; dynamic pages change based on user or database data
Static pages are interactive; dynamic pages are not
Static pages use JavaScript; dynamic pages do not
There is no difference
Explanation - Static web pages display fixed content, while dynamic pages retrieve and display data from databases or user input.
Correct answer is: Static pages do not change content; dynamic pages change based on user or database data

Q.23 Which web database model stores data in JSON-like documents?

Relational database
Document-oriented NoSQL database
Hierarchical database
Network database
Explanation - Document-oriented NoSQL databases, like MongoDB, store data as JSON-like documents for flexibility and scalability.
Correct answer is: Document-oriented NoSQL database

Q.24 Which of the following helps in maintaining user authentication across web sessions?

Sessions and cookies
HTML tags
CSS styling
Static images
Explanation - Sessions and cookies track user authentication status and preferences across multiple requests in web applications.
Correct answer is: Sessions and cookies

Q.25 Which of these is a common method to prevent SQL injection in web databases?

Parameterized queries or prepared statements
Using more images
Adding CSS frameworks
Minimizing HTML files
Explanation - Parameterized queries prevent SQL injection by separating SQL code from user inputs, ensuring safe database access.
Correct answer is: Parameterized queries or prepared statements