aspose file tools
The moose likes Oracle/OAS and the fly likes complex table column type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Reply Bookmark "complex table column type" Watch "complex table column type" New topic
Author

complex table column type

sunny joshi
Greenhorn

Joined: Apr 24, 2006
Posts: 2
Suppose I want to create 2 tables -- Department, Student

Student {
name,
id,
address
}

Department {
Dept_name,
Students[] student,
}

in which "department" table contains a group of "student".

How to do the "create table" statement for "department" ? Please help.
Mustafa Alauddien
Greenhorn

Joined: Mar 20, 2006
Posts: 3
In your case it is prefarable to create the tables like :

Create table Dept(
Dept_id number,
Dept_name varchar2(20),
CONSTRAINT DEPT_DEPTID_PK PRIMARY KEY (DEPT_ID));

Create table Student(
stud_Id number,
Stud_Name Varchar2(50),
...
Dept_id Number,
CONSTRAINT STUDENT_STUDID_PK PRIMARY KEY (STUD_ID),
CONSTRAINT STUDENT_DEPTID_FK FOREIGN KEY (DEPT_ID)REFERENCES Dept(Dept_id)
);
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: complex table column type
 
Similar Threads
count SQL
How to use DetachedCriteria in multiple table?
JavaDb creating table error
parent key not found
Please help me in creation of tables