NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page SQL Questions

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-09-2006, 12:01 PM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Nov 2003
Location: Florida
Posts: 2,026
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 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
????: NamePros.com http://www.namepros.com/programming/215159-sql-questions.html

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, 12:16 PM   #2 (permalink)
Professional Monkey
 
Amnezia's Avatar
Join Date: Jul 2005
Location: Escaped from the zoo
Posts: 907
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
__________________
Webmaster Words
Amnezia is offline  
Old 07-09-2006, 12:38 PM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: Nov 2003
Location: Florida
Posts: 2,026
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 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, 01:08 PM   #4 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
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, 01:20 PM THREAD STARTER               #5 (permalink)
Senior Member
Join Date: Nov 2003
Location: Florida
Posts: 2,026
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 beholdslipondajimmy is a splendid one to behold
 




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, 07:43 PM THREAD STARTER               #6 (permalink)
Senior Member
Join Date: Nov 2003
Location: Florida
Posts: 2,026
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 beholdslipondajimmy is a splendid one to behold
 



Anyone else?
slipondajimmy is offline  
Old 07-10-2006, 09:06 AM   #7 (permalink)
NamePros Regular
 
Tree's Avatar
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
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, 05:43 PM THREAD STARTER               #8 (permalink)
Senior Member
Join Date: Nov 2003
Location: Florida
Posts: 2,026
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 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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:44 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger