Hi All

I am trying to create 2 tables

Table 1 with cust_id , username and password (Cust_id is primary key here)

Table 2 wth cust_info that will store info for that cust........now i want to use this Cust_id as foreign key here in table2 but i am not able to do this

create table tbcustinfo (fname varchar(20),lname varchar(20),mobnum int,address varchar(40),city varchar(10),cust_id INT Not null,FOREIGN KEY(cust_id) RE
FRENCE tblogin(cust_id));

Can you please help me to create this


Sumeeet Taneja

create table tbcustinfo (
fname varchar(20),
lname varchar(20),
mobnum int,
address varchar(40),
city varchar(10),
cust_id INT Not null,
CONSTRAINT fk_cust_id
FOREIGN KEY(cust_id)
REFRENCE tblogin(cust_id));

commented: Good one +11
commented: You know your stuff +4

Thanks a lot buddy,....it worked for me