Microsoft Windows [Versión 10.0.19044.2006] (c) Microsoft Corporation. Todos los derechos reservados. C:\Users\Harold Martinez>cd/xampp/mysql/bin C:\xampp\mysql\bin>mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 47 Server version: 10.4.24-MariaDB mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> source C:\xampp\matricula2.sql Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Database changed Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.002 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 4 rows affected (0.001 sec) Records: 4 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.005 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.008 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.004 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 6 rows affected (0.002 sec) Records: 6 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.004 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.009 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.003 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 8 rows affected (0.001 sec) Records: 8 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.005 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.002 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 6 rows affected (0.002 sec) Records: 6 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.006 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.003 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 10 rows affected (0.004 sec) Records: 10 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.007 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.010 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.004 sec) Query OK, 0 rows affected (0.001 sec) Query OK, 6 rows affected (0.002 sec) Records: 6 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.001 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 sec) Query OK, 0 rows affected (0.000 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.003 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.003 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.003 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 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.003 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 carrera.codcarre, carrera.carrera, profesor.codprofe, profesor.nombre from carrera right join profcar on carrera.codcarre=profcar.codcarre right join profesor on profcar.codprofe=profesor.codprofe where carrera.carrera = ‘Ingenieria de Sistemas’; +----------+------------------------+----------+--------------------+ | codcarre | carrera | codprofe | nombre | +----------+------------------------+----------+--------------------+ | 001 | Ingenieria de Sistemas | 005 | Alberto Cifuentes | | 001 | Ingenieria de Sistemas | 003 | Portacio Cartagena | +----------+------------------------+----------+--------------------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> Select alumno.codestu, alumno.nombre, carrera.codcarre, carrera.carrera, profesor.codprofe, profesor.nombre from alumno inner join alumcar on alumno.codestu = alumcar.codestu inner join carrera on alumcar.codcarre = carrera.codcarre inner join profcar on carrera.codcarre= profcar.codcarre inner join profesor on profcar.codprofe= profesor.codprofe where carrera.carrera = ‘Derecho’; Empty set (0.001 sec) MariaDB [matricula2]> Select alumno.codestu, alumno.nombre, carrera.codcarre, carrera.carrera, profesor.codprofe, profesor.nombre from alumno inner join alumcar on alumno.codestu = alumcar.codestu inner join carrera on alumcar.codcarre = carrera.codcarre inner join profcar on carrera.codcarre= profcar.codcarre inner join profesor on profcar.codprofe= profesor.codprofe; +---------+------------------+----------+-------------------------+----------+--------------------+ | codestu | nombre | codcarre | carrera | codprofe | nombre | +---------+------------------+----------+-------------------------+----------+--------------------+ | 001 | Juan Tobon | 002 | Contaduria | 004 | Federico Aguilar | | 003 | Federico Aguilar | 005 | Ingenieria Agropecuaria | 005 | Alberto Cifuentes | | 005 | Catalina Escobar | 001 | Ingenieria de Sistemas | 005 | Alberto Cifuentes | | 005 | Catalina Escobar | 001 | Ingenieria de Sistemas | 003 | Portacio Cartagena | | 001 | Juan Tobon | 005 | Ingenieria Agropecuaria | 005 | Alberto Cifuentes | +---------+------------------+----------+-------------------------+----------+--------------------+ 5 rows in set (0.001 sec) MariaDB [matricula2]> Select valorsemestre from matricula where codcarre = 008; +---------------+ | valorsemestre | +---------------+ | 3500000 | | 3500000 | +---------------+ 2 rows in set (0.000 sec) MariaDB [matricula2]> Select alumno.codestu, alumno.nombre, profesor.codprofe, profesor.nombre from alumno inner join alumcar on alumno.codestu = alumcar.codestu inner join carrera on alumcar.codcarre = carrera.codcarre inner join profcar on carrera.codcarre= profcar.codcarre inner join profesor on profcar.codprofe= profesor.codprofe where profesor.nombre = ‘Portacio Cartagena’; +---------+------------------+----------+--------------------+ | codestu | nombre | codprofe | nombre | +---------+------------------+----------+--------------------+ | 005 | Catalina Escobar | 003 | Portacio Cartagena | +---------+------------------+----------+--------------------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select max(valorsemestre) ‘Semestre mas caro’ from matricula; +-------------------+ | Semestre mas caro | +-------------------+ | 3500000 | +-------------------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select avg(valorsemestre) ‘Promedio valor semestre’ from matricula; +-------------------------+ | Promedio valor semestre | +-------------------------+ | 2558333.3333333335 | +-------------------------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'A%' or nombre like '%R'; +---------+------------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+------------------+-----------+----------+ | 003 | Federico Aguilar | Cra 26 | 4569782 | | 004 | Angel Cuadrado | Cra 44 | 6398521 | | 005 | Catalina Escobar | Cra 78 | 4652300 | +---------+------------------+-----------+----------+ 3 rows in set (0.001 sec) MariaDB [matricula2]> select *, SUM(valorsemestre) from matricula group by codcarre; +----------+---------+----------+----------+---------------+--------------------+ | codmatri | codestu | codcarre | codprofe | valorsemestre | SUM(valorsemestre) | +----------+---------+----------+----------+---------------+--------------------+ | 001 | 003 | 004 | 004 | 1800000 | 3600000 | | 003 | 004 | 007 | 006 | 2800000 | 4750000 | | 002 | 001 | 008 | 003 | 3500000 | 7000000 | +----------+---------+----------+----------+---------------+--------------------+ 3 rows in set (0.001 sec) MariaDB [matricula2]> select alumno.codestu, alumno.nombre, matricula.codestu from alumno left join matricula on alumno.codestu=matricula.codestu where matricula.codestu is null; +---------+---------------+---------+ | codestu | nombre | codestu | +---------+---------------+---------+ | 006 | Paulina Borja | NULL | +---------+---------------+---------+ 1 row in set (0.001 sec) MariaDB [matricula2]> exit Bye C:\xampp\mysql\bin>mysqldump -B -uroot -p matricula2>c:/xampp/matricula2.sql Enter password: C:\xampp\mysql\bin>