CREATE DATABASE ; -------------------- CREATE TABLE `studenti` ( `id` int, `jmeno` varchar(60), `prijmeni` varchar(60), `pohlavi` varchar(1), `PLAT` int, `datum_narozeni` date, `mesto` varchar(20), `fakulta` int); insert into studenti values ('1', 'jana', 'krátka', 'f', '23500', '1954-12-22', 'Brno', '0'); insert into studenti values ('2', 'Jana', 'Nováková', 'F', '42261', '2016-11-11', 'Brno', '1'); insert into studenti values ('3', 'Sophia', 'Santiago', 'F', '20758', '1962-11-16', 'Brno', '8'); insert into studenti values ('4', 'Jarek', 'Benes', 'M', '52483', '2017-06-11', 'Praha', '8'); insert into studenti values ('5', 'Petr', 'Malý', 'M', '10000', '2001-09-23', 'Praha', '8'); insert into studenti values ('6', 'Honza', 'Adamec', 'M', '29990', '1977-07-27', 'Praha', '7'); insert into studenti values ('7', 'Petra', 'Adamcova', 'F', '23500', '1982-03-16', 'Olomouc', '6'); insert into studenti values ('8', 'Zuzka', 'Bezva', 'F', '39752', '2016-02-29', 'Ostrava', '7'); insert into studenti values ('9', 'Ivan', 'Sobota', 'M', '15274', '1900-02-01', 'Pardubice', '3'); insert into studenti values ('10', 'Petr', 'Novak', 'M', '27679', '2002-05-20', 'Zlin', '2'); insert into studenti values ('11', 'Jirka', 'Plavec', 'M', '23500', '2017-12-30', 'Opava', '1'); insert into studenti values ('12', 'Iva', 'Nováková', 'F', '25371', '2007-06-07', 'Opava', '0'); insert into studenti values ('13', 'Ivan', 'Kurzo', 'M', '10000', '2018-02-22', 'Ostrava', '5'); insert into studenti values ('14', 'Petr', 'Novak', 'M', '21072', '2011-06-15', 'Pardubice', '7'); insert into studenti values ('15', 'Iva', 'Nováková', 'F', '23181', '1994-02-13', 'Brno', '8'); insert into studenti values ('16', 'Ela', 'Nová', 'F', '23500', '1987-12-14', 'Brno', '5'); insert into studenti values ('17', 'Jan', 'Novak', 'M', '49213', '1979-08-19', 'Brno', '2'); insert into studenti values ('18', 'petr', 'novak', 'M', '18638', '1960-11-18', 'Brno', '2'); insert into studenti values ('19', 'Tom', 'Krejza', 'M', '21086', '2017-09-24', 'Brno', '3'); insert into studenti values ('20', 'Ida', 'Krejzova', 'F', '54032', '2017-04-03', 'Brno', '5'); insert into studenti values ('21', 'Pavel', '', 'M', '23500', '2014-03-14', 'Brno', '7'); insert into studenti values ('22', 'Jakub', 'Nedelka', 'M', '50900', '2017-05-16', 'Praha', '3'); insert into studenti values ('23', 'Zuzka', 'Lesní', 'F', '49956', '2001-09-23', 'Brno', '2'); ------------------------ SELECT CONCAT("[", GROUP_CONCAT( CONCAT("{jmeno:'",jmeno,"'"), CONCAT(",prijmeni:'",prijmeni,"'}") ) ,"]") AS json FROM studenti