Zend Authoritative Certification test questions-php and database Test _php tutorial

Source: Internet
Author: User
If you need to develop dynamic content sites, then you must use the database. Although the modern web site is inseparable from the database, many developers still know very little about how it works.
PHP supports many kinds of databases, PHP authentication is only related to PHP capabilities, so the topic in this chapter will not be specific to a particular database management system. In addition, most commercial DBMS, such as MySQL AB, have their own certification courses.
This chapter examines your knowledge of database principles and database programming-regardless of the specific DBMS.


Problem

1. Consider the following SQL statement. Which option can limit the number of entries that are returned to a record? (Double choice)

SELECT * from my_table

A If possible, convert the query into a storage routine
B Specify the range of returned records for the query, if allowed by the program
C If possible, add a Where condition
D If the DBMS allows, convert the query into a view
E. If the DBMS allows, use prepared statements


2. You can filter the datasets returned by the query in the same way that you add a ___ condition?

Answer: ____________


3. What is an internal association (inner join) for?

A Associating two tables with the same field into a persistent table
B Create a result set based on the same peers in two tables
C To create a dataset based on a record in a table
D Create a result set that contains the same records in two tables and all records in a table
E. None of these are right.


4. Which DBMS does not have the PHP extension library?

A Mysql
B IBM DB/2
C PostgreSQL
D Microsoft SQL Server
E. None of these are right.


5. Consider the following script. Suppose the mysql_query function feeds an unfiltered query statement into an already open database connection, which of the following is the right option? (Double choice)

Here is the code snippet:
$r = mysql_query (DELETE from MYTABLE WHERE id=. $_get[id]);
?>


A More than 1 records in the MyTable table
B Data entered by the user needs to be properly escaped and filtered
C Calling this function will result in a record containing the number of other record bars
D Passing id=0+or+1 to a URL will cause all tables in mytable to be deleted
E. The query statement should contain the database name


6. The ___ statement can be used to add a new record to a table that already exists.

Answer: ____________


7. Which of the following statements is correct?

A Using indexes can speed up the insertion of data
B A good indexing strategy helps prevent cross-site attacks
C The index should be designed according to the actual application of the database
D Deleting a record will cause the index of the entire table to be corrupted
E. Only numeric record rows need to be indexed


8. Can joins be nested?

A Yes
B No


9. Consider the following data tables and queries. How can I add indexes to improve query speed?

CREATE TABLE MYTABLE (
ID INT,
NAME VARCHAR (100),
ADDRESS1 VARCHAR (100),
ADDRESS2 VARCHAR (100),
ZIPCODE VARCHAR (10),
City VARCHAR (50),
Province VARCHAR (2)
)
SELECT ID, VARCHAR
From MYTABLE
WHERE ID between 0 and 100
ORDER by NAME, ZIPCODE

A Add an index to an ID
B To add an index to name and ADDRESS1
C Add an index to the ID and then add the index to name and ZipCode separately
D Add an index to ZipCode and name
E. To add a full-text search to ZipCode

http://www.bkjia.com/PHPjc/486529.html www.bkjia.com true http://www.bkjia.com/PHPjc/486529.html techarticle If you need to develop dynamic content sites, then you must use the database. Although the modern web site is inseparable from the database, many developers still know very little about how it works. ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.