NEW
Font size
WorksheetsPHP-Midterm Exam
Total questions: 60
Worksheet time: 3600secs
Which PHP function is used to execute SQL queries?
mysqli_query()
mysql_query()
pdo_query()
sql_query()
It is a collection of 1024 Terabytes
Exabyte
Petabyte
Zettabyte
Yottabyte
Which of the following is used to retrieve data from a MySQL database?
mysqli_fetch_array()
mysql_fetch_all()
pdo_fetch_all()
mysqli_query()
Which of the following is used to establish a connection to a MySQL database?
mysqli_connect()
mysql_connect()
pdo_connect()
sql_connect()
Which of the following is used to initialize your session?
session_close()
session_start()
session_unset()
session_destroy()
Which of the following is used to retrieve the number of rows in a result set?
mysqli_num_rows()
mysql_num_rows()
pdo_num_rows()
sql_num_rows()
Which SQL statement is used to extract data from a database?
SELECT
INSERT
UPDATE
DELETE
Which SQL statement is used to insert new data in a database?
INSERT INTO
INSERT NEW
INSERT VALUE
ADD NEW
It is a collection of bytes in Database
Field
Bit
Record
File
What is the total number of rows in MS Excel 2016 or 2019
1,048,576
16,384
255
31
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
SELECT * FROM Persons WHERE FirstName='Peter'
SELECT [all] FROM Persons WHERE FirstName='Peter'
SELECT * FROM Persons WHERE FirstName<>'Peter'
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
SELECT * FROM Persons WHERE FirstName='a'
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
SELECT * FROM Persons WHERE FirstName='%a%'
SELECT * FROM Persons WHERE FirstName LIKE '%a'
What is the number of columns in MS Excel 2016 or 2019?
16,384
1,048,576
8192
31
What is the official mySQL logo?
Sakila
Sakira
BonJov
MariaDB
Which SQL keyword is used to sort the result-set?
ORDER
SORT BY
ORDER BY
SORT
With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
SELECT * FROM Persons ORDER BY FirstName DESC
SELECT * FROM Persons SORT BY 'FirstName' DESC
SELECT * FROM Persons SORT 'FirstName' DESC
SELECT * FROM Persons ORDER FirstName DESC
With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
INSERT INTO Persons (LastName) VALUES ('Olsen')
INSERT ('Olsen') INTO Persons (LastName)
INSERT INTO Persons ('Olsen') INTO LastName
The NOT NULL constraint enforces a column to not accept NULL values.
True
False
Which operator is used to search for a specified pattern in a column?
FROM
LIKE
GET
What does PHP stands for?
PHP: Hypertext Preprocessor
Private Home Page
Personal Hypertext Processor
Which among the following is the correct delimiters that surround PHP server scripts?
<?php>...</?>
<script>...</script>
<?php...?>
<&>...</&>
How do you get information from a form that is submitted using the "get" method?
Request.QueryString;
$_GET[];
Request.Form;
$_POST[];
When using the POST method, variables are displayed in the URL:
True
False
The if statement is used to execute some code only if a specified condition is true
True
False
How is PHP written into a webpage?
Just like other html tags: <php> </php>
Only in a separate file which is linked to the html page
Using curled brackets {php} {/php}
A PHP script starts with <?php and ends with ?>
PHP script is parsed....
On the client's web browser
On the server where the website is hosted
On the client's CPU
On the Internet
PHP is case sensitive in what way?
It's never case sensitive, don't worry about it.
Only when referring to variables
When referring to classes, functions or variables
All the time!
When concatenating strings, you use what symbol in PHP?
A comma ,
A plus sign +
a hyphen -
a period .
The updated MySQL extension with PHP5 is typically referred to as
MySQL
mysql
mysqli
mysqly
Which method is responsible for sending the query to the database?
query()
send_query()
sendquery()
query_send()
Which will input data into a table?
INSERT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
INPUT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
INSERT INTO table CATEGORIES(name, height, weight) VALUES('strand', '6ft 2in', '165')
INSERT INTO table CATEGORIES(name, height, weight) ('strand', '6ft 2in', '165')
If I want to show all data in a MySQL table, I would use
SHOW * FROM table;
SELECT * FROM table;
SHOW * IN table;
SELECT * IN table;
A collection of interrelated files is
Database
File
Record
Byte
Which of the following can add a row to a table?
Add
Insert
Update
Alter
What does SQL stand for?
Structured Query Language
Structured Question Language
Strong Question Language
None of the above
SQL is not case sensitive. SELECT is the same as select.
TRUE
FALSE
Which SQL Select special character used to refer to all columns?
*
/
**
()
With SQL, how do you select all the columns from a table named "Persons"?
SELECT * FROM Persons
SELECT Persons
SELECT [all] FROM Persons
SELECT *.Persons
SQL can be used to:
Create database structures only.
Query database data only.
Modify database data only.
All of the above can be done by SQL.
Which clause is used to “Filters out unwanted data”?
FROM
SELECT
ORDER BY
WHERE
Which is the default order of sort in ORDER BY clause?
Ascending
Descending
Write a query to display first_name and last_name of all employees who have their first_name starting with 'A'.
Select first_name from employess where first_name, last_name LIKE '%A';
Select first_name from employess where first_name, last_name LIKE "'A'%";
Select first_name, last_name from employess where first_name LIKE 'A%';
Select first_name from employess where first_name, last_name LIKE '%A%';
It is said that the web operates on a ______ model, where the client is the web browser and the server is the computer providing, or serving, the information.
client-server
peer-to-peer
business
website
A ______ is special software that knows how to open and interpret web pages. Web browsers also know how to contact web servers to get information.
web server
webinar
web browser
static web
A _______ is special software that knows how to respond to requests for web pages.
web browser
web server
web client
web database
What is HTML stands for?
Hyperlink Transfer Protocol
Hypertext Transfer Protocol
How To Make Lumpia
Hypertext Transfer Potocol
_______ is a popular and powerful language used for programming server-side programs
CSS
HTML
Mysql
PHP
______ is a popular and free database system that can store information and then integrate with PHP to create a fully functional web application.
mySQL
MS ACCESS
Logbook
MSQL
To hold data, you use a variable, which keeps track of the data that you tell it to store for the lifetime of your program.
TRUE
FALSE
______are expressions that PHP tests or evaluates to see whether they are true or false.
Looping
Switch
Conditions
Break
A data stored in the end-user computer
session
cookies
tmp
database
PHP Cookies is more secure than PHP Session
TRUE
FALSE
A ______ is a way to store information (in variables) to be used across multiple pages.
Post
Session
Server
Meta
This function used to include the code contained in a PHP file within another PHP file event program has script errors
require()
join()
include()
associate()
Which function used to output a message and terminate the current script?
stop()
exit()
end()
session_close()
One of the founders of mySQL
Michael Widenius
Dennis Ritchie
Rasmus Lerdorf
Allan Manio
