Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Databases > Database Design Help

Sponsored Links

Discuss "From excel to database/web app" in the Database Design Help forum.

Database Design Help - Database design is important to build fast and efficient applications. Discuss the best practices such as naming conventions and relational database schemes here.


Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old June 6th, 2008, 10:57 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Question From excel to database/web app

Hi All,

I have an excel spreadsheet, which is used a template and sent out to many users and they input their data and email it back. Once back everything is combine into one.

I've created some tables from the data in the spreadsheet but trying to figure out how to put everything together .... meaning....there should only be one recordset for each district. so would it be better to populate my details table for all district with blanks or how can i create a form to enter the data but keep them from entering twice for the same district?

I haven't created the details table yet....I only have the below setup so far.

tblRegion
RegID
Region

tblDistrict
DistID
District

tblCategory
CatID
Category

tblGroup
GrpID
Group

tblItem
ItemID
Item
ItemCost
GrpID

I think the details table will look like:
tblDetails
RegID
DistID
ItemID
FieldData1
FieldData2
FieldData3
FieldDate4

Hope this makes a little sense....Thanks!
Reply With Quote
Sponsored Links
  #2  
Old June 6th, 2008, 11:16 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 949
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

So you're saying that the details table should only have one record for each district? If a record exists, do you just want them to update the existing record with their data or abort the operation?
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

Reply With Quote
  #3  
Old June 6th, 2008, 11:25 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

no the details table will have a record for each item/district. so if there are 30 items, then the district should have 30 records in the details table.

yes, if they have already filled out the form once, then it should have populated the table with 30 records for their district then if they return, can i have something that says, sorry but you can't add, would you like to edit?

do you think having them fill out blank form to populate the table is better than just populating the table myself and just say fill in the blanks?
Reply With Quote
  #4  
Old June 6th, 2008, 11:31 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 949
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

Okay, let me see if I understand correctly. Let's say you have the following:

District A
District B
District C

Item 1
Item 2
Item 3
Item 4
Item 5

In the details table, District A, for example, would only be allowed 1 record for each item?
Reply With Quote
  #5  
Old June 6th, 2008, 11:40 AM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

correct...something like this....

DistrictA - Item1 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictA - Item2 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictA - Item3 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictA - Item4 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictA - Item5 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictB - Item1 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictB - Item2 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictB - Item3 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictB - Item4 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictB - Item5 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictC - Item1 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictC - Item2 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictC - Item3 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictC - Item4 - FieldData1 - FieldData2 - FieldData3 - FieldData4
DistrictC - Item5 - FieldData1 - FieldData2 - FieldData3 - FieldData4


do you think this is ok?
Reply With Quote
  #6  
Old June 6th, 2008, 11:46 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 949
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 6
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default

I don't see anything wrong with that.

I would design your application to handle if they can insert or update.

For example, for each district provide a list of items via a query. This query would only return items that the district does not already have in the details table. These are the items that are allowed for insertion.

Then, have a list of items that they DO have in the details table. These items will be allowed for updating.
Reply With Quote
  #7  
Old July 7th, 2008, 02:11 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

Ok....well, I think it would be nice just to show them what they haven't entered but i think in this case, I will need to create data for each region/district in the table with blanks for the qtrs because they will want to see their results (all the items) then be able to change the qtr info as needed.

i've attached a sample spreadsheet, everything highlighted in pink is stuff they can change (only misc item desc. and those have $0 so they will need to enter a price). you can see two tabs (sus and opp) because they will have a sus and opp for each location, then i will need to make a summed one of both of those. well, i have the layout in asp (with mehere's help in other asp posts) now but haven't work in the region/district in yet (will do using variable in asp)....but totally forgot about them having to be able to change the desc. on the misc. items .... the last tab on the spreadsheet is the details table where most of the data is being pulled from but I guess I need to add desc. to that. Do you see any problems with doing everything that's in the spreadsheet? i'm thinking maybe i should have some buttons on the top of my asp page with Sus, Opp, and Sum...I'll need to also have one to show all regions too.../sigh.
Attached Files
File Type: zip Test.zip (4.7 KB, 5 views)

Last edited by Rebelle; July 7th, 2008 at 02:21 PM. Reason: added .xls but .zip now :)
Reply With Quote
  #8  
Old July 10th, 2008, 01:36 PM
Rebelle's Avatar
Barn Enthusiast
 
Join Date: Mar 2008
Posts: 295
Thanks: 54
Thanked 1 Time in 1 Post
Rep Power: 1
Rebelle is on a distinguished road
Default

Ok, I think I'm going to add "Description" to the detail table since they can be able to modify/change all the Misc items....and hope it works out.

Wish me luck!
Reply With Quote
Reply

  DeveloperBarn Forums > Databases > Database Design Help

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 03:26 PM.



Content Relevant URLs by vBSEO 3.2.0