Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
Like Tree2Likes
  • 1 Post By turboguy
  • 1 Post By Ronald Roe

Thread: relarelational

  1. #1
    Senior Member
    Join Date
    Apr 2016
    Posts
    717
    Member #
    53891
    Liked
    11 times

    relarelational

    how does a database designed in a relational manner differ from a non relational model.

    I read somewhere that a relational db contains tables of info that are related through common fields... so what? how does that improve the db design over a non relational? does it make it easier to query?

    my idea of a database... (rudimentary I'm sure)

    a user signs up to a site like facebook, a table is created with his name, email, space for status updates, photos etc all in the one table, am I wrong in thinking this? where does the relational part come into play?

  2.  

  3. #2
    Senior Member
    Join Date
    Aug 2014
    Posts
    387
    Member #
    39859
    Liked
    136 times
    A relational database saves entering data a number of times. I don't think it makes it any easier to query but makes it easier to enter data.

    For example to keep it simple.

    You have one database that is.

    Employee number
    Employee name
    Employee address
    Employee city
    Employee state
    Employee zip
    Employee phone

    You have a second one that is

    Employee Number

    Hours worked.

    You have a third data base that is

    Employee Number
    Pay Scale
    Overtime Rate

    You could then have a program where you enter the employee number and the hours worked and it would retrieve the name and address info from the first data base, use the hours worked from the second and the pay scale from the third. You would only need to enter the address info if it changed not every time and would only need to enter the pay scale or overtime rate if that changed. That is a pretty simple explanation but should give you an idea of the benefits.

    They can be linked because they share a common Employee number.
    busso likes this.

  4. #3
    Senior Member
    Join Date
    Apr 2016
    Posts
    717
    Member #
    53891
    Liked
    11 times
    so when employee number is entered into the first table, it automatically populates the second and third table?

  5. #4
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    No. When you create the record in the second and third tables, you'll use the employee number to tie it back to the employee record in the first table.

    Then, say you want to pull an employee's name, how many hours they've worked, and how much of that was overtime. You'd write a special query (called a "join") that uses that employee number to get just what you want from each table.
    busso likes this.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com