PHP Database Multiple Choice Questions

1)
Which of the following DBMSs do not have a native PHP extension?

A) MySQL
B) IBM DB/2
C) PostgreSQL
D) Microsoft SQL Server
E) None of the above

2)
In PHP in order to access MySQL database you will use:

A) mysqlconnect() function
B) mysql-connect() function
C) mysql_connect() function
D) sql_connect() function

3)
Transactions are used to treat sets of SQL statements atomically.

A) True
B) False

4)
SQL is not case sensitive. SELECT is the same as select.

A) True
B) False

5)
Which of the following is not an SQL aggregate function?

A) AVG
B) SUM
C) MIN
D) MAX
E) CURRENT_DATE()

6)
What does the DESC keyword do in the following query?

SELECT *
FROM MY_TABLE
WHERE ID > 0
ORDER BY ID, NAME DESC

A) It causes the dataset returned by the query to be sorted in descending order
B) It causes rows with the same ID to be sorted by NAME in ascending order
C) It causes rows with the same ID to be sorted by NAME in descending order
D) It causes rows to be sorted by NAME first and then by ID
E) It causes the result set to include a description of the NAME field

7)
The ............. statement is used to delete a table.

A) DROP TABLE
B) DELETE TABLE
C) DEL TABLE
D) REMOVE TABLE

8)
What will happen at the end of the following sequence of SQL commands?

BEGIN TRANSACTION
DELETE FROM MYTABLE WHERE ID=1
DELETE FROM OTHERTABLE
ROLLBACK TRANSACTION

A) The contents of OTHERTABLE will be deleted
B) The contents of both OTHERTABLE and MYTABLE will be deleted
C) The contents of OTHERTABLE will be deleted, as will be all the contents of MYTABLE whose ID is 1
D) The database will remain unchanged to all users except the one that executes these queries.
E) The database will remain unchanged

9)
Use the .............. to delete the data inside the table, and not the table itself?

A) DROP TABLE
B) DELETE TABLE
C) TRUNCATE TABLE
D) REMOVE TABLE

10)
Can joins be nested?

A) True
B) False

Answers