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

  • SEARCH
  • Home
  • 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 7939839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:13:19+00:00 2026-06-03T23:13:19+00:00

I know how to create one to one relationship only problem is that it

  • 0

I know how to create one to one relationship only problem is that it demands rows in both tables e.g. i have a table

emp_table => key1, key2, name, description
emp_address_table => key1, key2, address

system do not put mandatory constraints on address so an emp may exist without having his/her address, OR emp may have maximum one address not more that that so it seems

1:1(0) relationship

please let me know how can i do that in sql server 2008

  • 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-06-03T23:13:21+00:00Added an answer on June 3, 2026 at 11:13 pm

    You can’t have a constraint that enforces the existence of a child row because you can’t insert the two rows at the same time. I.e. whether you insert your employee, or employee address row first, you would have an invalid constraint at this point.

    So all constraints in SQL are ‘0 or more’ and never ‘1 or more’ or ‘exactly 1’.

    You can enforce a ‘0 or 1’ constraint by adding a UNIQUE constraint to the foreign key column in the emp_address table. This will ensure there can be at most one emp_address row that refers to a given employee.

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

Sidebar

Related Questions

I want to do a search across 2 tables that have a many-to-one relationship,
I know that in a standalone application I create one of the application context
I want to know how to create a label that contains two icons, one
Does anyone know how to create a one-to-one relationship from a SQL Server database
I currently have a one to one relationship between two tables in MS Access
I know that private inheritance is supported in C++ and only public inheritance is
This is a bit of a tricky one. I have Document entities that are
Hi ok I have two tables one called Login and one called User there
I have two entity with a many-to-one relationship. For example Employee <<---> Shop .
I am trying to add a key from one table to another so that

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.