MariaDB [(none)]> use GestionEscolar; ERROR 1049 (42000): Unknown database 'gestionescolar' MariaDB [(none)]> create database GestionEscolar; Query OK, 1 row affected (0.004 sec) MariaDB [(none)]> use GestionEscolar; Database changed MariaDB [GestionEscolar]> create table Acudiente(codAcudiente int(3) not null primary key, -> Nombre varchar(50) not null, -> Direccion varchar(15) not null, -> Telefono int(10) not null, -> Email varchar(50) not null); Query OK, 0 rows affected (0.043 sec) MariaDB [GestionEscolar]> describe Acudiente; +--------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+-------+ | codAcudiente | int(3) | NO | PRI | NULL | | | Nombre | varchar(50) | NO | | NULL | | | Direccion | varchar(15) | NO | | NULL | | | Telefono | int(10) | NO | | NULL | | | Email | varchar(50) | NO | | NULL | | +--------------+-------------+------+-----+---------+-------+ 5 rows in set (0.028 sec) MariaDB [GestionEscolar]> create table Estudiante(codEstudiante int(5) not null primary key, -> Nombre varchar(50) not null, -> Direccion varchar(28) not null, -> Telefono int(10) not null, -> Email varchar(50) not null); Query OK, 0 rows affected (0.040 sec) MariaDB [GestionEscolar]> describe Estudiante; +---------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+-------------+------+-----+---------+-------+ | codEstudiante | int(5) | NO | PRI | NULL | | | Nombre | varchar(50) | NO | | NULL | | | Direccion | varchar(28) | NO | | NULL | | | Telefono | int(10) | NO | | NULL | | | Email | varchar(50) | NO | | NULL | | +---------------+-------------+------+-----+---------+-------+ 5 rows in set (0.025 sec) MariaDB [GestionEscolar]> Create table Profesor(codProfesor int(3) primary key, -> Create table Profesor(codProfesor int(3) not null primary key, -> Nombre varchar(50) not null, -> Direccion varchar(28) not null, -> Telefono int(10) not null, -> Email varchar(50) not null); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Create table Profesor(codProfesor int(3) not null primary key, Nombre varchar...' at line 2 MariaDB [GestionEscolar]> Create table Profesor(codProfesor int(3) not null primary key, -> -> Nombre varchar(50) not null, -> -> Direccion varchar(28) not null, -> -> Telefono int(10) not null, -> -> Email varchar(50) not null); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-> Nombre varchar(50) not null, -> Direccion varchar(28) not null, ->...' at line 2 MariaDB [GestionEscolar]> create table Profesor(codprofesor int(3) not null primary key, -> Nombre varchar(50) not null, -> Direccion varchar(28) not null, -> Telefono int(10) not null, -> Email varchar(50) not null); Query OK, 0 rows affected (0.052 sec) MariaDB [GestionEscolar]> describe Profesor; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+-------+ | codprofesor | int(3) | NO | PRI | NULL | | | Nombre | varchar(50) | NO | | NULL | | | Direccion | varchar(28) | NO | | NULL | | | Telefono | int(10) | NO | | NULL | | | Email | varchar(50) | NO | | NULL | | +-------------+-------------+------+-----+---------+-------+ 5 rows in set (0.026 sec) MariaDB [GestionEscolar]> create table Materia(codmateria int(2) not null primary key, -> nombre varchar(20) not null); Query OK, 0 rows affected (0.040 sec) MariaDB [GestionEscolar]> describe Materia; +------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+-------+ | codmateria | int(2) | NO | PRI | NULL | | | nombre | varchar(20) | NO | | NULL | | +------------+-------------+------+-----+---------+-------+ 2 rows in set (0.024 sec) MariaDB [GestionEscolar]> create table EstudianteAcudiente(codEstudiante int(5) not null, -> codAcudiente int(3) not null not null, -> foreign key(codeEstudiante) references Estudiante(codEstudiante) on delete cascade on update cascade, -> foreign key(codEstudiante) references Estudiante(codEstudiante) on delete cascade on update cascade, -> foreign key(codAcudiente) references Acudiente(codAcudiente)on delete cascade on update cascade); ERROR 1072 (42000): Key column 'codeEstudiante' doesn't exist in table MariaDB [GestionEscolar]> create table EstudianteAcudiente(codEstudiante int(5) not nu -> ll, -> codAcudiente int(3) not null not null, -> foreign key(codEstudiante) references Estudiante(codEstudiante) on delete cascade on update cascade, -> foreign key(codAcudiente) references Acudiente(codAcudiente)on delete cascade on update cascade); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'nu ll, codAcudiente int(3) not null not null, foreign key(codEstudiante) refe...' at line 1 MariaDB [GestionEscolar]> CREATE TABLE EstudianteAcudiente ( -> codEstudiante INT(5) NOT NULL, -> codAcudiente INT(3) NOT NULL, -> FOREIGN KEY (codEstudiante) REFERENCES Estudiante(codEstudiante) ON DELETE CASCADE ON UPDATE CASCADE, -> FOREIGN KEY (codAcudiente) REFERENCES Acudiente(codAcudiente) ON DELETE CASCADE ON UPDATE CASCADE -> ); Query OK, 0 rows affected (0.066 sec) MariaDB [GestionEscolar]> create table EstudianteMateria(codEstudiante int(5) not null, -> codMateria int(2) not null, -> foreign key(codEstudiante) references estudiante(codEstudiante) ON DELETE CASCADE ON UPDATE CASCADE, -> foreign key(codMateria) references materia(codMateria) ON DELETE CASCADE ON UPDATE CASCADE -> ); Query OK, 0 rows affected (0.060 sec) MariaDB [GestionEscolar]> create table MateriaProfesor(codMateria int(2) not null, -> codprofesor int(3) not null, -> foreign key(codMateria) references materia(codMateria) ON DELETE CASCADE ON UPDATE CASCADE, -> foreign key(codProfesor) references profesor(codprofesor) ON DELETE CASCADE ON UPDATE CASCADE); Query OK, 0 rows affected (0.080 sec) MariaDB [GestionEscolar]> describe MateriaProfesor; +-------------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------+------+-----+---------+-------+ | codMateria | int(2) | NO | MUL | NULL | | | codprofesor | int(3) | NO | MUL | NULL | | +-------------+--------+------+-----+---------+-------+ 2 rows in set (0.024 sec) MariaDB [GestionEscolar]> describe EstudianteMateria; +---------------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------+------+-----+---------+-------+ | codEstudiante | int(5) | NO | MUL | NULL | | | codMateria | int(2) | NO | MUL | NULL | | +---------------+--------+------+-----+---------+-------+ 2 rows in set (0.026 sec) MariaDB [GestionEscolar]> describe EstudianteAcudiente; +---------------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------+------+-----+---------+-------+ | codEstudiante | int(5) | NO | MUL | NULL | | | codAcudiente | int(3) | NO | MUL | NULL | | +---------------+--------+------+-----+---------+-------+ 2 rows in set (0.026 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('001','ACEVEDO CARDONA ESTEBAN', 'Barrio la pradera', '5846069', 'estebacardona@gmail.com'); Query OK, 1 row affected, 1 warning (0.062 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('002','AGUDELO MANCO DIANA PATRICIA', 'Barrio rosaleda', '5882104', 'dianapatricia@gmail.com'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('003','ZPATA VALENCIA JORGE', 'Barrio Aragon', '5841998', 'jorgezapata@gmail.com'); Query OK, 1 row affected (0.004 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('003','ZPATA VALENCIA JORGE', 'Barrio Aragon', '5841998', 'jorgezapata@gmail.com'); ERROR 1062 (23000): Duplicate entry '3' for key 'PRIMARY' MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('004','VELASQUEZ CANO JENNY ASTRID', 'Barrio la pradera', '2791469', 'jennyvelasquez@gmail.com'); Query OK, 1 row affected, 1 warning (0.016 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('005','POSADA VASCO ANA', 'Urbanizacion compartir', '2791469', 'jennyvelasquez@gmail.com'); Query OK, 1 row affected, 1 warning (0.016 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('006','ORTIZ PUERTA INDIRA', 'Urbanizacin ciudadela prado ', '5841497', 'indiraortiz@gmail.com'); Query OK, 1 row affected, 1 warning (0.016 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('007','QUINTERO MENESES ADRIANA MARIA', 'Barrio Sangabriel', '5840570', 'adrianaquintero@gmail.com'); Query OK, 1 row affected, 1 warning (0.008 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('008','MONTOYA RIVERA EDILMA', 'Barrio la pradera', '3767289', 'edilmamontoya@gmail.com'); Query OK, 1 row affected, 1 warning (0.016 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('009','LOPERA MONSALVE FERNANDO ALONSO', 'Barrio el limonar 1', '5709957', 'fernandolopera@gmail.com'); Query OK, 1 row affected, 1 warning (0.016 sec) MariaDB [GestionEscolar]> insert into Acudiente(codacudiente, nombre, direccion, telefono, email) values('010','HENAO RIOS DORA EMILSE', 'Barrio el limonar 2', '2866222', 'dorahenao@gmail.com'); Query OK, 1 row affected, 1 warning (0.017 sec) MariaDB [GestionEscolar]> select * from acudiente; +--------------+---------------------------------+-----------------+----------+---------------------------+ | codAcudiente | Nombre | Direccion | Telefono | Email | +--------------+---------------------------------+-----------------+----------+---------------------------+ | 1 | ACEVEDO CARDONA ESTEBAN | Barrio la prade | 5846069 | estebacardona@gmail.com | | 2 | AGUDELO MANCO DIANA PATRICIA | Barrio rosaleda | 5882104 | dianapatricia@gmail.com | | 3 | ZPATA VALENCIA JORGE | Barrio Aragon | 5841998 | jorgezapata@gmail.com | | 4 | VELASQUEZ CANO JENNY ASTRID | Barrio la prade | 2791469 | jennyvelasquez@gmail.com | | 5 | POSADA VASCO ANA | Urbanizacion co | 2791469 | jennyvelasquez@gmail.com | | 6 | ORTIZ PUERTA INDIRA | Urbanizacin ci | 5841497 | indiraortiz@gmail.com | | 7 | QUINTERO MENESES ADRIANA MARIA | Barrio Sangabri | 5840570 | adrianaquintero@gmail.com | | 8 | MONTOYA RIVERA EDILMA | Barrio la prade | 3767289 | edilmamontoya@gmail.com | | 9 | LOPERA MONSALVE FERNANDO ALONSO | Barrio el limon | 5709957 | fernandolopera@gmail.com | | 10 | HENAO RIOS DORA EMILSE | Barrio el limon | 2866222 | dorahenao@gmail.com | +--------------+---------------------------------+-----------------+----------+---------------------------+ 10 rows in set (0.001 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00001','ACEVEDO BURITICA JUAN ESTEBAN', 'Barrio la pradera', '5846069', 'juanestebacardona@gmail.com'); Query OK, 1 row affected (0.019 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00002','ALVAREZ AGUDELO ESTEBAN', 'Barrio rosaleda', '5882104', 'estebanlavarez@gmail.com'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00003','ZAPATA CAMPIO ISABEL', 'Barrio Aragon', '5841998', 'zapataisabel@gmail.com'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00004','VALLE VELASQUEZ SOFIA', 'Barrio la pradera', '2791469', 'sofiavelasquez@gmail.com'); Query OK, 1 row affected (0.008 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00005','MORENO POSADA DIEGO ALEJANDRO', 'Urbanizacion compartir', '2868617', 'diegomoreno@gmail.com'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00006','LZATE ORTIZ JORGE MARIO', 'Urbanizacin ciudadela prado', '5841497', 'marioalzae@gmail.com'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00007','ZAPATA QUINTERO JOSE MARIA', 'Barrio Sangabriel', '5840570', 'josezapata@gmail.com'); Query OK, 1 row affected (0.007 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00008','MNTOYA MONTOYA AEJANDRO', 'Barrio la pradera', '3767289', 'alejandromontoya@gmail.com'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00009','LOPERA CARTAGENA LUISA FENANADA', 'Barrio el limonar 1', '5709957', 'luisalopera@gmail.com'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00010','JARAMILLO HENAO JOSE LUIS', 'Barrio el limonar 2', '2866222', 'josearamillo@gmail.com'); Query OK, 1 row affected (0.007 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00011','ALVAREZ AGUDELO LUNA', 'Barrio rosaleda', '5882104', 'lunaalvarez@gmail.com'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into Estudiante(codestudiante, nombre, direccion, telefono, email) values('00012','ALVAREZ AGUDELO XAVIER', 'Barrio rosaleda', '5882104', 'xavieralvarez@gmail.com'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> select * from estudiante; +---------------+---------------------------------+------------------------------+----------+-----------------------------+ | codEstudiante | Nombre | Direccion | Telefono | Email | +---------------+---------------------------------+------------------------------+----------+-----------------------------+ | 1 | ACEVEDO BURITICA JUAN ESTEBAN | Barrio la pradera | 5846069 | juanestebacardona@gmail.com | | 2 | ALVAREZ AGUDELO ESTEBAN | Barrio rosaleda | 5882104 | estebanlavarez@gmail.com | | 3 | ZAPATA CAMPIO ISABEL | Barrio Aragon | 5841998 | zapataisabel@gmail.com | | 4 | VALLE VELASQUEZ SOFIA | Barrio la pradera | 2791469 | sofiavelasquez@gmail.com | | 5 | MORENO POSADA DIEGO ALEJANDRO | Urbanizacion compartir | 2868617 | diegomoreno@gmail.com | | 6 | LZATE ORTIZ JORGE MARIO | Urbanizacin ciudadela prado | 5841497 | marioalzae@gmail.com | | 7 | ZAPATA QUINTERO JOSE MARIA | Barrio Sangabriel | 5840570 | josezapata@gmail.com | | 8 | MNTOYA MONTOYA AEJANDRO | Barrio la pradera | 3767289 | alejandromontoya@gmail.com | | 9 | LOPERA CARTAGENA LUISA FENANADA | Barrio el limonar 1 | 5709957 | luisalopera@gmail.com | | 10 | JARAMILLO HENAO JOSE LUIS | Barrio el limonar 2 | 2866222 | josearamillo@gmail.com | | 11 | ALVAREZ AGUDELO LUNA | Barrio rosaleda | 5882104 | lunaalvarez@gmail.com | | 12 | ALVAREZ AGUDELO XAVIER | Barrio rosaleda | 5882104 | xavieralvarez@gmail.com | +---------------+---------------------------------+------------------------------+----------+-----------------------------+ 12 rows in set (0.001 sec) MariaDB [GestionEscolar]> insert into Profesor(coddocente, nombre, email) values('001','CIFUENTES MESA MYEIDY MARIA', 'myleidym.iearm@gmail.com'); ERROR 1054 (42S22): Unknown column 'coddocente' in 'field list' MariaDB [GestionEscolar]> insert into Profesor(codProfesor, nombre, email) values('001','CIFUENTES MESA MYEIDY MARIA', 'myleidym.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.016 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('002','CUADRADO PEREZ ADRID JOSE', 'adrid.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.016 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('003','DUQUE RESTREPO ESTER LUCIA', 'esterl.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.018 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('004','GUIRALES MAURICIO', 'mauriciog.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.016 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('005','VERA DAZA MARIA ELENA', 'mariae.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.015 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('006','PALACIO TOMAS FELIPE', 'tomasf.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.016 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('007','MOSUERA OSORIO MARYETH', 'maryeth.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.014 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('008','ARBOLEDA VARGAS MARIA OFELIA', 'ofeliaa.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.015 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('009','MOSCOTE MARULANDA YANET MARIA', 'yanetm.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.015 sec) MariaDB [GestionEscolar]> insert into Profesor(codprofesor, nombre, email) values('010','MACIAS EDGAR ALBERTO', 'edgarm.iearm@gmail.com'); Query OK, 1 row affected, 2 warnings (0.004 sec) MariaDB [GestionEscolar]> select * from Profesor; +-------------+-------------------------------+-----------+----------+---------------------------+ | codprofesor | Nombre | Direccion | Telefono | Email | +-------------+-------------------------------+-----------+----------+---------------------------+ | 1 | CIFUENTES MESA MYEIDY MARIA | | 0 | myleidym.iearm@gmail.com | | 2 | CUADRADO PEREZ ADRID JOSE | | 0 | adrid.iearm@gmail.com | | 3 | DUQUE RESTREPO ESTER LUCIA | | 0 | esterl.iearm@gmail.com | | 4 | GUIRALES MAURICIO | | 0 | mauriciog.iearm@gmail.com | | 5 | VERA DAZA MARIA ELENA | | 0 | mariae.iearm@gmail.com | | 6 | PALACIO TOMAS FELIPE | | 0 | tomasf.iearm@gmail.com | | 7 | MOSUERA OSORIO MARYETH | | 0 | maryeth.iearm@gmail.com | | 8 | ARBOLEDA VARGAS MARIA OFELIA | | 0 | ofeliaa.iearm@gmail.com | | 9 | MOSCOTE MARULANDA YANET MARIA | | 0 | yanetm.iearm@gmail.com | | 10 | MACIAS EDGAR ALBERTO | | 0 | edgarm.iearm@gmail.com | +-------------+-------------------------------+-----------+----------+---------------------------+ 10 rows in set (0.001 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('001','ESPAOL'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('002','LECTOESCRITURA'); Query OK, 1 row affected (0.004 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('003','CIENCIAS NATURALES'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('004','MATEMATICAS'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('005','INVESTIGACION'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('006','FISICA'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('007','FILOSOFIA'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('008','EDUCACION FISICA'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('009','ETICA'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('010','ARTISTICA'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('011','TECNOLOGIA'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('012','INFORMATICA'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('013','RELIGION'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('014','SOCIALES'); Query OK, 1 row affected (0.006 sec) MariaDB [GestionEscolar]> insert into Materia(codmateria, nombre) values('015','INGLES'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> SELECT * from materia; +------------+--------------------+ | codmateria | nombre | +------------+--------------------+ | 1 | ESPAOL | | 2 | LECTOESCRITURA | | 3 | CIENCIAS NATURALES | | 4 | MATEMATICAS | | 5 | INVESTIGACION | | 6 | FISICA | | 7 | FILOSOFIA | | 8 | EDUCACION FISICA | | 9 | ETICA | | 10 | ARTISTICA | | 11 | TECNOLOGIA | | 12 | INFORMATICA | | 13 | RELIGION | | 14 | SOCIALES | | 15 | INGLES | +------------+--------------------+ 15 rows in set (0.001 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('001','00001'); Query OK, 1 row affected (0.019 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('002','00002'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('003','00003'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('004','00004'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('005','00005'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('006','00006'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('007','00007'); Query OK, 1 row affected (0.004 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('008','00008'); Query OK, 1 row affected (0.005 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('009','00009'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('010','00010'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('001','00011'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteAcudiente(codacudiente, codestudiante) values('001','00012'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> select * from EstudianteAcudiente; +---------------+--------------+ | codEstudiante | codAcudiente | +---------------+--------------+ | 1 | 1 | | 2 | 2 | | 3 | 3 | | 4 | 4 | | 5 | 5 | | 6 | 6 | | 7 | 7 | | 8 | 8 | | 9 | 9 | | 10 | 10 | | 11 | 1 | | 12 | 1 | +---------------+--------------+ 12 rows in set (0.001 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('E01', 'M01'); ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`gestionescolar`.`estudiantemateria`, CONSTRAINT `estudiantemateria_ibfk_1` FOREIGN KEY (`codEstudiante`) REFERENCES `estudiante` (`codEstudiante`) ON DELETE CASCADE ON UPDATE CASCADE) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('001', '001'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('01', '02'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '03'); Query OK, 1 row affected (0.006 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '04') -> ; Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '05'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '06'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '03') -> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '07'); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'insert into EstudianteMateria(codestudiante, codmateria) values('00001', '07')' at line 2 MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '07'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '08'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '09'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '10'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '11'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '12'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '13'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '14'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00001', '15'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '01'); Query OK, 1 row affected (0.007 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '02'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '03'); Query OK, 1 row affected (0.019 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '04'); Query OK, 1 row affected (0.006 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '05'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '06'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '07'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '08'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '09'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '10'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '11'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '12'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '13'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '14'); Query OK, 1 row affected (0.005 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00002', '15'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '01'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '02'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '03'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '04'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '05'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '06'); Query OK, 1 row affected (0.005 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '07'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '08'); Query OK, 1 row affected (0.006 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '09'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '10'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '11'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '12'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '13'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '14'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00003', '15'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '01'); Query OK, 1 row affected (0.007 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '02'); Query OK, 1 row affected (0.006 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '03'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '04'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '05'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '06'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '07'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '08'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '09'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '10'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '11'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '12'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '13'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '14'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00004', '15'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '01'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '02'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '03'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '04'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '05'); Query OK, 1 row affected (0.005 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '06'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '07'); Query OK, 1 row affected (0.008 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '08'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '09'); Query OK, 1 row affected (0.004 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '10'); Query OK, 1 row affected (0.018 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '11'); Query OK, 1 row affected (0.018 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '12'); Query OK, 1 row affected (0.005 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '13'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '14'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00005', '15'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '01'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '02'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '03'); Query OK, 1 row affected (0.006 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '04'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '05'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '06'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '07'); Query OK, 1 row affected (0.005 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '08'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '09'); Query OK, 1 row affected (0.004 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '10'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '11'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '12'); Query OK, 1 row affected (0.020 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '13'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '14'); Query OK, 1 row affected (0.010 sec) MariaDB [GestionEscolar]> insert into EstudianteMateria(codestudiante, codmateria) values('00006', '15'); Query OK, 1 row affected (0.016 sec) MariaDB [GestionEscolar]> select * from EstudianteMateria; +---------------+------------+ | codEstudiante | codMateria | +---------------+------------+ | 1 | 1 | | 1 | 2 | | 1 | 3 | | 1 | 4 | | 1 | 5 | | 1 | 6 | | 1 | 7 | | 1 | 8 | | 1 | 9 | | 1 | 10 | | 1 | 11 | | 1 | 12 | | 1 | 13 | | 1 | 14 | | 1 | 15 | | 2 | 1 | | 2 | 2 | | 2 | 3 | | 2 | 4 | | 2 | 5 | | 2 | 6 | | 2 | 7 | | 2 | 8 | | 2 | 9 | | 2 | 10 | | 2 | 11 | | 2 | 12 | | 2 | 13 | | 2 | 14 | | 2 | 15 | | 3 | 1 | | 3 | 2 | | 3 | 3 | | 3 | 4 | | 3 | 5 | | 3 | 6 | | 3 | 7 | | 3 | 8 | | 3 | 9 | | 3 | 10 | | 3 | 11 | | 3 | 12 | | 3 | 13 | | 3 | 14 | | 3 | 15 | | 4 | 1 | | 4 | 2 | | 4 | 3 | | 4 | 4 | | 4 | 5 | | 4 | 6 | | 4 | 7 | | 4 | 8 | | 4 | 9 | | 4 | 10 | | 4 | 11 | | 4 | 12 | | 4 | 13 | | 4 | 14 | | 4 | 15 | | 5 | 1 | | 5 | 2 | | 5 | 3 | | 5 | 4 | | 5 | 5 | | 5 | 6 | | 5 | 7 | | 5 | 8 | | 5 | 9 | | 5 | 10 | | 5 | 11 | | 5 | 12 | | 5 | 13 | | 5 | 14 | | 5 | 15 | | 6 | 1 | | 6 | 2 | | 6 | 3 | | 6 | 4 | | 6 | 5 | | 6 | 6 | | 6 | 7 | | 6 | 8 | | 6 | 9 | | 6 | 10 | | 6 | 11 | | 6 | 12 | | 6 | 13 | | 6 | 14 | | 6 | 15 | +---------------+------------+ 90 rows in set (0.001 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('01', '005'); Query OK, 1 row affected (0.018 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('02', '007'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('03', '009'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('04', '003'); Query OK, 1 row affected (0.019 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('05', '003'); Query OK, 1 row affected (0.018 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('06', '003'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('07', '001'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('08', '010'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('09', '006'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('10', '004'); Query OK, 1 row affected (0.013 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('11', '002'); Query OK, 1 row affected (0.015 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('12', '002'); Query OK, 1 row affected (0.017 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('13', '006'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('14', '007'); Query OK, 1 row affected (0.019 sec) MariaDB [GestionEscolar]> insert into MateriaProfesor(codmateria, codprofesor) values('15', '008'); Query OK, 1 row affected (0.014 sec) MariaDB [GestionEscolar]> select * from MateriaProfesor; +------------+-------------+ | codMateria | codprofesor | +------------+-------------+ | 1 | 5 | | 2 | 7 | | 3 | 9 | | 4 | 3 | | 5 | 3 | | 6 | 3 | | 7 | 1 | | 8 | 10 | | 9 | 6 | | 10 | 4 | | 11 | 2 | | 12 | 2 | | 13 | 6 | | 14 | 7 | | 15 | 8 | +------------+-------------+ 15 rows in set (0.003 sec) MariaDB [GestionEscolar]> exit