What are tables? - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Database Programming (https://www.supportforums.net/forumdisplay.php?fid=28) +---- Thread: What are tables? (/showthread.php?tid=3837) Pages:
1
2
|
What are tables? - nevets04 - 12-21-2009 I was looking at learning SQL here, however, the tutorials are referencing these tables, now I'm wondering: where the hell did these tables come from? Is there a better tutorial someone can link me to, or possibly explain what they are trying to do? By the way, I realize I sound like I'm an idiot RE: What are tables? - Gaijin - 12-21-2009 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... RE: What are tables? - wat - 12-21-2009 (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. 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. RE: What are tables? - Gaijin - 12-21-2009 Ohh yeah your're right about the Database, and there isn't anything wrong with SQL. But it seems you did explained my fail well.... I was typing fast and thinking faster, happens RE: What are tables? - wat - 12-21-2009 (12-21-2009, 01:21 PM)Master of The Universe Wrote: Ohh yeah your're right about the Database, and there isn't anything wrong with SQL.hehe, awesome. I've only worked with sql once, this summer, while reading a php book Quote:But it seems you did explained my fail well.... That's okay, mistakes happen. You still gave a good explanation. RE: What are tables? - nevets04 - 12-21-2009 This makes no sence to me O.o. Im not really sure why. is | user_id | salary | work_time | full_name | age | actual syntax? RE: What are tables? - wat - 12-21-2009 (12-21-2009, 03:56 PM)nevets04 Wrote: This makes no sence to me O.o. Im not really sure why. is No, you have to think of it in a less practical sense. Imagine creating a table in a word document. At the top you have a title. user_id, salary, work_time, full_name, and age are your titles. From here, each row contains information about the same person. For example, take a look at the following: Code: | user_id | salary | work_time | full_name | age | That row contains information about a man named Martin Smith. Let's say you knew his name, but you wanted to find out what his salary is. Your query would look something like Code: SELECT salary FROM Employees WHERE full_name = "Martin Smith" SQL queries sort of make sense as you read them. This is selecting the salary column from the employees gable where the name is "Martin Smith". This will return $10h. Make sense? RE: What are tables? - nevets04 - 12-21-2009 I understand the query, but how do you make the table? RE: What are tables? - wat - 12-21-2009 (12-21-2009, 07:44 PM)nevets04 Wrote: I understand the query, but how do you make the table? there's a mysql command line for making tables, but there's an easier way to do it. It's a super-slick webapp called phpmyadmin. It's in apt-get's repo's (I believe), and should be in yum's, too. Here's their website, http://www.phpmyadmin.net/home_page/index.php. Not only do they help you make tables, it also (among other things) lets you see an aesthetically pleasing visual representation of your tables. ;). RE: What are tables? - nevets04 - 12-21-2009 Code: An error has been encountered in accessing this page. |