08. maj 2005 - 16:38Der er
45 kommentarer og 1 løsning
Database Design
Well, I don't know where to start. However, here it goes. I am tryin' to make a database for a online shopin' cart (which by the way is a school project of mine) I need make this shopin' cart in c++ and mySQL, I havn't had much me hands in mySQL, quite frankly I never have (yet we have make the database in mySQL). But, back to the matter of discussion, If it's not much of a hustle I hopin' that ye might me of some help to me *as ye have been previously*
I've got the database design and the ClassDiagram I don't know if that would be of any help. However here are the url's:
I know this doesn't contain all the thing a pro. shopin' cart should include. Well, this isn't a pro. cart. It's should only be able to preform the esstinal tasks. Nevertheless, ye are more than welcome to add a few things'
ps: if it's of any help I could also provide ye with me fatal atempt at mySQL (the SQL file)
It should be relative easy to create the necesarry tables in MySQL.
What API are you using for C++ -> MySQL ?
Regarding the design then you have choosen to map the clas hierachy to 1 database table. You could also have choosen 2 tables or 3 tables. But of you are comfortable with your choice, then it is fine.
Well, I am currenly usin' MYSQL Borland C++ API. There is is nothin' wrong with the database I just can't seem to get the primary keys to link. Could help me out here?
Okay, but could ye please check; if it's not much to ask, if the database design diagram is equal to the end product the SQL file...Cause that would be a real helpful thing...thanx :)
Now that's what's I am talkin' about. See I knew there was somethin' wrong. Since I am runnin' pretty busy with C++ programmin', So, I am askin' ye if ye could please make the so called good changs to the database I would be really thankful...thanx :)
he he...okay....and what do I need to do, if I want the table called person which contains the esstinal stuff which both the "ansat" and the "kunde" share and the two other tables called "kunde" and "ansat" which got the thing which they don't have in common..if ye catch me drift.
you can map a class hirachy like this to tables in 3 ways:
1 table with all the fields from all classes 2 tables one for each concrete class with all fields for this including inherited 3 tables on for each class with the same primary key used as foreign keys in sub classes
In the design you used the first.
In the SQL you used the last.
Both are fine, but design and SQL should match.
And I think are missing a field in the 2 sub class tables: BRUGERID
Guess, ye don't have time for that...well...what can I do....thanks for ye help. please anwser if ye want ye points, mate *thank ye very much for ye time*
I am not sure what you expect from me. You can add the constraints, try execute the SQL and see if it works. If it does not, then check the SQL statements and if it does not reveal anything then post the CREATE TABLE statements and the error text here - and we will look at it.
Well, okay, I'll give it one more shot *but if that doesn't work I hope ye can make all the referential links in this database*
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.