Web Application Development MCQs with Answers
Practice important Web Application Development MCQs with answers and explanations.
Chapter: 10
Q121:
Which of the following is NOT a MySQL tool mentioned?
A. XAMPP
B. WAMP
C. PhpMyAdmin
D. PostgreSQL
Correct Answer:
D
Chapter: 10
Q122:
Fill in the blank: The PHP MySQL extension mysqli is an improvement over the _______ extension.
A. MySQL
B. PDO
C. SQLite
D. MongoDB
Correct Answer:
A
Chapter: 10
Q123:
What does the SQL statement CREATE DATABASE mystudent; do?
A. Creates a new database named 'mystudent'
B. Deletes the 'mystudent' database
C. Modifies the 'mystudent' database
D. Selects the 'mystudent' database
Correct Answer:
A
Chapter: 11
Q124:
What SQL statement is used to create a table in MySQL?
A. CREATE DATABASE
B. CREATE TABLE
C. INSERT INTO
D. ALTER TABLE
Correct Answer:
B
Chapter: 11
Q125:
Fill in the blank: The CREATE TABLE statement in MySQL is used to _______.
A. delete a table
B. update a table
C. create a new table
D. drop a table
Correct Answer:
C
Chapter: 11
Q126:
Which MySQL data type is used for timestamps?
A. TIMESTAMP
B. DATE
C. VARCHAR
D. INT
Correct Answer:
A
Chapter: 11
Q127:
Fill in the blank: The SQL statement INSERT INTO student (firstname, lastname, email) VALUES ('Ali', 'Wali', 'ali@example.com') will _______.
A. delete a record
B. update a record
C. insert a new record
D. select a record
Correct Answer:
C
Chapter: 11
Q128:
What function retrieves the last inserted ID in MySQL?
A. mysqli_insert_id()
B. mysqli_last_id()
C. mysqli_get_id()
D. mysqli_id()
Correct Answer:
A
Chapter: 11
Q129:
Fill in the blank: To handle multiple SQL statements, the _______ function is used in PHP.
A. mysqli_multi_query()
B. mysqli_query()
C. mysqli_exec()
D. mysqli_execute()
Correct Answer:
A
Chapter: 11
Q130:
In a prepared statement, what does the bind_param() function do?
A. Prepares the SQL statement
B. Binds parameters to the SQL statement
C. Executes the SQL statement
D. Closes the SQL statement
Correct Answer:
B
Chapter: 11
Q131:
Fill in the blank: The mysqli_connect() function is used to _______.
A. create a new database
B. connect to a MySQL database
C. create a table in a database
D. insert data into a table
Correct Answer:
B
Chapter: 11
Q132:
What attribute in MySQL is used to ensure a column value is unique for each row?
A. AUTO_INCREMENT
B. UNIQUE
C. NOT NULL
D. PRIMARY KEY
Correct Answer:
B
Chapter: 11
Q133:
Fill in the blank: The mysqli_prepare() function is used to _______.
A. create a table
B. execute an SQL statement
C. prepare an SQL statement
D. retrieve data from a table
Correct Answer:
C
Chapter: 11
Q134:
Which function is used to execute an SQL statement that includes multiple queries?
A. mysqli_query()
B. mysqli_execute()
C. mysqli_multi_query()
D. mysqli_run()
Correct Answer:
C
Chapter: 11
Q135:
Fill in the blank: To specify that a column should automatically increment, use the _______ attribute.
A. AUTO_INCREMENT
B. TIMESTAMP
C. UNIQUE
D. PRIMARY KEY
Correct Answer:
A
Chapter: 12
Q136:
What does the SELECT * FROM table_name statement do in MySQL?
A. Selects all columns from a table
B. Updates all records in a table
C. Deletes all records from a table
D. Creates a new table
Correct Answer:
A
Chapter: 12
Q137:
Fill in the blank: The SQL DELETE FROM table_name WHERE some_column = some_value statement is used to _______.
A. select records
B. update records
C. delete records
D. create records
Correct Answer:
C
Chapter: 12
Q138:
Which SQL statement is used to modify existing records in a table?
A. DELETE
B. INSERT
C. UPDATE
D. CREATE
Correct Answer:
C
Chapter: 12
Q139:
Fill in the blank: The mysqli_fetch_assoc() function is used to _______.
A. insert data into a table
B. fetch a result row as an associative array
C. delete records from a table
D. update records in a table
Correct Answer:
B
Chapter: 12
Q140:
What is the purpose of the WHERE clause in SQL statements?
A. To limit the number of records returned
B. To specify which records to select
C. To delete all records from a table
D. To update the structure of a table
Correct Answer:
B