简体   繁体   中英

MySQL - XML vs Table

I'm developing a timesheet for a client in PHP/MySQL. The basic functions is as follows:

User logs in User clicks either a clock in or clock out button. At the end of the pay period the user submits the timesheet which will send to the accounting department for payroll. The data will be deleted after submit and start a new pay period.

I don't need to query the data. I just need to store in/out timestamps, hours worked and total hours per pay period.

Now here's the question. Would it be more efficient to have my create user script create a table for each user or to simply store the in/out data in XML as a TEXT column in my main user table?

The XML seems easier to manage but I'm trying to make an efficiency decision.

just create two tables one for the users with unique username and in other table use username as FK and store data against each user

tab1=> id, username, name
1,xyz,marsh
tab2=> username(FK), data
march, data
march, data
someOtherUser, data
anotherUser, data
so on ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM