Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6138301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:51:18+00:00 2026-05-23T17:51:18+00:00

Please guide me if I’m on right track. I’m trying to create database schema

  • 0

Please guide me if I’m on right track.

I’m trying to create database schema for Mobile Bill for a person X and how to define PK, FK for the table Bill_Detail_Lines.

Here are the assumptions:

  1. Every customer will have a unique relationship number.
  2. Bill_no will be unique as it is generated every month.
  3. X can call to the same mobile no every month.
  4. Account_no is associated with every mobile no and it doesn’t change.

Schema:

table: Bill_Headers

Relationship_no    - int, NOT NULL , PK
Bill_no            - int, NOT NULL , PK
Bill_date          - varchar(255), NOT NULL
Bill_charges       - int, NOT NULL

table: Bill_Detail_Lines

Account_no    - int, NOT NULL
Bill_no       - int, NOT NULL , FK
Relationship_no - int, NOT NULL, FK
Phone_no      - int, NOT NULL
Total_charges  - int

table: Customers

Relationship_no    - int, NOT NULL, PK
Customer_name      - varchar(255)
Address_line_1     - varchar(255) 
Address_line_2     - varchar(255) 
Address_line_3     - varchar(255) 
City               - varchar(255)
State              - varchar(255)
Country            - varchar(255)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:51:19+00:00Added an answer on May 23, 2026 at 5:51 pm

    I would recommend having a primary key for Bill_Detail_Lines. If each line represents a total of all calls made to a given number, then the natural PK seems to be (Relationship_no, Bill_no, Phone_no), or maybe (Relationship_no, Bill_no, Account_no).

    If each line instead represents a single call, then I would probably add a Line_no column and make the PK (Relationship_no, Bill_no, Line_no).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can some one please guide me how to create an Oscillation Animation on an
Could someone please guide me into the right direction for this: I wan to
Please guide me how to save Master-detail record in sql server database. All of
In WP7 I am trying to limit the Textboxtext size. Please guide me in
I am trying to do the following, can you please guide/help me do it:
I am very new to json, google apis. So please guide. I am trying
Please guide what is meaning by Web is stateless in simple words ? Kindly
Can some one please guide me to understand which jar file i need to
Can you please guide me what is session and session variables? I don't need
Please recommend some websites with a quick guide. MSDN is good but it's hard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.