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 3601706
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:39:18+00:00 2026-05-18T20:39:18+00:00

Table Sufix: id, name (3, ‘com’) Table DomainName: id, name (2, ‘microsoft’) Table Domain:

  • 0

Table Sufix:
id, name

(3, 'com')

Table DomainName:
id, name

(2, 'microsoft')

Table Domain:
id, name_code, sufix

(1, 2, 3)    -- microsoft.com

Table SubDomainName:

(4, 'windows')

Table SubDomain:
id, name_code, domain

(7, 4, 1)     -- windows.microsoft.com

Table Email:
id, name, atserver

(3, 'myemail', 7)    -- myemail@windows.microsoft.com
(4, 'other', 1)      -- other@microsoft.com

Here is a problem of foreign key constraints. How can I resolve domains and subdomains to create emails correctly? I’m having problems with Unique INDEX with NULL values, for example, a solution maybe:

Table Email:
id, name, subdomain, domain

(3, 'myemail', 7, NULL)  -- myemail@windows.microsoft.com
(4, 'other', NULL, 1)    -- other@microsoft.com

BUT

(5, 'newemail', NULL, NULL)  -- will duplicated values in the table
(6, 'newemail', NULL, NULL)
(7, 'newemail', NULL, NULL)
(8, 'newemail', NULL, NULL)

AND

(**3**, 'myemail', 7, 1)   -- myemail@windows.microsoft.com and myemail@microsoft.com
  • 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-18T20:39:19+00:00Added an answer on May 18, 2026 at 8:39 pm

    How about (5, ‘newemail’, domain_id/subdomain_id, ‘domain/subdomain’)

    So you could have

    (5, ‘newemail’, 7, ‘subdomain’) or (5, ‘newemail’, 1, ‘domain’)

    YOu could still LEFT JOIN SubDomain and Domain table but you will get only the data from the one that you need based on the ‘domain/subdomain’ field.

    That is the quick solution. IMHO your DB structure is not very good and could be optimized. You should keep all domain/subdomain records in one table and use it for the emails. The table should be Table FullDomain: id, name_code, domain_name, subdomain_name


    (1, 3, 2, 4) -- windows.microsoft.com

    or


    (1, 3, 2, 0) -- microsoft.com

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

Sidebar

Related Questions

Table Sufix: id, name (3, 'com') Table DomainName: id, name (2, 'microsoft') Table Domain:
Table A has two columns: ID and name I want to input 3 ID
Table Structure: I Tried this: select Id, Name from Color where ParentId=4 UNION select
Suppose we have a NAME table like this: PERSON_ID PART_TYPE VALUE and PERSON_ID is
Table Name is Category. CategoryId ParentId Name 1 NULL StackOverFlow-1 2 1 StackOverFlow-2 3
I have a table with a whole name. I have a function that receives
table : id (integer primary key) data (blob) I use mysql and sqlalchemy. To
Table --------------------------------------------- | id | first_name | middle_name | last_name | --------------------------------------------- | 1
Table structure id (p) | date | id2 (fk) | id3 (fk) where (p)
Table #1: qa_returns_items Table #2: qa_returns_residues I have a long time trying to get

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.