Srinivas, (i) You must have database specialists who created these tables and designed their foreign keys, indexes, partitioning etc in the first place. See them for advice. If your organisation happens to possess a tool that would, as you request, "convert ER diagram into SQL QUERY", then they presumably are the experts in using that tool
(ii) If you are using DB2 on a mainframe, you should in any case (whatever your job description) possess and absorb a copy of Craig Mullins "DB2 Developer's Guide 5th Edition' published by SAMS . If not, ... (iii) If you are an applications programmer, you need to instruct yourself in the principles of relational data and SQL in general; begin by buying texts appropriate to your level. Also you need to read and digest the code in your codebase to see how it's done in the context in which you are interested (COBOL, Rexx, TSO , CICS, dynamic, static) To rise above the average quality of SQL understanding amongst application programmers, you should consider buying the book "Complex SQL" by Celko (I think that is the right spelling of his name) (iv) If you are a systems person, get an applications programmer to help you. That's their job. (v) Are you executing this statement as the first step in a batch program which will fetch results back for the next two hours, processing millions of result sets, possibly multiple instances processing against parallel partitions? Or are you doing it to retrieve data of just one client in an online situation? (vi) You may wish to subscribe to DB2-RYCI mailing list for technical DB2 issues. The RY used to be Richard Yevitch but since he died maybe the list has changed its name. hope these points help you Jim -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Srinivas_Pasumarthi Sent: 30 Jul 2005 21:11 To: [email protected] Subject: How can I convert ER diagram into SQL QUERY Hi All, My requirement is to join 5 tables and fetch different data fields. I am following 'JOINing the tables on a column which is foreign key of the first table, and primary key of the second table.'. But I am doubting whether this will work all the time as long as data is maintained in the all the tables or not? <...> **************************************************************** IMPORTANT The information transmitted is for the use of the intended recipient only and may contain confidential and/or legally privileged material. Any review, re-transmission, disclosure dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited and may result in severe penalties. If you have received this e-mail in error please notify the Privacy Hotline of the Australian Taxation Office, telephone 13 28 69 and delete all copies of this transmission together with any attachments. **************************************************************** ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

