User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Oracle section within the Web Development category of DaniWeb, a massive community of 402,686 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,394 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Oracle advertiser: Programming Forums
Views: 427 | Replies: 3
Join Date: Nov 2007
Posts: 107
Reputation: k2k is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
k2k k2k is offline Offline
Junior Poster

query help

  #1  
Apr 13th, 2008
from last thread, I figured it out my tables relationship and they do work i believe. however, i can't successfully get elements from each of the table out. if i do:

select b_customer_name, h_customer_firstname, h_customer_lastname, telephone
from customers c, business_customers b, home_customers h
where c.customer_id = b.b_customer_id and
c.customer_id = h.h_customer_id;

i have no row selected.... what is wrong ?


  1.  
  2. --customers
  3. DROP TABLE Customers cascade constraint;
  4. CREATE TABLE Customers(
  5. Customer_id Number(5) PRIMARY KEY NOT NULL,
  6. Credit varchar2(20),
  7. Street varchar2(20),
  8. City varchar2(12),
  9. State varchar2(2),
  10. Zip varchar2(5),
  11. Telephone varchar2(14));
  12.  
  13. --business_customers
  14. DROP TABLE business_customers cascade constraint;
  15. CREATE TABLE business_customers(
  16. b_customer_id number(5) PRIMARY KEY NOT NULL,
  17. b_customer_name varchar2(20),
  18. FOREIGN KEY (b_customer_id) REFERENCES Customers(customer_id));
  19.  
  20.  
  21. --home_customers
  22. DROP TABLE home_customers cascade constraint;
  23. CREATE TABLE home_customers(
  24. h_customer_id number(5) NOT NULL,
  25. h_customer_lastname varchar(10),
  26. h_customer_firstname varchar(10),
  27. PRIMARY KEY (h_customer_id),
  28. FOREIGN KEY (h_customer_id) REFERENCES Customers(customer_id));
Last edited by peter_budo : Apr 17th, 2008 at 1:49 pm. Reason: Correcting [code = sql] tag, there are no spaces for [code=sql]
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Oracle Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Oracle Forum

All times are GMT -4. The time now is 5:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC