Database Question (Full Version)

All Forums >> [Fun] >> Computers & Technology



Message


FreeEagle -> Database Question (9/3/2008 6:20:42 AM)

I'm still in the pre-planing stage, and am somewhat lost - but I'm building my first database using MySQL. Lets say I want my database to list books available at different book stores around the country. So I would have a categories for the book classification, the title, a brief description, and the name and address of the book store. Now some of these books I'm going to add to the database myself, and others the book store owners will add.
Question 1.) I want ALL my viewers to see the book classification, the title, the description of the book, and the city in which the book is located, but I only want SELECT PEOPLE to see the actual book stores contact information.
Do I need one database to list the books, and another database to list the stores contact information? How do I separate what information some can access?
Question 2.) How do I Design a form (I'm somewhat familiar with html forms) that will allow my viewers to enter their own information into the database? Currently I have my forms go through cgi-bin, and the information comes to me in an email. Can I redirect this information directly into the database?




PolarBear -> RE: Database Question (9/3/2008 2:01:01 PM)

Hi,

No, use the same database for everything, especially if it will be joined together. Use different tables though.

Always remember the principle of normalization. If you don't, you will regret it later. It basically means that the same piece of data should never be stored twice. For example, do NOT have a table like this:

book name, book store name

Instead have a table 'books' with a field 'id' (type auto_increment) and the title and description as text.
Another table 'bookstores' also with an auto_increment id, bookstore name, address, whatever as text.

Then a table 'bookatstore' or whatever with each row containing the ID of a book and the ID of a store.

About forms, that's the fun of web programming. It can be a bit tedious. Basically your server script has to parse the contents of the form variables, then construct an appropriate SQL database command inserting all the values.

If the form is for editing a record, it first needs to SELECT the current contents, put them in the form, then on submit you need to construct an UPDATE command.




iluvatar -> RE: Database Question (9/3/2008 9:10:41 PM)

Are you doing this as homework or are you doing this as a business? I won't say that there's a TON to understand about doing basic database design, but there's enough that you shouldn't be starting on something that's eventually supposed to go into production. Even a semester or two of undergraduate database theory that includes normalization and SQL basics would help immensely.

-Dan.




LoyalGypsy -> RE: Database Question (9/4/2008 10:46:38 AM)

quote:

ORIGINAL: iluvatar

Are you doing this as homework or are you doing this as a business? I won't say that there's a TON to understand about doing basic database design, but there's enough that you shouldn't be starting on something that's eventually supposed to go into production. Even a semester or two of undergraduate database theory that includes normalization and SQL basics would help immensely.

-Dan.



Greetings,

I am new at this also, can Sql quarry info form an access database? If so can't the poster just crate a link table in access for the SELECT PEOPLE to see the actual book stores contact information?

At a price ...of course [:D]


LG




PolarBear -> RE: Database Question (9/5/2008 4:57:19 AM)

Yeah, a class couldn't hurt. If you obviously don't understand this stuff, and need it fast, find someone who does understand and pay them. [:)]

Me, I'm aiming my career towards being a DBA. Maybe in a few years. I do currently support MySQL at work, but I much prefer PostgreSQL.




FreeEagle -> RE: Database Question (9/7/2008 8:37:55 PM)

Thanks all for the tips, I understand a good portion, but as much as I hate to admit it I think I'm going have to go to classes. I just think of the last learning seminar I went to, Paid $6,000 - I learned a lot, but after I understood the terminology, I found out I could have learned the same thing for $40 on the web. Is there any good recommended books on database building, like that show pictures of "if you want this" do this? I think now I'm clear as to 80% of what I have to do to build the database, but I'm still lost as to building pages where "XYZ" is the information, a viewer only sees "Y" or ads information to only "X and Z"




iluvatar -> RE: Database Question (9/7/2008 9:25:06 PM)

quote:

ORIGINAL: FreeEagle

Paid $6,000 - I learned a lot, but after I understood the terminology, I found out I could have learned the same thing for $40 on the web.


YIKES! One or two classes at a community college ought to be enough to get by for small databases.

quote:

but I'm still lost as to building pages where "XYZ" is the information, a viewer only sees "Y" or ads information to only "X and Z"


SQL is used to send a variety of commands to a database including fetching data, creating new records, searching, etc. The specifics of how to implement that into your web site are dependent upon how exactly your site is configured.

-Dan.




LoyalGypsy -> RE: Database Question (9/7/2008 9:33:32 PM)

quote:

ORIGINAL: FreeEagle

Thanks all for the tips, I understand a good portion, but as much as I hate to admit it I think I'm going have to go to classes. I just think of the last learning seminar I went to, Paid $6,000 - I learned a lot, but after I understood the terminology, I found out I could have learned the same thing for $40 on the web. Is there any good recommended books on database building, like that show pictures of "if you want this" do this? I think now I'm clear as to 80% of what I have to do to build the database, but I'm still lost as to building pages where "XYZ" is the information, a viewer only sees "Y" or ads information to only "X and Z"



Greetings

Check this site out, it offers a little about Advanced Access ...free!
http://iso.hsc.wvu.edu/cblc/HowTo/HowTo.php


LG




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI