473,756 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database structure help

OK, I'm new at all of this and have decided to take on a project to
learn. We have a fishing club that has 23 members. Each weak we go
fishing in various places for 4 hours. Not together, usually 2 to a
boat and it's your choice where to go.
I want to build a database / website that the individual fishermen can
go to and log there success. The fishermen can enter the fish type,
size, weight, date caught. I only want them to add, edit, and delete
their own information they can't mess with the data of others. On the
web page I want to display the member name and number of fish caught
under its respective date. Then you can click on the number and it will
display all of the entries for that member that day. Or you can click
on the date and it will display all the data for that day.
How would you go about building the database? Should I have just one
table for all or a table for each member?
Thanks, I just don't want to jump into this and then find out I should
have gone the other way.

Sep 1 '06 #1
3 1434
Marty wrote:
OK, I'm new at all of this and have decided to take on a project to
learn. We have a fishing club that has 23 members. Each weak we go
fishing in various places for 4 hours. Not together, usually 2 to a
boat and it's your choice where to go.
I want to build a database / website that the individual fishermen can
go to and log there success. The fishermen can enter the fish type,
size, weight, date caught. I only want them to add, edit, and delete
their own information they can't mess with the data of others. On the
web page I want to display the member name and number of fish caught
under its respective date. Then you can click on the number and it will
display all of the entries for that member that day. Or you can click
on the date and it will display all the data for that day.
How would you go about building the database? Should I have just one
table for all or a table for each member?
Thanks, I just don't want to jump into this and then find out I should
have gone the other way.
I would have three tables:

- One for users (So you can know who is updating the table via login)
- One for fish types
- One for a Fish_Outing table that combines the foreign keys for user
and fish types and any detail information for any fish caught for a
particular outing.

You will need the use to login to your app. This way you can allow the
user to modify their own data. The following may get you started. I
assume you would do it in a MySQL Database.

User table would at least have the following rows:

DROP TABLE IF EXISTS `Users`;
CREATE TABLE IF NOT EXISTS `Users`
(
`id` int(11) NOT NULL auto_increment,
`login_account_ name` varchar(25) NOT NULL,
`login_password ` varchar(25) NOT NULL,
`last_name` varchar(25) NOT NULL,
`first_name` varchar(25) NOT NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTA MP,
PRIMARY KEY (`id`),
UNIQUE KEY `account_name` (`login_account _name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 54 ;
Fish table to normalize what fish types can be used. It would at least
have the following rows:

DROP TABLE IF EXISTS `Fish`;
CREATE TABLE IF NOT EXISTS `Fish`
(
`id` int(11) NOT NULL auto_increment,
`TypeOfFish` varchar(100) NOT NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTA MP,
PRIMARY KEY (`id`),
UNIQUE KEY `TypeOfFish` (`TypeOfFish`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 54 ;
FishOuting table would at least have the following rows per fish caught:

DROP TABLE IF EXISTS `FishOuting`;
CREATE TABLE IF NOT EXISTS `FishOuting`
(
`id` int(11) NOT NULL auto_increment,
`user_fk` int(11) NOT NULL,
`fish_fk` int(11) NOT NULL,
`size` int(11) NOT NULL,
`weight` int(11) NOT NULL,
`date_caught`Da te NOT NULL,
`time_caught`Ti me NOT NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTA MP,
PRIMARY KEY (`id`),
KEY `TypeOfFish` (`user_fk`,`fis h_fk`,`date_cau ght`,`time_caug ht`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 54 ;

--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Sep 1 '06 #2
All I can say is "Wow thanks!"

IchBin wrote:
Marty wrote:
OK, I'm new at all of this and have decided to take on a project to
learn. We have a fishing club that has 23 members. Each weak we go
fishing in various places for 4 hours. Not together, usually 2 to a
boat and it's your choice where to go.
I want to build a database / website that the individual fishermen can
go to and log there success. The fishermen can enter the fish type,
size, weight, date caught. I only want them to add, edit, and delete
their own information they can't mess with the data of others. On the
web page I want to display the member name and number of fish caught
under its respective date. Then you can click on the number and it will
display all of the entries for that member that day. Or you can click
on the date and it will display all the data for that day.
How would you go about building the database? Should I have just one
table for all or a table for each member?
Thanks, I just don't want to jump into this and then find out I should
have gone the other way.
I would have three tables:

- One for users (So you can know who is updating the table via login)
- One for fish types
- One for a Fish_Outing table that combines the foreign keys for user
and fish types and any detail information for any fish caught for a
particular outing.

You will need the use to login to your app. This way you can allow the
user to modify their own data. The following may get you started. I
assume you would do it in a MySQL Database.

User table would at least have the following rows:

DROP TABLE IF EXISTS `Users`;
CREATE TABLE IF NOT EXISTS `Users`
(
`id` int(11) NOT NULL auto_increment,
`login_account_ name` varchar(25) NOT NULL,
`login_password ` varchar(25) NOT NULL,
`last_name` varchar(25) NOT NULL,
`first_name` varchar(25) NOT NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTA MP,
PRIMARY KEY (`id`),
UNIQUE KEY `account_name` (`login_account _name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 54 ;
Fish table to normalize what fish types can be used. It would at least
have the following rows:

DROP TABLE IF EXISTS `Fish`;
CREATE TABLE IF NOT EXISTS `Fish`
(
`id` int(11) NOT NULL auto_increment,
`TypeOfFish` varchar(100) NOT NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTA MP,
PRIMARY KEY (`id`),
UNIQUE KEY `TypeOfFish` (`TypeOfFish`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 54 ;
FishOuting table would at least have the following rows per fish caught:

DROP TABLE IF EXISTS `FishOuting`;
CREATE TABLE IF NOT EXISTS `FishOuting`
(
`id` int(11) NOT NULL auto_increment,
`user_fk` int(11) NOT NULL,
`fish_fk` int(11) NOT NULL,
`size` int(11) NOT NULL,
`weight` int(11) NOT NULL,
`date_caught`Da te NOT NULL,
`time_caught`Ti me NOT NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTA MP,
PRIMARY KEY (`id`),
KEY `TypeOfFish` (`user_fk`,`fis h_fk`,`date_cau ght`,`time_caug ht`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 54 ;

--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Sep 1 '06 #3
Marty wrote:
All I can say is "Wow thanks!"

IchBin wrote:
>Marty wrote:
>>OK, I'm new at all of this and have decided to take on a project to
learn. We have a fishing club that has 23 members. Each weak we go
fishing in various places for 4 hours. Not together, usually 2 to a
boat and it's your choice where to go.
I want to build a database / website that the individual fishermen can
go to and log there success. The fishermen can enter the fish type,
size, weight, date caught. I only want them to add, edit, and delete
their own information they can't mess with the data of others. On the
web page I want to display the member name and number of fish caught
under its respective date. Then you can click on the number and it will
display all of the entries for that member that day. Or you can click
on the date and it will display all the data for that day.
How would you go about building the database? Should I have just one
table for all or a table for each member?
Thanks, I just don't want to jump into this and then find out I should
have gone the other way.
I would have three tables:
[snip SQL]

For your selects you will want to look at the SQL syntax for 'GROUP BY'
clause. I will let you have some fun and look up that info. You will
need a dropdown <Selectfor the type of fish for a user to select from
when they are inserting their data. There are more details but I will
let you have the 'joy of discovery'.

--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Sep 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

346
16588
by: rkusenet | last post by:
http://biz.yahoo.com/rc/040526/tech_database_marketshare_1.html Interesting to see that database sales for windows is more than Unix.
0
2956
by: Pato Secruza | last post by:
Hi everyone! I have a really frustrating error and need help. I’m trying to do a function that gets the properties and names of the fields in a MS Access database using ASP. I haven’t programmed in a while so I’m quite lost. Once I have the my database structure I will insert the corresponding fields from a web form but the database is huge and I want to be able to change the database and form without changing the ASP code all the
5
2007
by: William Wisnieski | last post by:
Hello Everyone, I'm really stuck on how to design this application, so I thought I'd see if anyone had any general ideas on how to proceed. I'd say I'm an intermediate level Access developer. I volunteered to help my kid's school (a small non-profit) with a tremendous need they have for a complete student administration database. I've developed fairly complex databases before but this one is very unique in how it must be designed.
8
2041
by: David | last post by:
Hi, Could someone please xplain how to add a field to an existing SQL table in VB.Net I have added the field in the Server Explorer and it shows up when I reload the program but I cannot access the field from within my program. Is there something I need to refresh or do I need to recreate he Dataapdtors
29
3576
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this one data field - but i'm not sure) :-) Background info:
2
5380
by: aoao | last post by:
I need to make a new database at the beginning of every year but have forgotten how to do this quickly and efficiently. I have a database with about 10 tables, 10 forms related to the 10 tables and likewise 10 reports. The same objects in my 2006 database, 2005, 2004 etc. I need to make a new database for 2007 using the identical structure. There is some quick way of copying the 2006 database so that all the tables, forms , reports i.e....
1
2303
by: Eric Sadoyama | last post by:
I have a database documentation question, but I am not even sure how to phrase it properly so I don't know where to start looking for answers. We are developing a database that is based on several different data standards and schema. I'm finding it confusing to keep it all straight. What's this field for? Which standards document is it based on? What are the permitted values? Which business rule governs it? In theory, we do have all...
1
1665
by: FlyingBuckner | last post by:
All right be kind, this is my first question on a forum. I need help on selecting the right software to purchase. I have a database set up using Access, 6 users. It is split into Tables and Applications, no more then 65MB of data in the tables right now. I have 2 college courses in Visual Basic 6 and have written VBA code in Access and AutoCad. I work for a steel fabricator and the database is written to track material usage, purchase...
9
2335
by: Peter Duniho | last post by:
Is there a straightfoward API in .NET that allows for inspection of a database? That is, to look at the structure of the database, without knowing anything in advance about it? For example, retrieving a list of tables in the database. Doing a little browsing in MSDN, I see that the abstract representation of a database appears to be the DataSet class. I also see that I can use "data adapter" classes (e.g. OdbcDataAdapter) to connect a...
5
4680
rahulephp
by: rahulephp | last post by:
Hi there, can you please help me? i have data in array and i want to insert it in a single table. structure of table and array to be store is shown below: Please let me know how to store this array in database? Database Structure:
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.