MariaDB [(none)]> use matricula2; Database changed MariaDB [matricula2]> show tables; +----------------------+ | Tables_in_matricula2 | +----------------------+ | alumcar | | alumno | | carrera | | matricula | | profcar | | profesor | +----------------------+ 6 rows in set (0.001 sec) MariaDB [matricula2]> select * from alumcar; +---------+----------+ | codestu | codcarre | +---------+----------+ | 001 | 002 | | 003 | 005 | | 005 | 001 | | 001 | 005 | +---------+----------+ 4 rows in set (0.001 sec) MariaDB [matricula2]> select * from alumno; +---------+------------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+------------------+-----------+----------+ | 001 | Juan Tobon | Cra 59 | 2335698 | | 002 | Mario Gonzales | Cra 89 | 6325984 | | 003 | Federico Aguilar | Cra 26 | 4569782 | | 004 | Angel Cuadrado | Cra 44 | 6398521 | | 005 | Catalina Escobar | Cra 78 | 4652300 | | 006 | Paulina Borja | Cra 45 | 4599632 | +---------+------------------+-----------+----------+ 6 rows in set (0.000 sec) MariaDB [matricula2]> select * from carrera; +----------+-------------------------+ | codcarre | carrera | +----------+-------------------------+ | 001 | Ingenieria de Sistemas | | 002 | Contaduria | | 003 | Economia | | 004 | Derecho | | 005 | Ingenieria Agropecuaria | | 006 | Agronomia | | 007 | Ciencias de la salud | | 008 | Veterinaria | +----------+-------------------------+ 8 rows in set (0.000 sec) MariaDB [matricula2]> select* from matricula; +----------+---------+----------+----------+---------------+ | codmatri | codestu | codcarre | codprofe | valorsemestre | +----------+---------+----------+----------+---------------+ | 001 | 003 | 004 | 004 | 1800000 | | 002 | 001 | 008 | 003 | 3500000 | | 003 | 004 | 007 | 006 | 2800000 | | 004 | 002 | 007 | 006 | 1950000 | | 005 | 005 | 004 | 001 | 1800000 | | 006 | 003 | 008 | 003 | 3500000 | +----------+---------+----------+----------+---------------+ 6 rows in set (0.000 sec) MariaDB [matricula2]> select * from profcar; +----------+----------+ | codprofe | codcarre | +----------+----------+ | 005 | 003 | | 002 | 006 | | 005 | 005 | | 003 | 008 | | 005 | 001 | | 004 | 002 | | 003 | 001 | | 004 | 004 | | 001 | 004 | | 006 | 007 | +----------+----------+ 10 rows in set (0.001 sec) MariaDB [matricula2]> select * from profesor; +----------+----------------------+-----------+----------+ | codprofe | nombre | direccion | telefono | +----------+----------------------+-----------+----------+ | 001 | Pablo Juan Gutierrez | cra 45-96 | 2569856 | | 002 | Enrique Saltamontes | cra 25-63 | 2365914 | | 003 | Portacio Cartagena | cra 36-01 | 4596321 | | 004 | Federico Aguilar | cra 56-41 | 7895624 | | 005 | Alberto Cifuentes | cra 20-30 | 7895002 | | 006 | Pascual Bravo | cra 56-41 | 5698741 | +----------+----------------------+-----------+----------+ 6 rows in set (0.000 sec) MariaDB [matricula2]> select carrera.carrera,profesor.codprofe,profesor.nombre from profesor, carrera, profcar where profesor.codprofe=profcar.codprofe and profcar.codcarre=carrera.codcarre and carrera.codcarre='001'; +------------------------+----------+--------------------+ | carrera | codprofe | nombre | +------------------------+----------+--------------------+ | Ingenieria de Sistemas | 005 | Alberto Cifuentes | | Ingenieria de Sistemas | 003 | Portacio Cartagena | +------------------------+----------+--------------------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> select alumno.nombre, carrera.carrera, profesor.nombre from alumno, profesor, carrera, matricula where alumno.codestu=matricula.codestu and carrera.codcarre=matricula.codcarre and matricula.codprofe=profesor.codprofe and matricula.codcarre='004'; +------------------+---------+----------------------+ | nombre | carrera | nombre | +------------------+---------+----------------------+ | Federico Aguilar | Derecho | Federico Aguilar | | Catalina Escobar | Derecho | Pablo Juan Gutierrez | +------------------+---------+----------------------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> select distinct carrera.carrera 'CARRERA', matricula.valorsemestre 'VALOR SEMESTRE' from carrera,matricula where carrera.codcarre=matricula.codcarre and matricula.codcarre='008'; +-------------+----------------+ | CARRERA | VALOR SEMESTRE | +-------------+----------------+ | Veterinaria | 3500000 | +-------------+----------------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select alumno.nombre,profesor.nombre from alumno, profesor,matricula where alumno.codestu=matricula.codestu and matricula.codprofe=profesor.codprofe and matricula.codprofe='003'; +------------------+--------------------+ | nombre | nombre | +------------------+--------------------+ | Juan Tobon | Portacio Cartagena | | Federico Aguilar | Portacio Cartagena | +------------------+--------------------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> select max(valorsemestre)'VALOR MAS ALTO DEL SEMESTRE' from matricula; +-----------------------------+ | VALOR MAS ALTO DEL SEMESTRE | +-----------------------------+ | 3500000 | +-----------------------------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select avg(valorsemestre)'Promedio Del Sesmestre' from matricula; +------------------------+ | Promedio Del Sesmestre | +------------------------+ | 2558333.3333333335 | +------------------------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select alumno.nombre from alumno where nombre like 'A%' or nombre like '%R'; +------------------+ | nombre | +------------------+ | Federico Aguilar | | Angel Cuadrado | | Catalina Escobar | +------------------+ 3 rows in set (0.001 sec) MariaDB [matricula2]> select carrera.carrera 'CARRERA', sum(valorsemestre) 'VALOR PAGADOD POR CARRERA' from matricula, carrera where carrera.codcarre=matricula.codcarre group by matricula.codcarre; +----------------------+---------------------------+ | CARRERA | VALOR PAGADOD POR CARRERA | +----------------------+---------------------------+ | Derecho | 3600000 | | Ciencias de la salud | 4750000 | | Veterinaria | 7000000 | +----------------------+---------------------------+ 3 rows in set (0.001 sec) MariaDB [matricula2]> select alumno.nombre from alumno left join matricula on alumno.codestu=matricula.codestu where matricula.codestu is null; +---------------+ | nombre | +---------------+ | Paulina Borja | +---------------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select carrera.carrera,profesor.codprofe,profesor.nombre from profesor, carrera, profcar where profesor.codprofe=profcar.codprofe and profcar.codcarre=carrera.codcarre and carrera.codcarre='001' into outfile 'C:\Users\alexi\OneDrive\Escritoriobase_de_Datos/profesoresdeingenieria.xls'; ERROR 1 (HY000): Can't create/write to file 'C:UsersalexiOneDriveEscritoriobase_de_Datos\profesoresdeingenieria.xls' (Errcode: 2 "No such file or directory") MariaDB [matricula2]> select carrera.carrera,profesor.codprofe,profesor.nombre from profesor, carrera, profcar where profesor.codprofe=profcar.codprofe and profcar.codcarre=carrera.codcarre and carrera.codcarre='001' into outfile 'C:\Users\alexi\OneDrive\Escritorio/Base_de_Datos/profesoresdeingenieria.xls'; ERROR 1 (HY000): Can't create/write to file 'C:UsersalexiOneDriveEscritorio\Base_de_Datos\profesoresdeingenieria.xls' (Errcode: 2 "No such file or directory") MariaDB [matricula2]> select carrera.carrera,profesor.codprofe,profesor.nombre from profesor, carrera, profcar where profesor.codprofe=profcar.codprofe and profcar.codcarre=carrera.codcarre and carrera.codcarre='001' into outfile 'c:/xampp/profesoresdeingenieria.xls'; Query OK, 2 rows affected, 1 warning (0.104 sec) MariaDB [matricula2]> select alumno.nombre, carrera.carrera, profesor.nombre from alumno, profesor, carrera, matricula where alumno.codestu=matricula.codestu and carrera.codcarre=matricula.codcarre and matricula.codprofe=profesor.codprofe and matricula.codcarre='004' into outfile 'c:/xampp/alumnosyprofesdederecho.xls'; Query OK, 2 rows affected, 1 warning (0.002 sec) MariaDB [matricula2]> select distinct carrera.carrera 'CARRERA', matricula.valorsemestre 'VALOR SEMESTRE' from carrera,matricula where carrera.codcarre=matricula.codcarre and matricula.codcarre='008' into outfile 'c:/xampp/semestreveterinaria'; Query OK, 1 row affected, 1 warning (0.003 sec) MariaDB [matricula2]> select alumno.nombre,profesor.nombre from alumno, profesor,matricula where alumno.codestu=matricula.codestu and matricula.codprofe=profesor.codprofe and matricula.codprofe='003' into outfile 'c:/xampp/alumnosdePortacioC.xls'; Query OK, 2 rows affected, 1 warning (0.003 sec) MariaDB [matricula2]> select max(valorsemestre)'VALOR MAS ALTO DEL SEMESTRE' from matricula into outfile 'c:valormasaltodematriculaa.xls'; Query OK, 1 row affected, 1 warning (0.002 sec) MariaDB [matricula2]> select avg(valorsemestre)'Promedio Del Sesmestre' from matricula into outfile 'c:/xampp/promedio.xls'; Query OK, 1 row affected, 1 warning (0.002 sec)