Professional Documents
Culture Documents
Veterinaria
Veterinaria
+-----------------------+
| Tables_in_veterinaria |
+-----------------------+
| clientes |
| historial |
| mascotas |
| medico |
| servicios |
+-----------------------+
+-------------+--------------+------+-----+---------+-------+
+-------------+--------------+------+-----+---------+-------+
+-------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
+-----------+--------------+------+-----+---------+-------+
+-----------+--------------+------+-----+---------+-------+
+-----------+--------------+------+-----+---------+-------+
+-------------+--------------+------+-----+---------+-------+
+-------------+--------------+------+-----+---------+-------+
+-------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
MariaDB [veterinaria]>
AQUI EL PROCEDIMIENTO QUE REALICE PARA LOGRAR LAS TABLAS.
Al principio se me olvido colocar como llave primaria a los ID de las tablas medico y servicios, investigue
en internet y el código para volverlas primarias ya una vez creada la tabla es “alter table medico add
primary key(id_medico)”
Enter password:
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Database changed
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 'FK_id_medico foreign key (id_medico)
references medico(id_medico),
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 '-> id_histor varchar(25),
-> .
->
-> scjdcsdcddksc
-> :
-> ;
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 5
+-----------+-------------+------+-----+---------+-------+
+-----------+-------------+------+-----+---------+-------+
+-----------+-------------+------+-----+---------+-------+
MariaDB [veterinaria]> alter table historial add id_histo varchar(25) before id_medico;
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 'before id_medico' at line 1
MariaDB [veterinaria]> alter table historial add id_histo varchar(25) after id_medico;
Query OK, 0 rows affected (0.012 sec)
+-----------+-------------+------+-----+---------+-------+
+-----------+-------------+------+-----+---------+-------+
+-----------+-------------+------+-----+---------+-------+
+-----------------------+
| Tables_in_veterinaria |
+-----------------------+
| clientes |
| mascotas |
| medico |
| servicios |
+-----------------------+
ERROR 1005 (HY000): Can't create table `veterinaria`.`historial` (errno: 150 "Foreign key constraint is
incorrectly formed")
-> ;
+-------------+--------------+------+-----+---------+-------+
+-------------+--------------+------+-----+---------+-------+
+-------------+--------------+------+-----+---------+-------+