Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What are tables?
#3
(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
Note: My sql is rusty as balls, it's possible I'm not entirely correct, but I'm sure I"ll be corrected if I'm not.

Anyways, that would return the salary of whichever worker had an id of 1234.
Reply


Messages In This Thread
What are tables? - by nevets04 - 12-21-2009, 12:56 PM
RE: What are tables? - by Gaijin - 12-21-2009, 01:10 PM
RE: What are tables? - by wat - 12-21-2009, 01:18 PM
RE: What are tables? - by Gaijin - 12-21-2009, 01:21 PM
RE: What are tables? - by wat - 12-21-2009, 01:44 PM
RE: What are tables? - by nevets04 - 12-21-2009, 03:56 PM
RE: What are tables? - by wat - 12-21-2009, 04:15 PM
RE: What are tables? - by nevets04 - 12-21-2009, 07:44 PM
RE: What are tables? - by wat - 12-21-2009, 07:48 PM
RE: What are tables? - by nevets04 - 12-21-2009, 07:51 PM
RE: What are tables? - by Gaijin - 12-21-2009, 07:54 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)