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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:00:05+00:00 2026-06-18T06:00:05+00:00

Is it possible to write/make a schema for a PostgreSQL db and then query

  • 0

Is it possible to write/make a schema for a PostgreSQL db and then query let’s say

SELECT email, username, city_population
FROM users, cities
WHERE email = 'user@example.com'

And the connection between the users table and cities table is defined somewhere else, and PostgreSQL uses that informtion to join the tables. Is there something like that?

Edit: and without views

  • 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-18T06:00:07+00:00Added an answer on June 18, 2026 at 6:00 am

    No, the NATURAL JOIN described by Daniel is as close as SQL comes. There is a reason. While people often want to join based on equality of columns in the same domain, they sometimes want something more complex. I have seen a lot of queries which ask for things like “Who lives in a city within 300 miles of this city?”, “What are the 3 closest cities to this user, excluding the one they live in?”, or “What other users live in the same state as this user?” Having automatic joins based on some assumed join criteria would make it harder to write unambiguous queries to answer questions like that.

    That said, it is not uncommon to want what you’re looking for, so as Craig said, there are many tools which use foreign key definitions to provide default linkages.

    Based on the question, I suspect that you might possibly be interested in HTSQL, which provides automated linking and other convenience features to assist in bridging the gap between a relational database and other formats which people might already know. Its development is funded in part by foundation grants, including the National Science Foundation. (I have no relationship to the project other than having read documentation, and having had a brief conversation with one of the authors at a conference.)

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

Sidebar

Related Questions

Is it possible to write this query in codeigniter active records? $Main_Nav_Query = mysql_query(SELECT
Let's say you have to [write from scratch, rewrite, refactor] a sample program illustrating
Personally I really prefer Unit Testing and write them for good coverage. (let's say
is it possible to make write(); function non-blocking without using threads? short buffer[BUFFER_LEN]; int
Is it possible to write a JavaScript to make an action when a DIV
I am just learning about Cygwin, and it appears to make possible to write
Would it be possible to write a class that is virtually indistinguishable from an
Is it possible to write a GUI from inside a function? The problem is
Would it be possible to write a program that can make an image, lets
Is possible to write language agnostic Robotium tests? For example, if you use a

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.