foreign key constraint problem:
---
create table stud(rno integer not null,
name char(10),
primary key(rno));
create table mark(rno integer not null references
stud,
mark integer);
mysql insert into stud values(1,'a');
Query OK, 1 row affected (0.22 sec)
mysql insert into stud values(2,'b');
Query OK, 1 row affected (0.00 sec)
mysql select * from stud;
+-+--+
| rno | name |
+-+--+
| 1 | a|
| 2 | b|
+-+--+
2 rows in set (0.06 sec)
mysql insert into mark values(3,5);
Query OK, 1 row affected (0.00 sec)
mysql select * from mark;
+-+--+
| rno | mark |
+-+--+
| 3 |5 |
+-+--+
1 row in set (0.05 sec)
how is it possible.
there is no rollno 3 in the stud table,
then how does it accept the rollno 3 in the mark
table.
does foreign key really working,
or i am doing something wrong.
please help me,
thank you in advance,
vishnu.
how can i convert the default date format to the
format
'dd-mm-'.
or how can i insert the date in the format
'dd-mm-'.
__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php