mysql> select*from products;
+-----------+------------+-------------+-----------+
| ProductID | SupplierID | ProductName | UnitPrice |
+-----------+------------+-------------+-----------+
| 00001 | 00001 | Chocolates | 10.50 |
+-----------+------------+-------------+-----------+
1 row in set (0.15 sec)
mysql> insert into products (supplierID, productname, unitprice) value ('2','Beads', '5');
Query OK, 1 row affected (0.00 sec)
mysql> select*from products;+-----------+------------+-------------+-----------+
| ProductID | SupplierID | ProductName | UnitPrice |
+-----------+------------+-------------+-----------+
| 00001 | 00001 | Chocolates | 10.50 |
| 00002 | 00002 | Beads | 5.00 |
+-----------+------------+-------------+-----------+
2 rows in set (0.03 sec)
mysql> insert into products (supplierID, productname, unitprice) value ('10','Beads', '5');
Query OK, 1 row affected (0.00 sec)
mysql> select*from products;+-----------+------------+-------------+-----------+
| ProductID | SupplierID | ProductName | UnitPrice |
+-----------+------------+-------------+-----------+
| 00001 | 00001 | Chocolates | 10.50 |
| 00002 | 00002 | Beads | 5.00 |
| 00003 | 00010 | Beads | 5.00 |
+-----------+------------+-------------+-----------+
3 rows in set (0.00 sec)
mysql> select*from suppliers;
+------------+--------------+-------------+------------------+
| SupplierID | SupplierName | Phone | Email |
+------------+--------------+-------------+------------------+
| 00001 | ABCSupplier | 14036801234 | abc@dicforum.com |
+------------+--------------+-------------+------------------+
1 row in set (0.00 sec)
and as you can see I did not get an error and I actually have 3 products existing with only 3 different supplier IDs but only 1 actual supplier.
Any reason why this might happen?
I also tried remaking a new database incase I had a typo and I got the same thing.





MultiQuote





|