XML Data Type
XML Data Type is a SQL data type in the Data Types category. Native XML data type stores well-formed XML documents. Supports XQuery, XPath, and XML indexes. The syntax is XML. It returns xML document. A typical example: -- SQL Server: CREATE TABLE xml_data (id INT, doc XML); INSERT INTO xml_data VALUES (1, '<product><name>Widget</name><price>9.99</price></product>'); -- XQuery queries: SELECT doc.query('/product/name') FROM xml_data; -- <name>Widget</name> SELECT doc.value('(/product/price)[1]', 'DECIMAL(10,2)') AS price FROM xml_data; -- 9.99 -- XML Index: CREATE PRIMARY XML INDEX idx_xml ON xml_data (doc); -- PostgreSQL: -- XML type available, similar XPath queries -- MySQL: supports XML functions but not XML data type A close relative is INT, which standard integer type. Range: -2147483648 to 2147483647 (signed). Use BIGINT for larger values. A close relative is VARCHAR(n), which variable-length string with a maximum length. Most common string type. Efficient for varying-length data. A close relative is TEXT, which for large text content (up to 65535 bytes in MySQL). Variants: TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.