我得到了下面提到的 XML DTD 及其相关的关系数据库模式:
<!DOCTYPE CATALOG [
<!ELEMENT CATALOG (TOOL | TOY)+>
<!ELEMENT TOOL (NAME,SPECIFICATIONS+,OPTIONS?)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENTSPECIFICATIONS (#PCDATA)>
<!ELEMENT OPTIONS (#PCDATA)>
<!ELEMENT TOY (NAME,PRICE?)>
<!ELEMENT PRICE (#PCDATA)>]>
Tools(toolid: integer, name: string, options: string)
Specifications(toolid: integer, specno: integer, spec: string)
Toys(toyid: integer, name: string, price: string)
如何将以下 SQL 查询转换为等效的 XQuery 表达式?
SELECT name FROM Tools
UNION
SELECT name FROM Toys
提前致谢。