Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Primary Key

Author  Topic 

Manoool
Starting Member

6 Posts

Posted - 2007-11-08 : 12:56:35
Hi..



I'm going to build database of university, but I have problem with primaru key,



This is the situation:

there are many faculities and each one has many departments,

each department has many courses,

each course has many sections..



The problem:

I want to make those fields in the same table and make the primary key generate from other fields,

(i.e)

I want the faculity be integer from 4 digit "Example the first faculity start with 1000 the second 2000 and so on" and the the department of each faculity will generate its value from the faculity number+interger number from 3digit "Example the department of the first faculity start with 1100 and the second on will be 1200 and so on "

the same thing will repeate for courses and sections so the sectionsID will be the primary key.



Do you know hoew this idea can be implement by SQL server 2005?

Please help me as soon as possible.

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2007-11-08 : 13:15:53
What other requirements did your CIS instructor give you for this assignment?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-11-08 : 13:55:35
quote:
Originally posted by Van

What other requirements did your CIS instructor give you for this assignment?



Is that a minivan?

You need to look up data modeling on google, and look for natural keys



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Manoool
Starting Member

6 Posts

Posted - 2007-11-09 : 02:25:08
quote:
Originally posted by Van

What other requirements did your CIS instructor give you for this assignment?





will.....
I have to build complete university system
that allow them to convert all of their manual procedure to
online one
including the registration and the electronic services to
the student and teachers and administration

I have many tables
and I want to connect between the faculties ,department and courses
in the first place I think to put each one in table
with auto number as the primary key


but the doctor told me that "this is bad design"
and she suggest to but the in one table and try to connect between them
so , i thought in this way that i
previously mention


and i wish that some one can help me
beacuse i dont have experience with SQL
Go to Top of Page

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2007-11-09 : 15:00:14
quote:
Originally posted by X002548

quote:
Originally posted by Van

What other requirements did your CIS instructor give you for this assignment?



Is that a minivan?

You need to look up data modeling on google, and look for natural keys



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam







Minivan?
Go to Top of Page
   

- Advertisement -