0

can anyone tell if it is the right way to connect these tables?

What is the query display customerid, b_customer_id, and h_customer_id... thxxx

--customers

drop table Customers cascade constraint;
create table Customers(
Customer_id Number(5) primary key not null,
Credit varchar2(20),
Street varchar2(20),
City varchar2(12),
State varchar2(2),
Zip varchar2(5),
Telephone varchar2(14));

--business_customer

drop table business_customers cascade constraint;
create table business_customers(
b_customer_id number(5) primary key not null,
b_customer_name varchar2(20), 
FOREIGN KEY (b_customer_id) references Customers);

--home_customers

drop table home_customers cascade constraint;
create table home_customers(
h_customer_id number(5) not null,
h_customer_lastname varchar(10),
h_customer_firstname varchar(10),
PRIMARY KEY (h_customer_id),
FOREIGN KEY (h_customer_id) references Customers);
3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by debasisdas
0

try this. same on the third

--customers

DROP TABLE CUSTOMERS cascade constraint;

CREATE TABLE CUSTOMERS(
Customer_id Number(5) CONSTRAINT customer_customer_id_pk PRIMARY KEY,
Credit varchar2(20),
Street varchar2(20),
City varchar2(12),
State varchar2(2),
Zip varchar2(5),
Telephone varchar2(14));

--business_customer

DROP TABLE business_customers cascade constraint;

CREATE TABLE business_customers(
b_customer_id number(5) CONSTRAINT business_customers_b_customer_id_pk PRIMARY KEY,
b_customer_name varchar2(20), CONSTRAINT business_customers_b_customer_id_fk FOREIGN KEY (b_customer_id) REFERENCES CUSTOMERS(customer_id));
This topic has been dead for over six months. 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.