Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

How to do it...

  1. Consider the emp_details table that you created in Chapter 3, Using MySQL (Advanced)Using JSON section:
mysql> SHOW CREATE TABLE emp_details\G*************************** 1. row ***************************       Table: emp_detailsCreate Table: CREATE TABLE `emp_details` (  `emp_no` int(11) NOT NULL,  `details` json DEFAULT NULL,  PRIMARY KEY (`emp_no`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb41 row in set (0.00 sec)
  1. Insert a few dummy records:
mysql> INSERT IGNORE INTO emp_details(emp_no, details) VALUES      ('1', '{ "location": "IN", "phone": "+11800000000", "email": "abc@example.com", "address": { "line1": "abc", "line2": "xyz street", "city": "Bangalore", "pin": "560103"}}'), ('2', '{ "location": "IN", "phone": "+11800000000", "email": ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other