Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to use SELECT with this kind of table?

Re: How to use SELECT with this kind of table?

From: Kevin Bass <akil1_at_mindspring.com>
Date: Sun, 9 Jan 2000 15:55:16 -0500
Message-ID: <85asoa$d88$1@nntp4.atl.mindspring.net>


Place the student identification (stuid) as the primary key on each of your tables. This will ensure that each person has at least one record in each of your tables. It will also ensure data integrity and an easier way to tie each table together by using the student id. As long as you have a student's id, you can identify his/her data within each of the tables.

<ppakorn_at_my-deja.com> wrote in message news:85a8so$cpi$1_at_nnrp1.deja.com...
> Dear all users
>
> I created a table as below
>
> create type name_o as object (
> first varchar2(10),
> middle varchar2(10),
> last varchar2(15));
> /
>
> create type address_o as object (
> street varchar2(15),
> city varchar2(15),
> state char(2),
> zip char(5));
> /
>
> create table student (
> stuid char(11) not null,
> stuname name_o,
> stuaddr address_o,
> stutel varchar2(11),
> primary key (stuid));
>
> then I insert some rows to this table
>
> insert into student values (
> '000-00-0001',
> name_o('Steve', 'A', 'Sigler'),
> address_o('210 E.Main', 'Springfield', 'IL', '61220'),
> '452-4205750');
>
> insert into student values (
> '000-00-0002',
> name_o('Joe', 'J', 'Livinston'),
> address_o('600 W.Mill St', 'Carbondle', 'IL', '62901'),
> '618-4576544');
>
> insert into student values ('
> 000-00-0003',
> name_o('Thomas', 'J', 'Young'),
> address_o('1500 W.Cherry', 'San Francisco', 'CA', '24101'),
> '235-5754864');
>
> Could anyone tell me how can I do SELECT to bring up student first
> names who live in Illinois (IL)? I have tried many ways, but didn't
> succeeded. Please help me.
>
>
>
>
> Thank you in advance
> Pak
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sun Jan 09 2000 - 14:55:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US