dbTalk Databases Forums  

Must we also create separate tables?

comp.databases.theory comp.databases.theory


Discuss Must we also create separate tables? in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Srubys@gmail.com
 
Posts: n/a

Default Must we also create separate tables? - 10-26-2008 , 03:00 PM






greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you

Reply With Quote
  #2  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM






Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #3  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #4  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #5  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #6  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #7  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #8  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #9  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
  #10  
Old   
robert stearns
 
Posts: n/a

Default Re: Must we also create separate tables? - 10-26-2008 , 05:28 PM



Srubys (AT) gmail (DOT) com wrote:
Quote:
greetings

My book claims that for table to be in 1NF, we must:

* Eliminate remove repeating groups of data
* Create separate tables for each group of related data and identify
each row with a unique column ( the primary key )


I know that for table to be in 1NF, we must remove repeating groups
of data. But is it ( for relation to be in 1NF ) also required to
create separate tables for each group of related data or is that just
recommended and thus optional?

Say we have non-normalized table STUDENT:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT1#, SUBJECT2#, SUBJECT1_NAME,
SUBJECT2_NAME, TEACHER1_NAME, TEACHER2_NAME )


I realize best thing to do would be to create two tables:

STUDENT-SUBJECT ( STUDENT#, SUBJECT#, SUBJECT_NAME, TEACHER_NAME )

STUDENT ( STUDENT#, STUDENT_NAME)



But would the following table also be considered in 1NF:

STUDENT ( STUDENT#, STUDENT_NAME, SUBJECT, SUBJECT_NAME, TEACHER )

I realize the first option is much better, but my book gives an
impression as if separate tables must also be created for related
repeating groups of data in order for table to be 1NF compliant. Which
doesn't make sense.

thank you
Yes, you need three tables, but not as you outlined them:
STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, TEACHER_NAME )
STUDENT-SUBJECT ( STUDENT#, SUBJECT# )

would be a preferred set of tables, though most schools use something like:

STUDENT ( STUDENT#, STUDENT_NAME)
SUBJECT ( SUBJECT#, SUBJECT_NAME, DESCRIPTION)
SECTION ( SECTION#, SUBJECT#, TEACHER_ID, TIME_AND_DAYS_CODE,...)
STUDENT-SECTION ( STUDENT#, SECTION# )
TEACHER ( TEACHER_ID, TEACHER_NAME,...)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.