•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 427,203 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,176 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser: Programming Forums
Views: 610 | Replies: 1
![]() |
•
•
Join Date: Aug 2004
Posts: 14
Reputation:
Rep Power: 5
Solved Threads: 0
Hello,
I want to create a database driven website as a learning project. Please help me out with this.
I have a few machines on which I have to log a couple of tasks. Tasks such as harddisk testing, defrags, back up, deleting temp files etc. I also want to log who does the tasks, which machines had the tasks done, what task was done.
I want to be able to add more users, machines, and tasks in the future.
Example output would be:
User | date | Machine | Task 1 | Task 2 | .... | Task N
bob | mmyydd | machine1 | done | not done | .... | done
How would you suggest I make this simple database?
Would the following work?
Users Table
-------------
user_id
username
password
firstname
lastname
Machines Table
------------------
machine_id
machinename
Tasks table
------------------
task_id
task
Jobs Table
------------
job_id
date
user_id
machine_id
tasks
Job-Task Table
-----------------
job-task_id
job_id
task_id
User Table would store the users.
Machine Table would store the machines/computers.
Tasks Table would store the available tasks
Jobs table would store the date, user id, machine id and a reference to a job_Task item
Job-Task Table would match job id with task id so it would be like:
Job Task Table output
-------------------------
id | job_id | task_id
---------------------------
1 | 1 | 1
2 | 1 | 2
3 | 1 | 4
4 | 2 | 1
5 | 2 | 3
Thanks!
I want to create a database driven website as a learning project. Please help me out with this.
I have a few machines on which I have to log a couple of tasks. Tasks such as harddisk testing, defrags, back up, deleting temp files etc. I also want to log who does the tasks, which machines had the tasks done, what task was done.
I want to be able to add more users, machines, and tasks in the future.
Example output would be:
User | date | Machine | Task 1 | Task 2 | .... | Task N
bob | mmyydd | machine1 | done | not done | .... | done
How would you suggest I make this simple database?
Would the following work?
Users Table
-------------
user_id
username
password
firstname
lastname
Machines Table
------------------
machine_id
machinename
Tasks table
------------------
task_id
task
Jobs Table
------------
job_id
date
user_id
machine_id
tasks
Job-Task Table
-----------------
job-task_id
job_id
task_id
User Table would store the users.
Machine Table would store the machines/computers.
Tasks Table would store the available tasks
Jobs table would store the date, user id, machine id and a reference to a job_Task item
Job-Task Table would match job id with task id so it would be like:
Job Task Table output
-------------------------
id | job_id | task_id
---------------------------
1 | 1 | 1
2 | 1 | 2
3 | 1 | 4
4 | 2 | 1
5 | 2 | 3
Thanks!
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
Your design seems to be well on the way to what you want. In your 'Job Task Table output' you might want to replace the task ID with what the actual task is, unless you can remember what a task_id of 1 (or 3, or 7, ...) is etc.
Remember that your design and relations are driven by the kinds of queries you anticipate making. Populate your tables with some dummy data and perform some queries that cover what you will eventually want. Check the results for correctness (neither false positives nor false negatives). If you find that you can't perform a certain query based on the current design, you may have to change your design to suit. Also, it's generally not a good idea to store any values that can be derived or computed from existing data.
Remember that your design and relations are driven by the kinds of queries you anticipate making. Populate your tables with some dummy data and perform some queries that cover what you will eventually want. Check the results for correctness (neither false positives nor false negatives). If you find that you can't perform a certain query based on the current design, you may have to change your design to suit. Also, it's generally not a good idea to store any values that can be derived or computed from existing data.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
![]() |
•
•
•
•
•
•
•
•
DaniWeb Database Design Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age amd avatar backup blue gene breach business chips daniweb data data protection database development dos economy energy enterprise europe government hacker hardware hp ibm ibm. news intel ibm job linux medicine memory microsoft newb news open source openoffice pc programmer ps3 recession red hat security server student sun supercomputer supercomputing technology trends ubuntu working x86
- Previous Thread: Database design for a school' sports day
- Next Thread: medical record maintenance system database


Linear Mode