Results 1 to 3 of 3
  1. #1
    Michael1926 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2018
    Posts
    10

    How do i relate these tables and also where do i have to put the primarykey or keys?

    Good evening everyone!



    So, the sheet asks me to create a database with 3 tables.

    The name of the first table is Bank and has specific features like the codenumber of the bank, the location, phonenumbers and the numbers of employess.

    The name of the second table is Stuff and also has specific features like name and lastname together in one field, number id, date of birth and if there are married (yes or no)

    The sheet asks me to create a third table with the name Loans which include specific features as well. The third table accepts from the first table the codenumber and from the second table the numberid, also it has the field payoff, the field duration and the last field type of loan.

    Hence, many to many relationship?, and if so, the primary keys are only on the first and second tables and the foreign keys are in the third table? Note that i didnt put any primary key in the third table

    Sorry for the big text

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    This sounds like homework??

    You are on the right track, although some things are not good programming practice. (No spaces on object names and first, fast Names should be in separate fields, do not use reserved words as object names ie "Name")

    I have an autonumber in every table as the PK field.
    For more about PK fields, see
    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp


    I guess you could call this a many-to-many relationship. To me, table "Loans" is the main data table.

    Since you have given us the info, I would have:
    tblBanks
    -----------------------
    BankID_PK - AUTONUMBER
    CodeNumber- TEXT
    Location - TEXT
    PhoneNumbers - TEXT
    NumOfEmployess - INTEGER


    tblStuff (Staff??)
    ------------------------
    StuffID_PK - AUTONUMBER
    FirstName - TEXT
    LastNamd - TEXT
    NumberID - INTEGER
    DateOfBirth - DATE
    Married - YES/NO

    tblLoans
    -----------------------
    LoanID_PK - AUTONUMBER
    BankID_FK - NUMBER - link to tableBanks
    StuffID_FK - NUMBER - link to tblStuff
    Payoff - DATE
    Duration - INTEGER (number of months??)
    LoanType - TEXT

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Michael1926,

    Please tell us a little about your post and the "sheet". As Steve said, it sounds like homework.

    We don't do homework for you, but we will offer advice and info if you are putting in a honest effort.
    Good luck.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 02-12-2017, 12:58 AM
  2. Replies: 2
    Last Post: 08-06-2015, 12:47 AM
  3. Replies: 2
    Last Post: 07-15-2014, 10:39 AM
  4. Best way to relate these tables.
    By rosco2382 in forum Database Design
    Replies: 2
    Last Post: 03-10-2014, 03:56 PM
  5. I just DON'T know how to relate Tables - PERIOD!
    By djclntn in forum Database Design
    Replies: 6
    Last Post: 02-26-2012, 07:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums