views:

40

answers:

2

I think the title is self explanatory.

What I'm looking for is material so I can further my knowledge. I've never developed a full application before so building one from scratch is a bit overwhelming for me. And the first bump in the road is the database.

Websites, articles, books, elaborate answers, anything will do as long as they keep me on the right track.

Thanks

UPDATE: Sorry for not mentioning earlier. The platform is .NET and Winforms.

+3  A: 

Well, best answer is - not at all. Dont et me wrong, but..... the sql structure is not really dependant on how the application is structured.

Some ideas, though: + If you want a business layer, stay light on stored procedures - your logic is supposed to run in the business layer. SOME sp#s make sense, though - sometimes it is better for performance.

I would suggest Scott Ambler's "Building Object Applications That Work" - ancient but good.

TomTom
will give it a try, thanks
AlexRednic
As TomTom said, the SQL structure has virtually nothing to do with the application's architecture.
Tomislav Nakic-Alfirevic
A: 

The one mistake I did in the beginning of my programming days, is not use a database class there are many out there, i have one that i have added to over the years, but this will speed up your development time. As far as database goes there are so many rules and things you learn with trial and error... the internet is a great resource. SQL is pretty easy to pick up.

I dont know what your level is so ill go over some basics that i know of...

I would say a few do's and don'ts Dont name your database, tables, & columns common names ie "users", "products" come up with your own naming structure something like

database : prod_dbb9 table : tbb_users column : u_uid, u_userid

This will prevent someone from guessing your tables or database structure and allow you to hack your db.

Sql injection is pretty easy to do... so always escape your sql commands to the database! PHP has a built in function for that mysql_real_escape_string

always remember ID numbers are easier on the database than text so if you can pull records by id numbers

ie: profile.php?id=123 rather than profile.php?username=jason

Kind of obvious but don't name your querystrings the same as your columns in your db ie

profile.php?u_userid=123

If you are deletin only one record make sure to put "limit 1" at the end of your SQL this will help prevent more records from getting deleted by hackers.

Always encrypt your users passwords. You can choose to use php MD5() but be aware that this is one way encryption...(no one can ever see this password again) so if your user forgets their password you will have to generate them a new password and mail it to them...

Well thats all i got for now.. good luck!

  • Jason
jason
very nice and elaborate answer. +1 for having the patience to write it but I'm more interested in the database itself and it's structure
AlexRednic
i'd say to **do** name your database entities with suggestive names otherwise the dba or other developers will probably kill you. since you have a business layer in front of your db it's very unlikely that someone will guess its structure.
devnull
-1 for a lot of inpractical stuff that would be "breaking convenstions" in pretty much all projects I ever was in. I agree with devnull - name items sensible. Dont care abot hackers there. Use schemata to isolate your items. Don't assume SQL means mySQL ;)
TomTom
Same here. I personally believe that naming variables,classes,tables,columns with suggestive names is the way to go.
AlexRednic
TomTom please show me anywhere it says breaking conventions by naming your tables a little different than everyone else.. i havn't read any standards put out in database naming / tabling name... but none the less these are just some suggestions that i do, take them or leave them i dont care
jason