[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 07-09-2006, 11:01 AM   #1 (permalink)
Senior Member
 
Join Date: Nov 2003
Location: Florida
Posts: 2,010
117.50 NP$ (Donate)

slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold


Help! SQL Questions

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.
Attached Images
File Type: jpg picture001.jpg (51.8 KB, 16 views)
slipondajimmy is offline  
Old 07-09-2006, 11:16 AM   #2 (permalink)
Professional Monkey
 
Amnezia's Avatar
 
Join Date: Jul 2005
Location: Escaped from the zoo
Posts: 908
13.25 NP$ (Donate)

Amnezia has a spectacular aura aboutAmnezia has a spectacular aura about

Cancer Survivorship Save a Life
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]
Amnezia is offline  
Old 07-09-2006, 11:38 AM   #3 (permalink)
Senior Member
 
Join Date: Nov 2003
Location: Florida
Posts: 2,010
117.50 NP$ (Donate)

slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold


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
slipondajimmy is offline  
Old 07-09-2006, 12:08 PM   #4 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute

Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
no if possible Transaction.AccountID should be a foreign key (but depending on the database engine and version number it is not always possible, for example versions before mysql 5 did not support foreign keys).
Peter is offline  
Old 07-09-2006, 12:20 PM   #5 (permalink)
Senior Member
 
Join Date: Nov 2003
Location: Florida
Posts: 2,010
117.50 NP$ (Donate)

slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold


Thumbs down

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?
slipondajimmy is offline  
Old 07-09-2006, 06:43 PM   #6 (permalink)
Senior Member
 
Join Date: Nov 2003
Location: Florida
Posts: 2,010
117.50 NP$ (Donate)

slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold


Anyone else?
slipondajimmy is offline  
Old 07-10-2006, 08:06 AM   #7 (permalink)
NamePros Regular
 
Tree's Avatar
 
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
13.25 NP$ (Donate)

Tree will become famous soon enoughTree will become famous soon enough


Do some research, I'm sure you'll figure it out.
Tree is offline  
Old 07-10-2006, 04:43 PM   #8 (permalink)
Senior Member
 
Join Date: Nov 2003
Location: Florida
Posts: 2,010
117.50 NP$ (Donate)

slipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to beholdslipondajimmy is a splendid one to behold


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?
slipondajimmy is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 07:47 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85