Click here to Skip to main content
15,173,031 members
Home / Discussions / Database
   

Database

 
GeneralRe: structure question 2 Pin
Joan M19-Jul-19 2:14
professionalJoan M19-Jul-19 2:14 
GeneralRe: structure question 2 Pin
Richard Deeming19-Jul-19 2:27
mveRichard Deeming19-Jul-19 2:27 
PraiseRe: structure question 2 Pin
Joan M19-Jul-19 2:31
professionalJoan M19-Jul-19 2:31 
QuestionBest practices for database tables. Pin
RLD7114-Jul-19 13:37
professionalRLD7114-Jul-19 13:37 
AnswerRe: Best practices for database tables. Pin
CHill6018-Jul-19 0:17
mveCHill6018-Jul-19 0:17 
AnswerRe: Best practices for database tables. Pin
Mycroft Holmes18-Jul-19 12:57
professionalMycroft Holmes18-Jul-19 12:57 
GeneralRe: Best practices for database tables. Pin
RLD7121-Jul-19 4:37
professionalRLD7121-Jul-19 4:37 
Questionstructure question Pin
Joan M11-Jul-19 2:30
professionalJoan M11-Jul-19 2:30 
Hi all,

I'm thinking on making a small application to keep track of my working hours, billable or not...

I'd install it in my NAS to be able to access it from everywhere.

The database will be a MySQL database.

I'll do the programming in PHP (don't know any other thing for web).

I've been far away from databases for a long time and wanted to make a question about the right data structure...

I plan to have:

------------------
Table 1: CUSTOMERS
------------------
(PK) ID : autonumeric
Name : string
Address : string

------------------
Table 2: PROJECTS (1 customer can have N projects)
------------------
(PK) ID : autonumeric
Customer ID : number
Description : string

------------------
Table 3: TASKS_IN_PROJECT (1 project will have N tasks).
------------------
(PK) ID : autonumeric
Project ID : number
Person ID : number
Description : string
Date : timeDate
Start time : time
End time : time
Price per hour : number

------------------
Table 4: TASKS (N Tasks_In_Table will have 1 task).
------------------
(PK) ID : autonumeric
Description : string

------------------
Table 5: PEOPLE (N Tasks_In_Project will have 1 person).
------------------
(PK) ID : autonumeric
Person name : string

------------------
Table 6: EXPENSES_IN_PROJECT (1 project will have N expenses).
------------------
(PK) ID : autonumeric
Project ID : number
Note : string
Date : timeDate
Cost : number

------------------
Table 7: EXPENSES (N Expenses_In_Project will have 1 Expense).
------------------
(PK) ID : autonumeric
Description : string


My idea is having this database structure and then make a small PHP web page that would allow me to introduce customers, projects assigned to customers, tasks and persons for each project (those should be available from a combobox selecting from a list of available tasks (tasks table) and people (people table)), and also I would like to be able to add expenses to the project too in the same way... those expenses should be selected from a list coming from the Expenses table...

Do you think this is a good structure?

Have I done something terrible?

My objectives are:

1. storing all the worked hours.
2. being able to get some reports (total hours in a project, lists of tasks done...)

Thank you very much for your time and advice!
AnswerRe: structure question Pin
Eddy Vluggen11-Jul-19 3:01
professionalEddy Vluggen11-Jul-19 3:01 
GeneralRe: structure question Pin
CHill6018-Jul-19 2:30
mveCHill6018-Jul-19 2:30 
GeneralRe: structure question Pin
Eddy Vluggen18-Jul-19 23:53
professionalEddy Vluggen18-Jul-19 23:53 
QuestionQuery numbering in groups in access database ? Pin
Member 24584675-Jul-19 0:50
MemberMember 24584675-Jul-19 0:50 
SuggestionRe: Query numbering in groups in access database ? Pin
CHill6010-Jul-19 8:51
mveCHill6010-Jul-19 8:51 
GeneralRe: Query numbering in groups in access database ? Pin
Member 245846710-Jul-19 18:57
MemberMember 245846710-Jul-19 18:57 
GeneralRe: Query numbering in groups in access database ? Pin
CHill6010-Jul-19 22:38
mveCHill6010-Jul-19 22:38 
QuestionHow To Fix SQL Database Error 824 ? Pin
Member 24584673-Jul-19 23:10
MemberMember 24584673-Jul-19 23:10 
AnswerRe: How To Fix SQL Database Error 824 ? Pin
Richard MacCutchan4-Jul-19 0:44
mveRichard MacCutchan4-Jul-19 0:44 
AnswerRe: How To Fix SQL Database Error 824 ? Pin
Eddy Vluggen4-Jul-19 3:49
professionalEddy Vluggen4-Jul-19 3:49 
GeneralRe: How To Fix SQL Database Error 824 ? Pin
Member 24584674-Jul-19 18:40
MemberMember 24584674-Jul-19 18:40 
GeneralRe: How To Fix SQL Database Error 824 ? Pin
Victor Nijegorodov4-Jul-19 21:20
MemberVictor Nijegorodov4-Jul-19 21:20 
GeneralRe: How To Fix SQL Database Error 824 ? Pin
Member 24584675-Jul-19 0:49
MemberMember 24584675-Jul-19 0:49 
GeneralRe: How To Fix SQL Database Error 824 ? Pin
Victor Nijegorodov5-Jul-19 0:52
MemberVictor Nijegorodov5-Jul-19 0:52 
GeneralRe: How To Fix SQL Database Error 824 ? Pin
Richard MacCutchan5-Jul-19 2:47
mveRichard MacCutchan5-Jul-19 2:47 
GeneralRe: How To Fix SQL Database Error 824 ? Pin
Eddy Vluggen5-Jul-19 2:04
professionalEddy Vluggen5-Jul-19 2:04 
GeneralRe: How To Fix SQL Database Error 824 ? Pin
Member 245846718-Jul-19 19:21
MemberMember 245846718-Jul-19 19:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.