SQL is a query language for relational databases developed in 1974 that operates on tables using statements like SELECT, INSERT, and UPDATE. XQuery is a query language for XML data developed in 2007 that operates on hierarchies and supports XPath. While both are query languages, SQL works with relational databases and XQuery works with XML data collections stored in databases or elsewhere.