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
 Suggestion to design a database

Author  Topic 

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-10-29 : 02:52:51
i have a data in MS excel like this
how to design a dtatbase for this

is on table enough?, how do i normalise

please help me

thanks

------ --------- --------- --------- ---------
Tests Reading 1 Reading 2 Reading 3 Reading 4
------ --------- --------- --------- ---------
Power UP 1 2 3 4
Power on 1 2 3 4
From OMP 1 2 3 4
Total Power 1 2 3 4
Power on af 1 2 3 4
Grid and EPG 1 2 3 4
Grid Population 1 2 3 4
Grid +/- 24h 1 2 3 4
Banner loading 1 2 3 4
a 1 2 3 4
b 1 2 3 4
a 1 2 3 4
b 1 2 3 4
a 1 2 3 4
b 1 2 3 4
a 1 2 3 4
b 1 2 3 4
a 1 2 3 4
b 1 2 3 4
a 1 2 3 4
b 1 2 3 4
------------------------------------------------------------------


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-29 : 05:39:01
keep two tables Tests(testid,testname) and testreadings(testreadingid,testid,readingvalue)
Go to Top of Page

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-10-29 : 07:58:30
thanks
Go to Top of Page

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-10-29 : 10:54:17
how can i relate these tabbles?

if i just use queries to join tables is that OK?
or
i have to make use of FK kyes and all?

and

testid is key in Tests table then testid in Testreadings populated automatically?

please help me
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-29 : 11:14:02
quote:
Originally posted by krishna_yess

how can i relate these tabbles?
by means of foreignkey relation which connects testreading.testid to test.testid
if i just use queries to join tables is that OK?
yup. you to use join to get reading for test
or
i have to make use of FK kyes and all?
yup. you need to as specified above
and

testid is key in Tests table then testid in Testreadings populated automatically?
nope. you need to do it manually via insert statements
please help me

Go to Top of Page

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-10-29 : 11:34:45
thanks a lot
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-29 : 11:36:32
welcome
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2008-10-29 : 11:58:56
quote:
Originally posted by visakh16

keep two tables Tests(testid,testname) and testreadings(testreadingid,testid,readingvalue)

I a little confused byt he sample data but, it looks like you would want one more table Reading as TestReadings is a one to many between Test and Reading.. correct?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-29 : 12:13:55
will there ever be a test reading without a test? that was why i thought two tables will be fine.
Go to Top of Page

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-10-30 : 03:03:26

i have to create one more table like this( it is in excel) and this should be linked to test table(testid, testname)

how can i do that please


From To Reading 1 Reading 2 Reading 3
----- --- --------- --------- ---------
Encrypted HD Same trans. Encrypted HD Same trans. 1 1 1
Encrypted HD Same trans. Encrypted HD Diff. Trans. 1 1 1
Encrypted HD Same trans. Clear HD Same trans. 1 1 1
Encrypted HD Same trans. Clear HD Diff. Trans. 1 1 1
Encrypted HD Same trans. Encrypted SD Same trans. 1 1 1
Encrypted HD Same trans. Encrypted SD Diff. Trans. 1 1 1
Encrypted HD Same trans. Clear SD Same trans. 1 1 1
Encrypted HD Same trans. Clear SD Diff. Trans. 1 1 1


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-30 : 03:20:42
what does from and to designate?
Go to Top of Page

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-10-30 : 05:18:21
these are states. there are transitions fron one state to onother. for every transition there is a value
for eg:
Encrypted HD Same trans. TO Encrypted HD Same trans. there is a value 1 under Reading 1

i think i need to create a table channelChange like
ChannelChange(FromVal,ToVal,ReadingID)


where ReadingID is key for Restreadings(testreadingid,testid,readingvalue)
isn't ti
Go to Top of Page
   

- Advertisement -