Skip to main content
Known Participant
November 7, 2010
Answered

How to create tables for using in SQL/php website

  • November 7, 2010
  • 34 replies
  • 9467 views

Sorry for asking basic question because I 'm knew.

i was building a dw site for listing multiple products. i was following DW, the Missing Manual book tutorials. The tutorial offers downloadable data tabels in a folder with .sql extension. I just cannot find anywhere an instruction as how the .sql folder is created.

Second question: if it can be created in Access 2007, please tell me how.

thank you sooo much.

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer David_Powers

Thanks, Walt.

I have gained some knowledge about the types of relational tables from recent reading and it is great that you pointed out the aspects of migrating from Excel to SQL.

What I am trying to work out is a product list for research labs. Here is a snapshot of how the categories look like.

categoryID    categoryName     motherCategoryID

1                  reagents                         null

2                  proteins                             1

3                  DNA engineered Proteins    2

4                  enzymes                           2

5                  antibodies                         1

6                 primary antibodies               5

7                 labeled primary antibodies    6

8                 unlabeled primary antibodies 6

9                 second antibodies                5

10               buffers                              1

11               pH buffers                         10

12               non-pH buffers                   10

......

You can tell under the main category 'Reagents' there are several sub categories and each of those include another level of sub categories and it goes on more levels.

It is easy work to create a product label, but I am pausing at how to make this category table, so I can properly relate the products.productID to categories.categoryID.

I feel I should adopt the categoryIDs of those lowest level categories. For example, for product phosphate buffer, I should link it to #11 pH buffer rather than #10 buffers.

More about the category table: Originally I thought I need a category table and a sub-category table, but that doesn't work, because some categories have one lower level sub-categories and some have several lower levels. Making different data sets for different categories will for sure solve this problem, but that makes the database much complicated. So I figured I may create a categories table like the one I just typed.

I don't yet know if this is a totally dumb idea.

At least this illustrates what I am trying to do. How would you database categories like this?


Try reading the following article for guidance. http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html. Life becomes a lot easier when you understand the basic principles of normalization.

34 replies

Participating Frequently
November 7, 2010

Files with the .sql extension are just text files that contain SQL query language.  In this case, my guess is that the files contain the SQL commands to create tables and maybe even populate them with some data.  Not sure about the latter.

They can be imported into MySQL and even into Access.  You may have to read the documentation on Access to find out how to import them.

Not sure about your question about a sql folder.  Not sure what you mean by that.

Walt

B & B Photography

Known Participant
November 7, 2010

My question is: how to place Access data tabels in a folder name xxxx.sql, so it can be utilized in a website. Thanks.

Participating Frequently
November 8, 2010

As far as I know and remember from my years with Access, the tables used in an Access database are contained in a single file with the suffix of xxxx.mdb.

Maybe Access 2007 is different but I do not know since the last version of Access I used for web or any other development was in Office 2003 and that created all the tables in a single file called xxxx.mdb.

From what I see on the web, Access 2007 still creates a single file for the Access database.  I guess I just do not understand what and why your are asking about a xxxx.sql folder.  Is that where you want to put the mdb file?  Are you using an Access project to link to a database implemented in SQLServer?

If you could give me a reference to what you are doing, I might be able to assist.  I have 15+ years in database, database application, and web application development.

I am sorry I am not immediately understanding what you are asking.

Walt

B & B Photography