Data Manipulation Language (DML)
Description: Data Manipulation Language (DML) is a language that enables
users to access and manipulate data in a database. A query language is a language
used to retrieve data from a database. In our project as in SQL the DML and query
language are combined into one language.
Example:This is what a command file in our DML language looks like:
Syntax and Description:
1. CREATE DATABASE database-name; -
This statement create a database with database-name.
2. CREATE XMLDOC xml-document-name IN database-name; -
This statement creates an xml document with xml-docuemtn-name in database-name
3. LOAD "file-name" INTO xml-document-name; -
This statement loads data from a flat file file-name into create xml document xml-document-name.
Format of the flat file could be as below, in which there are 3 types of tags:
a. <XML> </XML>: these tags indicate the beginning and the end of an XML document.
<XML can be followed by an attribute and attribute value, separate by an equal sign.
b. <G> </G>:these tags are inside XML tags. <G> </G> tags can
nested with <G> </G> and/or <L> </L> tags. <G> can have attribute and
attribute value separate by an equal sign (like XML tag).
c. <L> </L>:these tags are the lowest level in out xml document. These tag starts and
ends text data.
4. INSERT INTO xml-document-name
PATH("location-path") VALUES("<L>leave-text-data-1</L>", ...,
"<L>leave-text-data-n</L>"); - This statement inserts n leave text nodes into specified location-path.
At this time, we support only absolute location-path. An absolute location-path starts with a '/' and followed by
one or more location steps separated by /. A location path can be used as an expression. Evaluation of the expression
returns the set of nodes selected by the path.
Each location step can contains a filter predicate. A filter predicate is put inside [ ].
it filters the set of nodes into a new set of nodes.
5. DELETE FROM xml-document-name WHERE PATH("location-path"); - will delete node returns from the evaluation of location-path.
6. UPDATE xml-document-name SET VALUE("<L>text-data-1</L>") WHERE PATH("location-path"); - update the node returned by the location-path with value inside
VALUES("...,...")
7. SELECT "expression-1", ..., "expression-n" FROM xml-document-1, ..., xml-document-n, ...; - query the xml document
8. DROP XMLDOC xml-document-name; - drop xmldoc XML1DOC from current database
9. DROP DATABASE database-name; - drop current data
10. COMMIT; - commit the changes
11. ROLLBACK; - undo the changes
12. /* - Comments
|