Académique Documents
Professionnel Documents
Culture Documents
Aprendiz@SENA-PC c:\xampp
Aprendiz@SENA-PC c:\xampp
# mysql -u root -p
Enter password:
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
+--------------------+
| Database |
+--------------------+
| information_schema |
| autos |
| cdcol |
| colegio |
| evaluacion |
| merkasur |
| mysql |
| performance_schema |
| phpmyadmin |
| prueba |
| prueba2 |
| test |
| webauth |
+--------------------+
Database changed
-> DESCRIBE
SHOW TABLES;
+-------------------+
| Tables_in_almacen |
+-------------------+
| fabricantes |
+-------------------+
mysql> CREATE TABLE ARTICULO (ID_ARTICULO INT NOT NULL PRIMARY KEY, NOMBRE_ART
VARCHAR (30), PRECIO INT NOT NULL, ID_FABRICANTE INT FOREIGN KEY(ID_FABRICANTE) RE
FERENCES FABRICANTES(ID_FABRICANTE));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'FOREIG
+---------------+-------------+------+-----+---------+-------+
+---------------+-------------+------+-----+---------+-------+
+---------------+-------------+------+-----+---------+-------+
-> (
-> ID_ARTICULO INT PRIMARY KEY NOT NULL, ID_FABRICANTE int, foreign key (ID_FABRICANTE)
REFERENCES FABRICANTES(ID_FABRICANTE), NOMBRE VARCHAR(30) NOT NULL, P
+-------------------+
| Tables_in_almacen |
+-------------------+
| articulo |
| fabricantes |
+-------------------+
+---------------+-------------+------+-----+---------+-------+
+---------------+-------------+------+-----+---------+-------+
+---------------+-------------+------+-----+---------+-------+
+---------------+-------------+------+-----+---------+-------+
+---------------+-------------+------+-----+---------+-------+
+---------------+-------------+------+-----+---------+-------+
mysql>