
MySQL JSON Duality Views simplify working with relational data as JSON by supporting inserts, updates, and deletes through a single view. See how SQL statements manage related tables through JSON objects and explore the documentation at https://dev.mysql.com/doc/refman/26.7/en/json-duality-views.html
JSON Duality Views make it easier to work with relational database data as JSON objects while supporting create, read, update, and delete (CRUD) operations. This demo shows how to define a JSON Duality View using SQL, map JSON fields to relational table columns, and manage related data through a single view.
The demonstration uses two relational tables that store orders and their associated order items. It begins by showing how the tables are connected through order IDs and how SQL queries retrieve their data. It then explains how to create a JSON Duality View, define nested JSON objects using the JSONDualityObject function, and configure permissions for insert, update, and delete operations.
See how selecting data from the view returns JSON objects and how inserting a JSON string adds records to multiple related tables. The demo also covers updating existing records, modifying item quantities, removing individual order items, and deleting an entire order through SQL statements against the view.
By demonstrating these operations, the video illustrates how JSON Duality Views provide a way to work with relational data in JSON format while maintaining the underlying table relationships.
SQL commands used in this demo: https://github.com/mysql/mysql-community/tree/main/content/mysql_shorts/Episode%20102%20-%20JSON%20Duality%20Views











