SQL 2
SQL 2
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.42-0ubuntu0.24.04.1 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Database changed
mysql> show tables;
+----------------+
| Tables_in_MiBD |
+----------------+
| MiTabla |
| proveedor |
+----------------+
2 rows in set (0,00 sec)
mysql> alter table envio add foreign key (idprov) references proveedor(idprov);
Query OK, 0 rows affected (1,47 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table envio add foreign key (idparte) references parte(idparte);
Query OK, 0 rows affected (1,55 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql>
mysql> alter table envio add foreign key (idparte) references parte(idparte);
mysql> alter table envio add foreign key (idproy) references proyecto(idproy);
Query OK, 0 rows affected (2,04 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql>
mysql>