User Name Password Register
DaniWeb IT Discussion Community
All
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 374,006 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,779 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:
Views: 485 | Replies: 1
Reply
Join Date: Aug 2004
Posts: 14
Reputation: garg is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
garg garg is offline Offline
Newbie Poster

Simple Job Logging Database

  #1  
Apr 2nd, 2008
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!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 174
Reputation: trudge is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: Simple Job Logging Database

  #2  
Apr 2nd, 2008
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.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Database Design Marketplace
Thread Tools Display Modes

Other Threads in the Database Design Forum

All times are GMT -4. The time now is 10:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC