Home php教程 php手册 Zend权威认证试题-PHP与数据库试题

Zend权威认证试题-PHP与数据库试题

Jun 13, 2016 am 10:36 AM
zend and content dynamic develop database of website Certification test questions need

如果你需要开发动态内容的网站,那么就肯定要用到数据库。尽管现代网站离不开数据库,但很多开发者对它的工作原理仍然知之甚少。
PHP支持许多种类的数据库,可PHP认证只和PHP能力有关,所以本章的题目不会专门针对某个特定的数据库管理系统。另外,大多数商业DBMS,比如MySQL AB,都有它们自己的认证课程。
本章考察你对数据库原理及数据库编程的相关知识——与特定的DBMS无关。


问题

1.考虑如下SQL语句。哪个选项能对返回记录的条数进行限制?(双选)

SELECT * FROM MY_TABLE

A.如果可能,用把查询转换成存储例程
B.如果程序允许,给查询指定返回记录的范围
C.如果可能,添加where条件
D.如果DBMS允许,把查询转换成视图
E.如果DBMS允许,使用事先准备好的语句


2.可以用添加______条件的方式对查询返回的数据集进行过滤?

答案:____________


3.内关联(inner join)是用来做什么的?

A.把两个表通过相同字段关联入一张持久的表中
B.创建基于两个表中相同相同行的结果集
C.创建基于一个表中的记录的数据集
D.创建一个包含两个表中相同记录和一个表中全部记录的结果集
E.以上都不对


4.以下哪个DBMS没有PHP扩展库?

A.MySQL
B.IBM DB/2
C.PostgreSQL
D.Microsoft SQL Server
E.以上都不对


5.考虑如下脚本。假设mysql_query函数将一个未过滤的查询语句送入一个已经打开的数据库连接,以下哪个选项是对的?(双选)

以下是代码片段:
 $r = mysql_query (DELETE FROM MYTABLE WHERE ID= .  $_GET[ID]);
?>


A.MYTABLE表中的记录超过1条
B.用户输入的数据需要经过适当的转义和过滤
C.调用该函数将产生一个包含了其他记录条数的记录
D.给URL传递ID=0+OR+1将导致MYTABLE中的所有表被删除
E.查询语句中应该包含数据库名


6.______语句能用来向已存在的表中添加新的记录。

答案:____________


7.以下哪个说法正确?

A.使用索引能加快插入数据的速度
B.良好的索引策略有助于防止跨站攻击
C.应当根据数据库的实际应用按理设计索引
D.删除一条记录将导致整个表的索引被破坏
E.只有数字记录行需要索引


8.join能否被嵌套?

A.能
B.不能


9.考虑如下数据表和查询。如何添加索引能提高查询速度?

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.给ID添加索引
B.给NAME和ADDRESS1添加索引
C.给ID添加索引,然后给NAME和ZIPCODE分别添加索引
D.给ZIPCODE和NAME添加索引
E.给ZIPCODE添加全文检索

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Four recommended AI-assisted programming tools Four recommended AI-assisted programming tools Apr 22, 2024 pm 05:34 PM

This AI-assisted programming tool has unearthed a large number of useful AI-assisted programming tools in this stage of rapid AI development. AI-assisted programming tools can improve development efficiency, improve code quality, and reduce bug rates. They are important assistants in the modern software development process. Today Dayao will share with you 4 AI-assisted programming tools (and all support C# language). I hope it will be helpful to everyone. https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot is an AI coding assistant that helps you write code faster and with less effort, so you can focus more on problem solving and collaboration. Git

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

How to connect to remote database using Golang? How to connect to remote database using Golang? Jun 01, 2024 pm 08:31 PM

Through the Go standard library database/sql package, you can connect to remote databases such as MySQL, PostgreSQL or SQLite: create a connection string containing database connection information. Use the sql.Open() function to open a database connection. Perform database operations such as SQL queries and insert operations. Use defer to close the database connection to release resources.

How to use database callback functions in Golang? How to use database callback functions in Golang? Jun 03, 2024 pm 02:20 PM

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

Tsinghua Optics AI appears in Nature! Physical neural network, backpropagation is no longer needed Tsinghua Optics AI appears in Nature! Physical neural network, backpropagation is no longer needed Aug 10, 2024 pm 10:15 PM

Using light to train neural networks, Tsinghua University results were recently published in Nature! What should I do if I cannot apply the backpropagation algorithm? They proposed a Fully Forward Mode (FFM) training method that directly performs the training process in the physical optical system, overcoming the limitations of traditional digital computer simulations. To put it simply, it used to be necessary to model the physical system in detail and then simulate these models on a computer to train the network. The FFM method eliminates the modeling process and allows the system to directly use experimental data for learning and optimization. This also means that training no longer needs to check each layer from back to front (backpropagation), but can directly update the parameters of the network from front to back. To use an analogy, like a puzzle, backpropagation

See all articles