| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Senior Member | Hey everyone I posted in the break room about a opp. My boss presented me with and it involves learning SQL. I have been reading for a few days and its starting to sink in somewhat. But I have a few questions . Lets start by telling you what he wants me to do.... and he told me yesterday i should be able to do it by tommorow (monday) Accounting system Set up a database on local comp. Set up acual database Select/insert/Update/Delete with joins Transaction TransactionID AccountID EntityID TypeID ClassificationID Amount DateWritten DateCleared CheckNumber Account AccountID Name StartDate StartAmount AccountStatement AccountID DateStart DateEnd Deposits Withdrawals Entity EntityID Name Classification-For if it's and expense example"Expense-Employee" or "Deposit-MErchant Account" ClassificationID NAme Type-Check/Credit Card TypeID Name I have no problem setting up the Database in Enterprise manager. The tables are easy. were I am having problems in desiding what is a primary key and such. If I am reading correct a primary key is to distinguish unique info? Also I can figure out what the best way to join this all together. Is there anyone out there that can help me on this one? Here is what I have so far.
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
| | #2 (permalink) |
| Professional Monkey | Yes the primary key is used to distinguish each individual record in a table. It is good practise to have at least one primary key per table. When creating the joins the easiest kind is an equi-join where the primary key of one table maps directly to a field in another table. For example you could join the tables Account and Transaction by linking the AccountID in transaction to the AccountID in Account using something like this: SELECT* FROM Account,Transaction WHERE Account.AccountID = Transaction.AccountID
__________________ [http://www.webmasterwords.com/python-split-and-join-examples]Python Tutorials[/url] |
| |
| | #3 (permalink) |
| Senior Member | OK so would both the AccountID fields need to be primary keys to join them? It seems to me there is alot that needs to be joined, but not much that needs to be unique
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
| | #5 (permalink) |
| Senior Member | Yeah im pretty sure I wont be able to do this by tommorow..BLAH Cant anyone just look at the diagram and tell me what I need to do?
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
| | #6 (permalink) |
| Senior Member | Anyone else?
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
| | #8 (permalink) |
| Senior Member | I do have another dumb question. I have sql enterprise manager set up on my home computer. is it possible to have more then one server setup? if so how do you do it?
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |