Microsoft Windows [Versión 10.0.17763.1] (c) 2018 Microsoft Corporation. Todos los derechos reservados. C:\Users\KHANDENY>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 8 Server version: 10.4.20-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)]> show databases: -> ; 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 ':' at line 1 MariaDB [(none)]> show databases; +--------------------------+ | Database | +--------------------------+ | informacion_de_matricula | | information_schema | | libreria | | libreria2 | | matricula2 | | mysql | | performance_schema | | phpmyadmin | | test | +--------------------------+ 9 rows in set (0.104 sec) MariaDB [(none)]> use matricula2; Database changed MariaDB [matricula2]> show tables; +----------------------+ | Tables_in_matricula2 | +----------------------+ | acudiente | | alumcar | | alumno | | carrera | | matricula | | profcar | | profesor | +----------------------+ 7 rows in set (0.001 sec) MariaDB [matricula2]> select nombre 'PROFESORES QUE DICTAN LA CARRERA DE INGENIERIA DE SISTEMAS' from profesor where codprofe='001'; +------------------------------------------------------------+ | PROFESORES QUE DICTAN LA CARRERA DE INGENIERIA DE SISTEMAS | +------------------------------------------------------------+ | Pablo Juan Gutierrez | +------------------------------------------------------------+ 1 row in set (0.199 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.017 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.001 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.076 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.020 sec) MariaDB [matricula2]> select nombre from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu='003' and codestu='005'; ERROR 1052 (23000): Column 'nombre' in field list is ambiguous MariaDB [matricula2]> select * from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu='003' and codestu='005'; Empty set (0.001 sec) MariaDB [matricula2]> select * from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu='003'; +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | codprofe | nombre | direccion | telefono | codestu | nombre | direccion | telefono | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | 003 | Portacio Cartagena | cra 36-01 | 4596321 | 003 | Federico Aguilar | Cra 26 | 4569782 | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select * from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu in ('003','004','005'); +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | codprofe | nombre | direccion | telefono | codestu | nombre | direccion | telefono | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | 003 | Portacio Cartagena | cra 36-01 | 4596321 | 003 | Federico Aguilar | Cra 26 | 4569782 | | 004 | Federico Aguilar | cra 56-41 | 7895624 | 004 | Angel Cuadrado | Cra 44 | 6398521 | | 005 | Alberto Cifuentes | cra 20-30 | 7895002 | 005 | Catalina Escobar | Cra 78 | 4652300 | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ 3 rows in set (0.068 sec) MariaDB [matricula2]> select * from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu in ('003','005'); +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | codprofe | nombre | direccion | telefono | codestu | nombre | direccion | telefono | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | 003 | Portacio Cartagena | cra 36-01 | 4596321 | 003 | Federico Aguilar | Cra 26 | 4569782 | | 005 | Alberto Cifuentes | cra 20-30 | 7895002 | 005 | Catalina Escobar | Cra 78 | 4652300 | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> select * from profesor inner join alumno on profesor.codprofe=alumno.codestu where codprofe='004' and where codestu in('003','005'); 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 'where codestu in('003','005')' at line 1 MariaDB [matricula2]> select * from profesor inner join alumno on profesor.codprofe=alumno.codestu where codprofe='004' and codestu in('003','005'); Empty set (0.001 sec) MariaDB [matricula2]> select nombre.profesor from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu in('003','005'); ERROR 1054 (42S22): Unknown column 'nombre.profesor' in 'field list' MariaDB [matricula2]> select nombre from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu in('003','005'); ERROR 1052 (23000): Column 'nombre' in field list is ambiguous MariaDB [matricula2]> select * from profesor inner join alumno on profesor.codprofe=alumno.codestu where codestu in('003','005'); +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | codprofe | nombre | direccion | telefono | codestu | nombre | direccion | telefono | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ | 003 | Portacio Cartagena | cra 36-01 | 4596321 | 003 | Federico Aguilar | Cra 26 | 4569782 | | 005 | Alberto Cifuentes | cra 20-30 | 7895002 | 005 | Catalina Escobar | Cra 78 | 4652300 | +----------+--------------------+-----------+----------+---------+------------------+-----------+----------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> select nombre.profesor, nombre.alumno from profesor, alumno where codprofe='004' and alumno.codestu in('003','005'); ERROR 1054 (42S22): Unknown column 'nombre.profesor' in 'field list' MariaDB [matricula2]> select profesor.nombre, alumno.nombre from profesor, alumno where codprofe='004' and alumno.codestu in('003','005'); +------------------+------------------+ | nombre | nombre | +------------------+------------------+ | Federico Aguilar | Federico Aguilar | | Federico Aguilar | Catalina Escobar | +------------------+------------------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> show tables; +----------------------+ | Tables_in_matricula2 | +----------------------+ | acudiente | | alumcar | | alumno | | carrera | | matricula | | profcar | | profesor | +----------------------+ 7 rows in set (0.001 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.149 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.001 sec) MariaDB [matricula2]> select profesor.codprofe 'CODIGO DEL PROFESOR', profesor.nombre 'NOMBRE DEL PROFESOR', alumno.nombre 'NOMBRE DEL ALUMNO' from profesor, alumno where codprofe='004' and alumno.codestu in('003','005'); +---------------------+---------------------+-------------------+ | CODIGO DEL PROFESOR | NOMBRE DEL PROFESOR | NOMBRE DEL ALUMNO | +---------------------+---------------------+-------------------+ | 004 | Federico Aguilar | Federico Aguilar | | 004 | Federico Aguilar | Catalina Escobar | +---------------------+---------------------+-------------------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> show tables; +----------------------+ | Tables_in_matricula2 | +----------------------+ | acudiente | | alumcar | | alumno | | carrera | | matricula | | profcar | | profesor | +----------------------+ 7 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.001 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.001 sec) MariaDB [matricula2]> select matricula.codmatricula 'CODIGO DE MATRICULA', alumno.nombre 'NOMBRE DEL ALUMNO', matricula.valorsemestre 'VALOR DEL SEMESTRE' from matricula, alumno where codmatri in('006','002'); ERROR 1054 (42S22): Unknown column 'matricula.codmatricula' in 'field list' MariaDB [matricula2]> select matricula.codmatri 'CODIGO DE MATRICULA', alumno.nombre 'NOMBRE DEL ALUMNO', matricula.valorsemestre 'VALOR DEL SEMESTRE' from matricula, alumno where codmatri in('006','002'); +---------------------+-------------------+--------------------+ | CODIGO DE MATRICULA | NOMBRE DEL ALUMNO | VALOR DEL SEMESTRE | +---------------------+-------------------+--------------------+ | 002 | Juan Tobon | 3500000 | | 006 | Juan Tobon | 3500000 | | 002 | Mario Gonzales | 3500000 | | 006 | Mario Gonzales | 3500000 | | 002 | Federico Aguilar | 3500000 | | 006 | Federico Aguilar | 3500000 | | 002 | Angel Cuadrado | 3500000 | | 006 | Angel Cuadrado | 3500000 | | 002 | Catalina Escobar | 3500000 | | 006 | Catalina Escobar | 3500000 | | 002 | Paulina Borja | 3500000 | | 006 | Paulina Borja | 3500000 | +---------------------+-------------------+--------------------+ 12 rows in set (0.062 sec) MariaDB [matricula2]> select matricula.codmatri 'CODIGO DE MATRICULA', alumno.nombre 'NOMBRE DEL ALUMNO', matricula.valorsemestre 'VALOR DEL SEMESTRE' from matricula, alumno where codestu in('003','001'); ERROR 1052 (23000): Column 'codestu' in where clause is ambiguous MariaDB [matricula2]> select distinct matricula.codmatri 'CODIGO DE MATRICULA', alumno.nombre 'NOMBRE DEL ALUMNO', matricula.valorsemestre 'VALOR DEL SEMESTRE' from matricula, alumno where codmatri in('006','002'); +---------------------+-------------------+--------------------+ | CODIGO DE MATRICULA | NOMBRE DEL ALUMNO | VALOR DEL SEMESTRE | +---------------------+-------------------+--------------------+ | 002 | Juan Tobon | 3500000 | | 006 | Juan Tobon | 3500000 | | 002 | Mario Gonzales | 3500000 | | 006 | Mario Gonzales | 3500000 | | 002 | Federico Aguilar | 3500000 | | 006 | Federico Aguilar | 3500000 | | 002 | Angel Cuadrado | 3500000 | | 006 | Angel Cuadrado | 3500000 | | 002 | Catalina Escobar | 3500000 | | 006 | Catalina Escobar | 3500000 | | 002 | Paulina Borja | 3500000 | | 006 | Paulina Borja | 3500000 | +---------------------+-------------------+--------------------+ 12 rows in set (0.093 sec) MariaDB [matricula2]> select distinct matricula.codmatri 'CODIGO DE MATRICULA', alumno.nombre 'NOMBRE DEL ALUMNO', matricula.valorsemestre 'VALOR DEL SEMESTRE' from matricula, alumno where codmatri between '006' and '002'; Empty set (0.069 sec) MariaDB [matricula2]> select matricula.codmatri 'CODIGO DE MATRICULA', alumno.nombre 'NOMBRE DEL ALUMNO', matricula.valorsemestre 'VALOR DEL SEMESTRE' from matricula, alumno where codmatri='006' or codmatri='002'; +---------------------+-------------------+--------------------+ | CODIGO DE MATRICULA | NOMBRE DEL ALUMNO | VALOR DEL SEMESTRE | +---------------------+-------------------+--------------------+ | 002 | Juan Tobon | 3500000 | | 006 | Juan Tobon | 3500000 | | 002 | Mario Gonzales | 3500000 | | 006 | Mario Gonzales | 3500000 | | 002 | Federico Aguilar | 3500000 | | 006 | Federico Aguilar | 3500000 | | 002 | Angel Cuadrado | 3500000 | | 006 | Angel Cuadrado | 3500000 | | 002 | Catalina Escobar | 3500000 | | 006 | Catalina Escobar | 3500000 | | 002 | Paulina Borja | 3500000 | | 006 | Paulina Borja | 3500000 | +---------------------+-------------------+--------------------+ 12 rows in set (0.001 sec) MariaDB [matricula2]> select distinct matricula.codmatri 'CODIGO DE MATRICULA', alumno.nombre 'NOMBRE DEL ALUMNO', matricula.valorsemestre 'VALOR DEL SEMESTRE' from matricula, alumno where codmatri='006' or codmatri='002'; +---------------------+-------------------+--------------------+ | CODIGO DE MATRICULA | NOMBRE DEL ALUMNO | VALOR DEL SEMESTRE | +---------------------+-------------------+--------------------+ | 002 | Juan Tobon | 3500000 | | 006 | Juan Tobon | 3500000 | | 002 | Mario Gonzales | 3500000 | | 006 | Mario Gonzales | 3500000 | | 002 | Federico Aguilar | 3500000 | | 006 | Federico Aguilar | 3500000 | | 002 | Angel Cuadrado | 3500000 | | 006 | Angel Cuadrado | 3500000 | | 002 | Catalina Escobar | 3500000 | | 006 | Catalina Escobar | 3500000 | | 002 | Paulina Borja | 3500000 | | 006 | Paulina Borja | 3500000 | +---------------------+-------------------+--------------------+ 12 rows in set (0.001 sec) MariaDB [matricula2]> show tables; +----------------------+ | Tables_in_matricula2 | +----------------------+ | acudiente | | alumcar | | alumno | | carrera | | matricula | | profcar | | profesor | +----------------------+ 7 rows in set (0.001 sec) MariaDB [matricula2]> select profesor.nombre 'NOMBRE DEL PROFESOR', alumno.nombre 'NOMBRE DEL ALUMNO' from profesor, alumno where profesor.nombre like 'Porta%'; +---------------------+-------------------+ | NOMBRE DEL PROFESOR | NOMBRE DEL ALUMNO | +---------------------+-------------------+ | Portacio Cartagena | Juan Tobon | | Portacio Cartagena | Mario Gonzales | | Portacio Cartagena | Federico Aguilar | | Portacio Cartagena | Angel Cuadrado | | Portacio Cartagena | Catalina Escobar | | Portacio Cartagena | Paulina Borja | +---------------------+-------------------+ 6 rows in set (0.001 sec) MariaDB [matricula2]> select distinct profesor.nombre 'NOMBRE DEL PROFESOR', alumno.nombre 'NOMBRE DEL ALUMNO' from profesor, alumno where profesor.nombre like 'Porta%'; +---------------------+-------------------+ | NOMBRE DEL PROFESOR | NOMBRE DEL ALUMNO | +---------------------+-------------------+ | Portacio Cartagena | Juan Tobon | | Portacio Cartagena | Mario Gonzales | | Portacio Cartagena | Federico Aguilar | | Portacio Cartagena | Angel Cuadrado | | Portacio Cartagena | Catalina Escobar | | Portacio Cartagena | Paulina Borja | +---------------------+-------------------+ 6 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.001 sec) MariaDB [matricula2]> select max(valorsemestre) 'VALOR DEL SEMESTRE MAS ALTO' from matricula; +-----------------------------+ | VALOR DEL SEMESTRE MAS ALTO | +-----------------------------+ | 3500000 | +-----------------------------+ 1 row in set (0.102 sec) MariaDB [matricula2]> select avg(valorsemestre) 'PROMEDIO DEL VALOR DEL SEMESTRE' from matricula; +---------------------------------+ | PROMEDIO DEL VALOR DEL SEMESTRE | +---------------------------------+ | 2558333.3333333335 | +---------------------------------+ 1 row in set (0.007 sec) MariaDB [matricula2]> select * 'NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno where alumno.nombre like 'A%' or like '%R'; 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 ''NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno wher...' at line 1 MariaDB [matricula2]> select * 'NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno where nombre like 'A%' or like '%R'; 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 ''NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno wher...' at line 1 MariaDB [matricula2]> select * from alumno where nombre like 'A%' or like '%R'; 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 'like '%R'' at line 1 MariaDB [matricula2]> select * from alumno where nombre like 'A%' and like '%R'; 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 'like '%R'' at line 1 MariaDB [matricula2]> select * from alumno where nombre like 'a%' and like '%r'; 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 'like '%r'' at line 1 MariaDB [matricula2]> select * 'NOMBRES DE ALUMNOS QUE COMIENCEN POR -A-' from alumno where alumno.nombre like 'A%'; 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 ''NOMBRES DE ALUMNOS QUE COMIENCEN POR -A-' from alumno where alumno.nombre li...' at line 1 MariaDB [matricula2]> select * 'NOMBRES DE ALUMNOS QUE COMIENCEN POR -A-' from alumno where nombre like 'A%'; 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 ''NOMBRES DE ALUMNOS QUE COMIENCEN POR -A-' from alumno where nombre like 'A%'' at line 1 MariaDB [matricula2]> select * from alumno where nombre like 'A%'; +---------+----------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+----------------+-----------+----------+ | 004 | Angel Cuadrado | Cra 44 | 6398521 | +---------+----------------+-----------+----------+ 1 row 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.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'R%'; Empty set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'r%'; Empty set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'R%'; Empty set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'r%'; Empty set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'r%'; Empty set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like '%r%'; +---------+------------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+------------------+-----------+----------+ | 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 | +---------+------------------+-----------+----------+ 5 rows in set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'R%'; Empty set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like 'Aguilar%'; Empty set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like '%Aguilar'; +---------+------------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+------------------+-----------+----------+ | 003 | Federico Aguilar | Cra 26 | 4569782 | +---------+------------------+-----------+----------+ 1 row in set (0.001 sec) MariaDB [matricula2]> select * from alumno where nombre like '%r'; +---------+------------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+------------------+-----------+----------+ | 003 | Federico Aguilar | Cra 26 | 4569782 | | 005 | Catalina Escobar | Cra 78 | 4652300 | +---------+------------------+-----------+----------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> select * 'NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno where nombre like '%A' or like '%R'; 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 ''NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno wher...' at line 1 MariaDB [matricula2]> select * 'NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno where nombre like '%A' and '%R'; 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 ''NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno wher...' at line 1 MariaDB [matricula2]> select * 'NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno where nombre like '%A' and 'r%'; 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 ''NOMBRES DE ALUMNOS QUE COMIENCEN POR -A- O TERMINEN EN -R-' from alumno wher...' at line 1 MariaDB [matricula2]> select * from alumno where nombre like '%r'; +---------+------------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+------------------+-----------+----------+ | 003 | Federico Aguilar | Cra 26 | 4569782 | | 005 | Catalina Escobar | Cra 78 | 4652300 | +---------+------------------+-----------+----------+ 2 rows in set (0.001 sec) MariaDB [matricula2]> select count(*) from matricula; +----------+ | count(*) | +----------+ | 6 | +----------+ 1 row in set (0.012 sec) MariaDB [matricula2]> select * matricula; 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 'matricula' at line 1 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.001 sec) MariaDB [matricula2]> show tables; +----------------------+ | Tables_in_matricula2 | +----------------------+ | acudiente | | alumcar | | alumno | | carrera | | matricula | | profcar | | profesor | +----------------------+ 7 rows in set (0.001 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.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.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.001 sec) MariaDB [matricula2]> select * where codmatri between '001' and '006'; ERROR 1096 (HY000): No tables used MariaDB [matricula2]> select * from matricula where codmatri betweeen '001' and '006'; 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 'betweeen '001' and '006'' at line 1 MariaDB [matricula2]> select * from matricula where codmatri between '001' and '006'; +----------+---------+----------+----------+---------------+ | 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.028 sec) MariaDB [matricula2]> select matricula.valorsemestre, matricula.codcarre from matricula where codmatri between '001' and '006'; +---------------+----------+ | valorsemestre | codcarre | +---------------+----------+ | 1800000 | 004 | | 3500000 | 008 | | 2800000 | 007 | | 1950000 | 007 | | 1800000 | 004 | | 3500000 | 008 | +---------------+----------+ 6 rows in set (0.001 sec) MariaDB [matricula2]> select alumno.nombre, matricula.valorsemestre, matricula.codcarre from matricula, alumno where codmatri between '001' and '006'; +------------------+---------------+----------+ | nombre | valorsemestre | codcarre | +------------------+---------------+----------+ | Juan Tobon | 1800000 | 004 | | Juan Tobon | 3500000 | 008 | | Juan Tobon | 2800000 | 007 | | Juan Tobon | 1950000 | 007 | | Juan Tobon | 1800000 | 004 | | Juan Tobon | 3500000 | 008 | | Mario Gonzales | 1800000 | 004 | | Mario Gonzales | 3500000 | 008 | | Mario Gonzales | 2800000 | 007 | | Mario Gonzales | 1950000 | 007 | | Mario Gonzales | 1800000 | 004 | | Mario Gonzales | 3500000 | 008 | | Federico Aguilar | 1800000 | 004 | | Federico Aguilar | 3500000 | 008 | | Federico Aguilar | 2800000 | 007 | | Federico Aguilar | 1950000 | 007 | | Federico Aguilar | 1800000 | 004 | | Federico Aguilar | 3500000 | 008 | | Angel Cuadrado | 1800000 | 004 | | Angel Cuadrado | 3500000 | 008 | | Angel Cuadrado | 2800000 | 007 | | Angel Cuadrado | 1950000 | 007 | | Angel Cuadrado | 1800000 | 004 | | Angel Cuadrado | 3500000 | 008 | | Catalina Escobar | 1800000 | 004 | | Catalina Escobar | 3500000 | 008 | | Catalina Escobar | 2800000 | 007 | | Catalina Escobar | 1950000 | 007 | | Catalina Escobar | 1800000 | 004 | | Catalina Escobar | 3500000 | 008 | | Paulina Borja | 1800000 | 004 | | Paulina Borja | 3500000 | 008 | | Paulina Borja | 2800000 | 007 | | Paulina Borja | 1950000 | 007 | | Paulina Borja | 1800000 | 004 | | Paulina Borja | 3500000 | 008 | +------------------+---------------+----------+ 36 rows in set (0.001 sec) MariaDB [matricula2]> select distinct alumno.nombre, matricula.valorsemestre, matricula.codcarre from matricula, alumno where codmatri between '001' and '006'; +------------------+---------------+----------+ | nombre | valorsemestre | codcarre | +------------------+---------------+----------+ | Juan Tobon | 1800000 | 004 | | Juan Tobon | 3500000 | 008 | | Juan Tobon | 2800000 | 007 | | Juan Tobon | 1950000 | 007 | | Mario Gonzales | 1800000 | 004 | | Mario Gonzales | 3500000 | 008 | | Mario Gonzales | 2800000 | 007 | | Mario Gonzales | 1950000 | 007 | | Federico Aguilar | 1800000 | 004 | | Federico Aguilar | 3500000 | 008 | | Federico Aguilar | 2800000 | 007 | | Federico Aguilar | 1950000 | 007 | | Angel Cuadrado | 1800000 | 004 | | Angel Cuadrado | 3500000 | 008 | | Angel Cuadrado | 2800000 | 007 | | Angel Cuadrado | 1950000 | 007 | | Catalina Escobar | 1800000 | 004 | | Catalina Escobar | 3500000 | 008 | | Catalina Escobar | 2800000 | 007 | | Catalina Escobar | 1950000 | 007 | | Paulina Borja | 1800000 | 004 | | Paulina Borja | 3500000 | 008 | | Paulina Borja | 2800000 | 007 | | Paulina Borja | 1950000 | 007 | +------------------+---------------+----------+ 24 rows in set (0.001 sec) MariaDB [matricula2]> select * from alumno where codigoest='006'; ERROR 1054 (42S22): Unknown column 'codigoest' in 'where clause' 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.001 sec) MariaDB [matricula2]> select * from alumno where codestu='006'; +---------+---------------+-----------+----------+ | codestu | nombre | direccion | telefono | +---------+---------------+-----------+----------+ | 006 | Paulina Borja | Cra 45 | 4599632 | +---------+---------------+-----------+----------+ 1 row in set (0.001 sec) MariaDB [matricula2]>