Código SQL:
Ver original
CREATE TABLE IF NOT EXISTS `horarios` ( `grado` INT(11) NOT NULL, `cod_mat` INT(3) NOT NULL, `seccion` VARCHAR(5) COLLATE utf8_spanish_ci NOT NULL, `cod_mencion` VARCHAR(10) COLLATE utf8_spanish_ci NOT NULL, `cod_doc` INT(11) NOT NULL, `dia1` INT(11) NOT NULL, `dish1` VARCHAR(15) COLLATE utf8_spanish_ci NOT NULL, `aula1` VARCHAR(10) COLLATE utf8_spanish_ci NOT NULL, `dia2` INT(11) NOT NULL, `dish2` VARCHAR(15) COLLATE utf8_spanish_ci NOT NULL, `aula2` VARCHAR(10) COLLATE utf8_spanish_ci NOT NULL, `dia3` INT(11) NOT NULL, `dish3` VARCHAR(15) COLLATE utf8_spanish_ci NOT NULL, `aula3` VARCHAR(10) COLLATE utf8_spanish_ci NOT NULL, `dia4` INT(11) NOT NULL, `dish4` VARCHAR(15) COLLATE utf8_spanish_ci NOT NULL, `aula4` VARCHAR(10) COLLATE utf8_spanish_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; INSERT INTO `horarios` (`grado`, `cod_mat`, `seccion`, `cod_mencion`, `cod_doc`, `dia1`, `dish1`, `aula1`, `dia2`, `dish2`, `aula2`, `dia3`, `dish3`, `aula3`, `dia4`, `dish4`, `aula4`) VALUES (7, 1, 'A', '', 2, 1, '01-02-03-04', '01', 0, '---', '', 0, '---', '', 0, '---', ''), (8, 21, 'A', '', 2, 1, '06-07-08-09', '03', 0, '---', '', 0, '---', '', 0, '---', ''), (8, 15, 'B', '', 2, 2, '01-02-03-04', '02', 0, '---', '', 0, '---', '', 0, '---', ''), (7, 10, 'A', '', 2, 2, '05-06-07-08', '04', 0, '---', '', 0, '---', '', 0, '---', ''), (8, 22, 'A', '', 2, 3, '01-02-03-04', '04', 0, '---', '', 0, '---', '', 0, '---', ''), (9, 33, 'A', '', 2, 3, '06-07-08-09', '04', 0, '---', '', 0, '---', '', 0, '---', ''), (7, 1, 'B', '', 2, 4, '01-02-03-04', '06', 0, '---', '', 0, '---', '', 0, '---', ''), (9, 34, 'B', '', 2, 4, '10-11-12-13', '06', 0, '---', '', 0, '---', '', 0, '---', ''), (8, 21, 'B', '', 2, 5, '01-02-03-04', '03', 0, '---', '', 0, '---', '', 0, '---', '');