Microsoft Windows [Versión 10.0.22631.3880] (c) Microsoft Corporation. Todos los derechos reservados. C:\Users\A01-1-0504-20>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 9 Server version: 10.4.21-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)]> use clinica_mayo; Database changed MariaDB [clinica_mayo]> create table paciente -> codpaciente int (10) not null primary key, -> nombre1 varchar (50) not null, -> nombre2 varchar (50), -> apellido1 varchar (50) not null, -> apellido2 varchar (50) not null, -> numero int (12), -> direccion varchar (50) not null, -> correo varchar (40) 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 'int (10) not null primary key, nombre1 varchar (50) not null, nombre2 varchar...' at line 2 MariaDB [clinica_mayo]> create table paciente -> (codpaciente int (10) not null primary key, -> nombre1 varchar (50) not null, -> nombre2 varchar (50), -> apellido1 varchar (50) not null, -> apellido2 varchar (50) not null, -> numero int (12), -> direccion varchar (50) not null, -> correo varchar (40) not null); Query OK, 0 rows affected (1.663 sec) MariaDB [clinica_mayo]> create table medico -> (codmedico int (10) not null primary key, -> nombre1 varchar (50) not null, -> nombre2 varchar (50), -> apellido1 varchar (50) not null, -> apellido2 varchar (50) not null, -> telefono int (12)not null, -> correo varchar (40) not null); Query OK, 0 rows affected (0.279 sec) MariaDB [clinica_mayo]> create table planta -> (codtriage int (20) not null primary key, -> cuidados_intensivos int (60), -> traumatologian int (50)); Query OK, 0 rows affected (0.297 sec) MariaDB [clinica_mayo]> CREATE TABLE planta ( -> codplanta INT(20) NOT NULL primary key, -> cuidados_intensivos INT(60), -> traumatologian INT(50) -> ); ERROR 1050 (42S01): Table 'planta' already exists MariaDB [clinica_mayo]> ALTER TABLE planta -> CHANGE COLUMN codtriage codplanta INT(20) NOT NULL; Query OK, 0 rows affected (0.158 sec) Records: 0 Duplicates: 0 Warnings: 0 MariaDB [clinica_mayo]> create table triage -> (codtraige int (10) not null, -> rojo varchar (8) not null, -> naranja varchar (8) not; 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 4 MariaDB [clinica_mayo]> create table triage -> (codtraige int (10) not null, -> rojo varchar (8), -> naranja varchar (8), -> amarrillo varchar (8), -> verde varchar (8), -> azul varchar (8)); Query OK, 0 rows affected (0.264 sec) MariaDB [clinica_mayo]> create table clasificacion -> (codclasificacion int (20) not null primary key, -> codmedico int (10) not null, -> codresultado int (20) not null, -> foreign key (codmedico) references medico(codmedico) on delete cascade on update cascade, -> foreign key (codresultado) references resultado(codresultado) on delete cascade on update casca de); ERROR 1005 (HY000): Can't create table `clinica_mayo`.`clasificacion` (errno: 150 "Foreign key constraint is incorrectly formed") MariaDB [clinica_mayo]> create table clasificacion -> (codclasificacion int (20) not null primary key, -> codmedico int (10) not null, -> codresultado int (20) not null, -> foreign key (codmedico) references medico(codmedico) on delete cascade on update cascade, -> foreign key (codresultado) references resultado(codresultado) on delete cascade on update cascade); ERROR 1005 (HY000): Can't create table `clinica_mayo`.`clasificacion` (errno: 150 "Foreign key constraint is incorrectly formed") MariaDB [clinica_mayo]> show table; 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 [clinica_mayo]> show tables ; +------------------------+ | Tables_in_clinica_mayo | +------------------------+ | medico | | paciente | | planta | | triage | +------------------------+ 4 rows in set (0.000 sec) MariaDB [clinica_mayo]> create table clasificacion -> (codclasificacion int (20) not null primary key, -> codmedico int (10) not null, -> codresultado int (10) not null, -> foreign key (codmedico) references medico(codmedico) on delete cascade on update cascade, -> foreign key (codresultado) references resultado(codresultado) on delete cascade on update cascade); ERROR 1005 (HY000): Can't create table `clinica_mayo`.`clasificacion` (errno: 150 "Foreign key constraint is incorrectly formed") MariaDB [clinica_mayo]> create table resultado -> (codresultado int (20) not null primary key, -> codpaciente int (10) not null, -> codtriage (10) not null, -> foreign key (codpaciente) references paciente(codpaciente) on delete cascade on update cascade, -> fforeign key (codtraige) references triage(codtraige) 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 '(10) not null, foreign key (codpaciente) references paciente(codpaciente) on ...' at line 4 MariaDB [clinica_mayo]> create table resultado -> (codresultado int (20) not null primary key, -> codpaciente int (10) not null, -> codtriage (10) not null, -> foreign key (codpaciente) references paciente(codpaciente) on delete cascade on update cascade, -> foreign key (codtraige) references triage(codtraige) 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 '(10) not null, foreign key (codpaciente) references paciente(codpaciente) on ...' at line 4 MariaDB [clinica_mayo]> MariaDB [clinica_mayo]> create table resultado -> (codresultado int(20) not null primary key, -> codtraige int(10) not nul, -> foreign key (codtraige) references triage(codtraige) 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 'nul, foreign key (codtraige) references triage(codtraige) on delete cascade o...' at line 3 MariaDB [clinica_mayo]> create table resultado -> (codresultado int(20) not null primary key, -> codtraige int(10) not null, -> foreign key (codtraige) references triage(codtraige) on delete cascade on update cascade); Query OK, 0 rows affected (0.031 sec) MariaDB [clinica_mayo]> create table clasificacion -> (codclasificacion int(10) not null primary key, -> codpaciente int (10) not null, -> codmedico int(10) not null, -> codresultado int (20) not null, -> foreign key (codpaciente) references paciente(codpaciente) on del ete cascade on update cascade, -> foreign key (codmedico) references medico(codmedico) on delete ca scade on update cascade, -> foreign key (codresultado) references resultado(codresultado) on delete cascade on update cascade); Query OK, 0 rows affected (0.037 sec) MariaDB [clinica_mayo]> show tables ; +------------------------+ | Tables_in_clinica_mayo | +------------------------+ | clasificacion | | medico | | paciente | | planta | | resultado | | triage | +------------------------+ 6 rows in set (0.003 sec) MariaDB [clinica_mayo]> insert into medico(codmedico, nombre1, nombre2, apellido1, apellido2, telefono, correo) values -> (1,'Carlos', 'Alberto','Gonzales','Perez', 123456789,'carlos.alberto@ejemplo.com'), -> (2, 'Maria', 'Luisa', 'Fernanda', 'Perez', 1234567890, 'Marialuisa@ejemplo.com'), -> (3, 'Juan', 'Pablo', 'George', 'Calderon', 3245405917, 'juangeorge@ejemplo.com'), -> (4, 'Andres', 'felipe', 'Correa', 'Lopez', 987347658, 'andrescorrea@ejemplo.com'), -> (5, 'javier','', 'Taborda', 'Muriel',57483298, 'javiermueriel@eje mplo.com'); Query OK, 5 rows affected, 1 warning (0.010 sec) Records: 5 Duplicates: 0 Warnings: 1 MariaDB [clinica_mayo]> insert into medico(codmedico, nombre1, nombre2, apellido1, apellido2, telefono, correo) values -> (6, 'Laura', 'Beatriz', 'Morales', 'Díaz', 1234567895, 'laura.morales@example.com'), -> (7, 'Jorge', 'Luis', 'Torres', 'Ríos', 1234567896, 'jorge.torres@example.com'), -> (8, 'Elena', 'Patricia', 'Cruz', 'Mendoza', 1234567897, 'elena.cruz@example.com'), -> (9, 'Ricardo', 'Emilio', 'Vargas', 'Ortiz', 1234567898, 'ricardo.vargas@example.com'), -> (10, 'Sofía', 'Gabriela', 'Castro', 'Reyes', 1234567899, 'sofia.castro@example.com'); Query OK, 5 rows affected (0.005 sec) Records: 5 Duplicates: 0 Warnings: 0 MariaDB [clinica_mayo]> select * from medico ; +-----------+---------+----------+-----------+-----------+------------+----------------------------+ | codmedico | nombre1 | nombre2 | apellido1 | apellido2 | telefono | correo | +-----------+---------+----------+-----------+-----------+------------+----------------------------+ | 1 | Carlos | Alberto | Gonzales | Perez | 123456789 | carlos.alberto@ejemplo.com | | 2 | Maria | Luisa | Fernanda | Perez | 1234567890 | Marialuisa@ejemplo.com | | 3 | Juan | Pablo | George | Calderon | 2147483647 | juangeorge@ejemplo.com | | 4 | Andres | felipe | Correa | Lopez | 987347658 | andrescorrea@ejemplo.com | | 5 | javier | | Taborda | Muriel | 57483298 | javiermueriel@ejemplo.com | | 6 | Laura | Beatriz | Morales | Díaz | 1234567895 | laura.morales@example.com | | 7 | Jorge | Luis | Torres | Ríos | 1234567896 | jorge.torres@example.com | | 8 | Elena | Patricia | Cruz | Mendoza | 1234567897 | elena.cruz@example.com | | 9 | Ricardo | Emilio | Vargas | Ortiz | 1234567898 | ricardo.vargas@example.com | | 10 | Sofía | Gabriela | Castro | Reyes | 1234567899 | sofia.castro@example.com | +-----------+---------+----------+-----------+-----------+------------+----------------------------+ 10 rows in set (0.003 sec) MariaDB [clinica_mayo]> describe paciente; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+-------+ | codpaciente | int(10) | NO | PRI | NULL | | | nombre1 | varchar(50) | NO | | NULL | | | nombre2 | varchar(50) | YES | | NULL | | | apellido1 | varchar(50) | NO | | NULL | | | apellido2 | varchar(50) | NO | | NULL | | | numero | int(12) | YES | | NULL | | | direccion | varchar(50) | NO | | NULL | | | correo | varchar(40) | NO | | NULL | | +-------------+-------------+------+-----+---------+-------+ 8 rows in set (0.009 sec) MariaDB [clinica_mayo]> INSERT INTO paciente (codpaciente, nombre1, nombre2, apellido1, apellido2, numero, direccion, correo) VALUES -> (1, 'Juan', 'Pablo', 'García', 'López', 1234567890, 'Calle Falsa 123', 'juan.garcia@ejemplo.com'), -> (2, 'Ana', 'Maria', 'Fernández', 'Ruiz', 2345678901, 'Avenida Siempre Viva 456', 'ana.fernandez@ejemplo.com'), -> (3, 'Luis', 'Alberto', 'Mendoza', 'Sánchez', 3456789012, 'Boulevard Central 789', 'luis.mendoza@ejemplo.com'), -> (4, 'Marta', 'Elena', 'Pérez', 'Gómez', 4567890123, 'Calle del Sol 101', 'marta.perez@ejemplo.com'), -> (5, 'Carlos', 'Eduardo', 'Morales', 'Jiménez', 5678901234, 'Calle de la Luna 202', 'carlos.morales@ejemplo.com'), -> (6, 'Laura', 'Cecilia', 'Hernández', 'Márquez', 6789012345, 'Avenida de la Paz 303', 'laura.hernandez@ejemplo.com'), -> (7, 'José', 'Antonio', 'Vargas', 'Molina', 7890123456, 'Calle Nueva 404', 'jose.vargas@ejemplo.com'), -> (8, 'Isabel', 'Cristina', 'Castro', 'Ramos', 8901234567, 'Plaza Mayor 505', 'isabel.castro@ejemplo.com'), -> (9, 'Pedro', 'Javier', 'Torres', 'Castillo', 9012345678, 'Calle del Mar 606', 'pedro.torres@ejemplo.com'), -> (10, 'Verónica', 'Sánchez', 'Cruz', 'García', 1023456789, 'Calle Real 707', 'veronica.sanchez@ejemplo.com'); Query OK, 10 rows affected, 8 warnings (0.004 sec) Records: 10 Duplicates: 0 Warnings: 8 MariaDB [clinica_mayo]> describe planta; +---------------------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------+---------+------+-----+---------+-------+ | codplanta | int(20) | NO | PRI | NULL | | | cuidados_intensivos | int(60) | YES | | NULL | | | traumatologian | int(50) | YES | | NULL | | +---------------------+---------+------+-----+---------+-------+ 3 rows in set (0.011 sec) MariaDB [clinica_mayo]> INSERT INTO planta(codplanta, cuidados_intensivos, traumatologian) VALUES -> (1, 6, 10), -> (2, 7, 9), -> (3, 1, 8), -> (4, 4, 5), -> (5, 2,3); Query OK, 5 rows affected (0.005 sec) Records: 5 Duplicates: 0 Warnings: 0 MariaDB [clinica_mayo]> insert into triage(codtraige, rojo, naranja, amarrillo, verde, azul) values -> (1,'','','','','traumatología'); Query OK, 1 row affected, 1 warning (0.005 sec) MariaDB [clinica_mayo]> insert into triage(codtraige, rojo, naranja, amarrillo, verde, azul) values -> (2,'','','','traumatología',''); Query OK, 1 row affected, 1 warning (0.005 sec) MariaDB [clinica_mayo]> INSERT INTO resultado (codresultado, codtraige) VALUES -> (1,1), -> (2,2), -> (3,3), -> (4,4), -> (5,5), -> (6,6), -> (7,7), -> (8,8), -> (9,9), -> (10,10); Query OK, 10 rows affected (0.005 sec) Records: 10 Duplicates: 0 Warnings: 0 MariaDB [clinica_mayo]> select * from resultado ; +--------------+-----------+ | codresultado | codtraige | +--------------+-----------+ | 1 | 1 | | 2 | 2 | | 3 | 3 | | 4 | 4 | | 5 | 5 | | 6 | 6 | | 7 | 7 | | 8 | 8 | | 9 | 9 | | 10 | 10 | +--------------+-----------+ 10 rows in set (0.001 sec) MariaDB [clinica_mayo]> describe clasificacion ; +------------------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+---------+------+-----+---------+-------+ | codclasificacion | int(10) | NO | PRI | NULL | | | codpaciente | int(10) | NO | MUL | NULL | | | codmedico | int(10) | NO | MUL | NULL | | | codresultado | int(20) | NO | MUL | NULL | | +------------------+---------+------+-----+---------+-------+ 4 rows in set (0.010 sec) MariaDB [clinica_mayo]> INSERT INTO clasificacion (codclasificacion, codpaciente, codmedico, codresultado) -> VALUES -> (1, 1, 1, 1), -> (2, 2, 2, 2), -> (3, 3, 3, 3), -> (4, 4, 4, 4), -> (5, 5, 5, 5), -> (6, 6, 6, 6), -> (7, 7, 7, 7), -> (8, 8, 8, 8), -> (9, 9, 9, 9), -> (10,10,10,10); Query OK, 10 rows affected (0.006 sec) Records: 10 Duplicates: 0 Warnings: 0 MariaDB [clinica_mayo]> select* from clasificacion; +------------------+-------------+-----------+--------------+ | codclasificacion | codpaciente | codmedico | codresultado | +------------------+-------------+-----------+--------------+ | 1 | 1 | 1 | 1 | | 2 | 2 | 2 | 2 | | 3 | 3 | 3 | 3 | | 4 | 4 | 4 | 4 | | 5 | 5 | 5 | 5 | | 6 | 6 | 6 | 6 | | 7 | 7 | 7 | 7 | | 8 | 8 | 8 | 8 | | 9 | 9 | 9 | 9 | | 10 | 10 | 10 | 10 | +------------------+-------------+-----------+--------------+ 10 rows in set (0.002 sec) MariaDB [clinica_mayo]> show tables ; +------------------------+ | Tables_in_clinica_mayo | +------------------------+ | clasificacion | | medico | | paciente | | planta | | resultado | | triage | +------------------------+ 6 rows in set (0.003 sec) MariaDB [clinica_mayo]> describe medico; +-----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+-------+ | codmedico | int(10) | NO | PRI | NULL | | | nombre1 | varchar(50) | NO | | NULL | | | nombre2 | varchar(50) | YES | | NULL | | | apellido1 | varchar(50) | NO | | NULL | | | apellido2 | varchar(50) | NO | | NULL | | | telefono | int(12) | NO | | NULL | | | correo | varchar(40) | NO | | NULL | | +-----------+-------------+------+-----+---------+-------+ 7 rows in set (0.061 sec) MariaDB [clinica_mayo]> delimiter // MariaDB [clinica_mayo]> create procedure insertar_medico( -> in codmedico int(10), -> in nombre1 varchar(50), -> in nombre2 varchar(50), -> in apellido1 varchar(50), -> in apellido2 varchar(50), -> in telefono int(12), -> in correo varchar(40)) -> begin -> insert into medico(codmedico,nombre1,nombre2,apellido1,apellido2, telefono,correo) -> values (codmedico,nombre1,nombre2,apellido1,apellido2,telefono,co rreo); -> end // Query OK, 0 rows affected (0.016 sec) MariaDB [clinica_mayo]> delimiter ; MariaDB [clinica_mayo]> call insertar_medico(11,'juan','Carlos','perez', 'Gonzales',123456734,'juancarlos@ejemplo.com'); Query OK, 1 row affected (0.006 sec) MariaDB [clinica_mayo]> select* from medico; +-----------+---------+----------+-----------+-----------+------------+----------------------------+ | codmedico | nombre1 | nombre2 | apellido1 | apellido2 | telefono | correo | +-----------+---------+----------+-----------+-----------+------------+----------------------------+ | 1 | Carlos | Alberto | Gonzales | Perez | 123456789 | carlos.alberto@ejemplo.com | | 2 | Maria | Luisa | Fernanda | Perez | 1234567890 | Marialuisa@ejemplo.com | | 3 | Juan | Pablo | George | Calderon | 2147483647 | juangeorge@ejemplo.com | | 4 | Andres | felipe | Correa | Lopez | 987347658 | andrescorrea@ejemplo.com | | 5 | javier | | Taborda | Muriel | 57483298 | javiermueriel@ejemplo.com | | 6 | Laura | Beatriz | Morales | Díaz | 1234567895 | laura.morales@example.com | | 7 | Jorge | Luis | Torres | Ríos | 1234567896 | jorge.torres@example.com | | 8 | Elena | Patricia | Cruz | Mendoza | 1234567897 | elena.cruz@example.com | | 9 | Ricardo | Emilio | Vargas | Ortiz | 1234567898 | ricardo.vargas@example.com | | 10 | Sofía | Gabriela | Castro | Reyes | 1234567899 | sofia.castro@example.com | | 11 | juan | Carlos | perez | Gonzales | 123456734 | juancarlos@ejemplo.com | +-----------+---------+----------+-----------+-----------+------------+----------------------------+ 11 rows in set (0.001 sec) MariaDB [clinica_mayo]> describe paciente; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+-------+ | codpaciente | int(10) | NO | PRI | NULL | | | nombre1 | varchar(50) | NO | | NULL | | | nombre2 | varchar(50) | YES | | NULL | | | apellido1 | varchar(50) | NO | | NULL | | | apellido2 | varchar(50) | NO | | NULL | | | numero | int(12) | YES | | NULL | | | direccion | varchar(50) | NO | | NULL | | | correo | varchar(40) | NO | | NULL | | +-------------+-------------+------+-----+---------+-------+ 8 rows in set (0.017 sec) MariaDB [clinica_mayo]> delimeter // -> create procedure insertar_paciente -> (in codpaciente int(10), -> in nombre1 varchar(50), -> in nombre2 varchar(50), -> in apellido1 varchar(50), -> in apellido2 varchar(50), -> in numero int(12), -> dirrecion varchar(50), -> correo varchar(40)) -> begin -> insert into paciente(codpaciente,nombre1,nombre2,apellido1,apellido2,numero,direccion,correo) -> values (codpaciente,nombre1,nombre2,apellido1,apellido2,numero,dirrecion,correo); 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 'delimeter // create procedure insertar_paciente (in codpaciente int(10), in n...' at line 1 MariaDB [clinica_mayo]> delimiter; ERROR: DELIMITER must be followed by a 'delimiter' character or string MariaDB [clinica_mayo]> create procedure insertar_paciente( -> in codpaciente int(10), -> in nombre1 varchar(50), -> in nombre2 varchar(50), -> in apellido1 varchar(50), -> in apellido2 varchar(50), -> in numero int(12), -> direccion varchar(50), -> correo varchar(40)) -> begin -> insert into paciente(codpaciente,nombre1,nombre2,apellido1,apellido2,numero,direccion,correo) -> values (codpaciente,nombre1,nombre2,apellido1,apellido2,numero,direccion,correo); 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 12 MariaDB [clinica_mayo]> delimiter // MariaDB [clinica_mayo]> create procedure insertar_paciente( -> in codpaciente int(10), -> in nombre1 varchar(50), -> in nombre2 varchar(50), -> in apellido1 varchar(50), -> in apellido2 varchar(50), -> in numero int(12), -> direccion varchar(50), -> correo varchar(40)) -> begin -> insert into paciente(codpaciente,nombre1,nombre2,apellido1,apellido2,numero,direccion,correo) -> values (codpaciente,nombre1,nombre2,apellido1,apellido2,numero,direccion,correo); -> end // Query OK, 0 rows affected (0.012 sec) MariaDB [clinica_mayo]> delimiter ; MariaDB [clinica_mayo]> call insertar_paciente (11,'Adrian','','Marcelo','Bejarano',1237654321,'bello','adrianbejarano@ejemplo.com'); Query OK, 1 row affected (0.008 sec) MariaDB [clinica_mayo]> select* from paciente; +-------------+----------+----------+-----------+-----------+------------+--------------------------+------------------------------+ | codpaciente | nombre1 | nombre2 | apellido1 | apellido2 | numero | direccion | correo | +-------------+----------+----------+-----------+-----------+------------+--------------------------+------------------------------+ | 1 | Juan | Pablo | García | López | 1234567890 | Calle Falsa 123 | juan.garcia@ejemplo.com | | 2 | Ana | Maria | Fernández | Ruiz | 2147483647 | Avenida Siempre Viva 456 | ana.fernandez@ejemplo.com | | 3 | Luis | Alberto | Mendoza | Sánchez | 2147483647 | Boulevard Central 789 | luis.mendoza@ejemplo.com | | 4 | Marta | Elena | Pérez | Gómez | 2147483647 | Calle del Sol 101 | marta.perez@ejemplo.com | | 5 | Carlos | Eduardo | Morales | Jiménez | 2147483647 | Calle de la Luna 202 | carlos.morales@ejemplo.com | | 6 | Laura | Cecilia | Hernández | Márquez | 2147483647 | Avenida de la Paz 303 | laura.hernandez@ejemplo.com | | 7 | José | Antonio | Vargas | Molina | 2147483647 | Calle Nueva 404 | jose.vargas@ejemplo.com | | 8 | Isabel | Cristina | Castro | Ramos | 2147483647 | Plaza Mayor 505 | isabel.castro@ejemplo.com | | 9 | Pedro | Javier | Torres | Castillo | 2147483647 | Calle del Mar 606 | pedro.torres@ejemplo.com | | 10 | Verónica | Sánchez | Cruz | García | 1023456789 | Calle Real 707 | veronica.sanchez@ejemplo.com | | 11 | Adrian | | Marcelo | Bejarano | 1237654321 | bello | adrianbejarano@ejemplo.com | +-------------+----------+----------+-----------+-----------+------------+--------------------------+------------------------------+ 11 rows in set (0.001 sec) MariaDB [clinica_mayo]> describe planta; +---------------------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------+---------+------+-----+---------+-------+ | codplanta | int(20) | NO | PRI | NULL | | | cuidados_intensivos | int(60) | YES | | NULL | | | traumatologian | int(50) | YES | | NULL | | +---------------------+---------+------+-----+---------+-------+ 3 rows in set (0.015 sec) MariaDB [clinica_mayo]> delimiter // MariaDB [clinica_mayo]> create procedure insertar_planta( -> in codplanta int(20), -> in cuidados_intensivos int(60), -> in traumatologian int(50)) -> begin -> insert into planta (codplanta,cuidados_intensivos,traumatologian) -> values(codplanta,cuidados_intensivos,traumatologian); -> end // Query OK, 0 rows affected (0.013 sec) MariaDB [clinica_mayo]> delimiter ; MariaDB [clinica_mayo]> call inserta_planta (6,11,12); ERROR 1305 (42000): PROCEDURE clinica_mayo.inserta_planta does not exist MariaDB [clinica_mayo]> call inserta_planta(6,11,12); ERROR 1305 (42000): PROCEDURE clinica_mayo.inserta_planta does not exist MariaDB [clinica_mayo]> call insertar_planta (6,11,12); Query OK, 1 row affected (0.005 sec) MariaDB [clinica_mayo]> select* from planta ; +-----------+---------------------+----------------+ | codplanta | cuidados_intensivos | traumatologian | +-----------+---------------------+----------------+ | 1 | 6 | 10 | | 2 | 7 | 9 | | 3 | 1 | 8 | | 4 | 4 | 5 | | 5 | 2 | 3 | | 6 | 11 | 12 | +-----------+---------------------+----------------+ 6 rows in set (0.001 sec) MariaDB [clinica_mayo]> describe triage ; +-----------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+------------+------+-----+---------+-------+ | codtraige | int(10) | NO | PRI | NULL | | | rojo | varchar(8) | YES | | NULL | | | naranja | varchar(8) | YES | | NULL | | | amarrillo | varchar(8) | YES | | NULL | | | verde | varchar(8) | YES | | NULL | | | azul | varchar(8) | YES | | NULL | | +-----------+------------+------+-----+---------+-------+ 6 rows in set (0.014 sec) MariaDB [clinica_mayo]> delimeter // -> create procedure insertar_triage( -> in codtraige int(10), -> in rojo varchar(8), -> in naranja varchar(8), -> in amarrillo varchar(8), -> in verde varchar(8), -> in azul varchar(8)) -> begin -> insert into triage (codtraige,rojo,naranja,amarrillo,verde,azul) -> values (codtraige,rojo,naranja,amarrilo,verde,azul); 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 'delimeter // create procedure insertar_triage( in codtraige int(10), in rojo ...' at line 1 MariaDB [clinica_mayo]> delimiter; ERROR: DELIMITER must be followed by a 'delimiter' character or string MariaDB [clinica_mayo]> delimiter // MariaDB [clinica_mayo]> create procedure insertar_triage ( -> in codtraige int(10), -> in rojo varchar(8), -> in naranja varchar(8), -> in amarrillo varchar(8), -> in verde varchar(8), -> in azul varchar(8)) -> begin -> insert into triage (codtraige,rojo,naranja,amarrillo,verde,azul) -> values (codtraige,rojo,naranja,amarrilo,verde,azul); -> end // Query OK, 0 rows affected (0.014 sec) MariaDB [clinica_mayo]> delimiter; -> ; -> -> // 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 'delimiter' at line 1 MariaDB [clinica_mayo]> dilimiter ; -> // 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 'dilimiter' at line 1 MariaDB [clinica_mayo]> call insertar_traige(11,'','','','','traumato'); -> ; -> delimiter; -> // ERROR 1305 (42000): PROCEDURE clinica_mayo.insertar_traige does not exist MariaDB [clinica_mayo]> DELIMITER // MariaDB [clinica_mayo]> MariaDB [clinica_mayo]> CREATE PROCEDURE insertar_triage( -> IN codtraige INT(10), -> IN rojo VARCHAR(8), -> IN naranja VARCHAR(8), -> IN amarrillo VARCHAR(8), -> IN verde VARCHAR(8), -> IN azul VARCHAR(8) -> ) -> BEGIN -> INSERT INTO triage (codtraige, rojo, naranja, amarrillo, verde, azul) -> VALUES (codtraige, rojo, naranja, amarrillo, verde, azul); -> END // ERROR 1304 (42000): PROCEDURE insertar_triage already exists MariaDB [clinica_mayo]> MariaDB [clinica_mayo]> DELIMITER ; MariaDB [clinica_mayo]> CALL insertar_triage(11, '', '', '', '', 'traumato'); ERROR 1054 (42S22): Unknown column 'amarrilo' in 'field list' MariaDB [clinica_mayo]> exit