Getting started Mysql with JSON
Getting started Mysql with JSON
Let us create a table playesCREATE TABLE `players` (
`id` INT NOT NULL,
`player_and_games` varchar(5000),
PRIMARY KEY (`id`)
);
Insert JSON data into table
INSERT INTO `players` (`id`, `player_and_games`) VALUES (1, '{
"name": "Sally",
"games_played":{
"Battlefield": "yes",
"Crazy Tennis": "yes",
"Puzzler": {
"time": 7
}
}
}'
)
INSERT INTO `players` (`id`, `player_and_games`) VALUES (2, '{
"name": "radhey",
"games_played":{
"Battlefield": "no",
"Crazy Tennis": "no",
"Puzzler": {
"time": 7
}
}
}'
)
Comments
Post a Comment