Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Table schema

 
   Database Forums (Home) -> Java RSS
Next:  Watch NFL Games Online  
Author Message
Eric Kaplan

External


Since: Mar 23, 2008
Posts: 2



(Msg. 1) Posted: Sun Mar 23, 2008 8:34 pm
Post subject: Table schema
Archived from groups: comp>lang>java>databases (more info?)

I have a group of TV listing data need to map into database tables.

Data looks like following:
http://www.oniva.com/upload/1356/crew.jpg

I want to create a table for productionCrew of each TV program

the data is like -
crew -> programID -> member
-> member
-> member ... etc
-> programID -> member
-> member
-> member ... etc
-> programID -> member
-> member
-> member ... etc
... etc

above are data from productionCrew of all TV program, for each
programID we have a list of members.

Should I merge all member into a big string?
Or should I use 2 tables to store the Crew data?

If i use 2 tables, how the fields / column will look like?

 >> Stay informed about: Table schema 
Back to top
Login to vote
Lew

External


Since: Aug 30, 2007
Posts: 57



(Msg. 2) Posted: Mon Mar 24, 2008 8:08 am
Post subject: Re: Table schema [Login to view extended thread Info.]
Archived from groups: comp>lang>java>databases, others (more info?)

Please do not multi-post. How is someone reading one group supposed to be
aware of the conversation in another, except by accident? Multi-posting is
very bad practice. If you must reach multiple groups, rarely very helpful,
you can cross-post instead.

Eric Kaplan wrote:
> I have a group of TV listing data need to map into database tables.
>
> Data looks like following:
> http://www.oniva.com/upload/1356/crew.jpg
>
> I want to create a table for productionCrew of each TV program
>
> the data is like -
> crew -> programID -> member
> -> member
> -> member ... etc
> -> programID -> member
> -> member
> -> member ... etc
> -> programID -> member
> -> member
> -> member ... etc
> ... etc
>
> above are data from productionCrew of all TV program, for each
> programID we have a list of members.
>
> Should I merge all member into a big string?

I don't know what you mean by that question, but the answer is no.

> Or should I use 2 tables to store the Crew data?

If Crew data were the only things you saved, one might do, but you're also
storing member data and program data, right?

You need at least three tables.

Study up on database normalization and third-normal form. This will clear up
the matter.

> If i use 2 tables, how the fields / column will look like?

What are the attributes of the real-world things your database will model?

--
Lew

 >> Stay informed about: Table schema 
Back to top
Login to vote
Roedy Green

External


Since: Nov 04, 2007
Posts: 35



(Msg. 3) Posted: Mon Mar 24, 2008 2:45 pm
Post subject: Re: Table schema [Login to view extended thread Info.]
Archived from groups: comp>lang>java>databases (more info?)

On Sun, 23 Mar 2008 20:34:17 -0800, Eric Kaplan
wrote, quoted or indirectly quoted someone who
said :

>crew -> programID -> member

your main table would have three fields, plus extra info about
members.

crewid : programid: memberid:

you would also have a table with info about crews indexed by crewid
and crew name

You would also have a table of info about programs indexed by program
name and program id.

If you had just a small database, you might dispense with crewids and
programids and just use the names as keys.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 >> Stay informed about: Table schema 
Back to top
Login to vote
Eric Kaplan

External


Since: Mar 23, 2008
Posts: 2



(Msg. 4) Posted: Mon Mar 24, 2008 2:45 pm
Post subject: Re: Table schema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I think i only need 2 table is enough

CREATE TABLE programs
(
programid int NOT NULL PRIMARY KEY,
programname nvarchar(200) NOT NULL,
... )

CREATE TABLE productioncrew
(
programid int NOT NULL REFERENCES programs,
firstname nvarchar(200) NOT NULL,
lastname nvarchar(200) NOT NULL,
role nvarchar(200) NOT NULL,
PRIMARY KEY (programid, firstname, lastname, role)
)

since my DB is only 6 tables like Schedules, TVStations,
ChannelLineup, Programs, ProductionCrews and Genres

it's a very small DB and I dont' need all those ID things it's easy to
do query with above


>>crew -> programID -> member
>
>your main table would have three fields, plus extra info about
>members.
>
>crewid : programid: memberid:
>
>you would also have a table with info about crews indexed by crewid
>and crew name
>
>You would also have a table of info about programs indexed by program
>name and program id.
>
>If you had just a small database, you might dispense with crewids and
>programids and just use the names as keys.
 >> Stay informed about: Table schema 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How to get all tables without schema? - Hi all! How to get all tables without schema from DatabaseMetaData on Oracle 9? I have tables: a, b, mdsys.a, mdsys.b How to get "a" and "b" tables only? I try to get it the follow code, but this code return empty resultset. Stri...

Difference in schema - Hello. I'm looking for software which might give me difference between schema two databases in Postgresql. The main purpose is catch difference between production and development db. Thanks in advance Regards EN

Read Database schema with java - I m searching for a methode to read a database schema with java: Tables, Relations, Tablefield, Primary Keys, NULL/ NOT Null. did u know any consept. did u know a method with hibernate

creating mysql schema in java code - We have developed an application in java running on jboss that uses mysql as the database with hibernate persistence. Hibernate automatically creates all the associated mysql tables, but at present we have to create a schema manually using mysql's admin....

Joining every row from 1 table to every row from another - Hello! Answer is propably simple, but I'm struggling and can't solve this problem. I have two tables: Table GARMENT STYLE_NO DESCRIPTION LABOUR_COST NOTIONS 1 Trousers 18 2 Long Skirt 15 Zip/ 1 cm off 3 Shorts 10 Zip/ Clip Table..
   Database Forums (Home) -> Java All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]