0

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


Thanks

Sumeeet Taneja

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by staneja
2

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));

Votes + Comments
Good one
You know your stuff
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.