12-21-2009, 01:18 PM
(12-21-2009, 01:10 PM)Master of The Universe Wrote: Tables are fields insde your MySql Database, you can have unlimited amount of Databases and Tables are what those DBs hold.
Let's say you have a Emplyee database called "emplyee", that database would have tables like, workers and times
A structure would be for example,
DB Emplyee
TBL workers
- FIELD full_name
- FIELD age
...
TBL times
- FIELD user_id
- FIELD work_time
The Tables would then hold their own fields, like usr_id, user_avatar, etc...
I found this kind of confusing - it would make more sense to have a table called Employees, and a database called workplace.
Other tables in the workplace database could include things such as inventory and sales.
The employees table would look something like
Code:
| user_id | salary | work_time | full_name | age |
A sample sql query to grab a certain employees age would look something like:
Code:
SELECT salary FROM Employees WHERE user_id = 1234
Anyways, that would return the salary of whichever worker had an id of 1234.