Question:
How do I create a table in SQL?
BananaBoatTan
2008-06-05 07:38:21 UTC
I just took an online tutorial on everything I need to know about SQL. I opened up a hosting account at GoDaddy and signed up for a MYSQL database. I know how to do the actual scripting to make the table, I just don't know where to start. Where do I put the code to make the table?

Also, I have read something about http://localhost/ - is this an easier way for me to access SQL? Can you explain more about this?

I am making a CMS for my website, and only know html, css, and javascript...so I am having a little trouble with this PHP/SQL stuff! Any help would be greatly appreciated :)

Thanks,
Jessica
Four answers:
2008-06-05 08:38:56 UTC
If you've logged into the MySQL database successfully, read the documentation on the MySQL site for further information - or call GoDaddy tech support, and ask if they'll walk you through it (they probably will - if you don't know already, they're pretty nice).



Or, best, run phpMyAdmin for a GUI interface to the database - creating a table is click and type.



(Learn PHP first - it's the only way you're going to be able to actually do anything with the database, unless you're planning on just uploading a complete system that uses the database.)
TheMadProfessor
2008-06-05 14:55:29 UTC
Creating the tables for your database is (ideally) something you only do once. It's often easiest to do it on your home PC (i.e. localhost) and then upload it to your web host.



Any good SQL reference should be able to give you the basic syntax - just look for CREATE TABLE.



The real kicker is designing a good database - that's a skill that can only come over time. It is possible to modify the database structure after the fact, but it is a far more complicated task, especially if the database is already populated. Changing the structure of an existing database can sometimes alter your data in strange and wonderful ways...
Maxood
2008-06-05 14:47:29 UTC
Hi jessica, here is the syntax for creating a table in a database:

CREATE TABLE table name(column name data-type,......);



The above syntax is same for Access, SQL Server, Oracle, MySQL,etc.

There are loads of tutorials available on the net for learning SQL. You can search it on google. One of the best one i found was on www.about.com in Databases section.
2008-06-05 14:48:29 UTC
Type the following



create table "table name":

insert into "table name" "( ...........)":


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...