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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:59:14+00:00 2026-05-31T18:59:14+00:00

i am having three tables namely 1)cd_register |—————————————————-| | username | name | age

  • 0

i am having three tables namely

1)cd_register

|----------------------------------------------------|
|   username  |  name   |  age   | sex   | dob       |
|----------------------------------------------------|

2)cd_social

|-------------------------------------|
|   username  |  religion  |  caste   |
|-------------------------------------|

and
3)cd_professional

|----------------------------------------|
|   username  | occupation | education   |
|----------------------------------------|

now i’m using this query in mysql but its giving error

SELECT cd_register.name, cd_register.age, cd_register.dob, cd_social.religion, cd_social.caste, cd_professional.profession
FROM cd_register, cd_social,cd_professional
WHERE 
cd_register.sex = 'Male',
cd_social.religion = 'Hindu',
cd_social.caste = 'Brahmin',
cd_professional.occupation = 'Doctor',
cd_register.username = cd_social.username AND
cd_register.username = cd_professional.username 

now i want to mention that username is the primary key of all the tables. Also
username of cd_register is foreign key in cd_social. Also
username of cd_register is foreign key in cd_professional.

  • 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-31T18:59:15+00:00Added an answer on May 31, 2026 at 6:59 pm

    You can use join

    SELECT t1.name, t1.age, t1.dob, t2.religion, t2.caste, t3.profession
    FROM cd_register as t1
    LEFT JOIN cd_social as t2 
    ON t1.username = t2.username and t2.caste = 'Brahmin' and t2.religion ='Hindu'
    LEFT JOIN cd_professional as t3 
    ON t1.username = t3.username and t3.occupation = 'Doctor' 
    WHERE t1.sex = 'Male'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three tables A, B, C. A having Id,Name,Address coulmns. B is the
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I am trying to join three tables together but having a problem getting the
I am having a problem trying to JOIN across a total of three tables:
I have three tables in my database: Products id (int, primary key) name (varchar)
HI have 3 product tables, each with 3 columns namely customer name, and boolean
I have three tables, 1-Users, 2-Softwares, 3-UserSoftwares. if suppose, Users table having 6 user
I have three tables filters (id, name) items(item_id, name) items_filters(item_id, filter_id, value_id) values(id, filter_id,
I have 2 tables having many to many relation and hence there is junction
I my application i am having three links, on clicking the link i need

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.