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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:33:55+00:00 2026-05-12T11:33:55+00:00

I mean things like: FK1 -> 1FK2 -> 2PK Please, note that 1FK2 is

  • 0

I mean things like:

FK1 -> 1FK2 -> 2PK

Please, note that 1FK2 is a PK to FK1, but the 1FK2 is a FK to 2PK. So the key in the nested structure is a FK and a PK.

An example:

--- Like an interface
CREATE TABLE q_content (
user_id SERIAL PRIMARY KEY, ---);

---- tables that refer to it
CREATE TABLE questions (
user_id SERIAL 
    references q_content(user_id) ---);

CREATE TABLE removed_questions (
user_id SERIAL
    references questions(user_id) ---);
  • 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-12T11:33:55+00:00Added an answer on May 12, 2026 at 11:33 am

    Yes, a column can be a primary key of its table as well as a foreign key to a parent table.

    However, in this case you don’t need to use SERIAL as the data type for questions.user_id and removed_questions.user_id. The SERIAL data type implicitly creates a new sequence object, and you don’t need that since these primary keys must contain only values that already exist in the table they reference.

    Also this is tangential to your question, but I wouldn’t define a removed_questions table at all. This should be an attribute column in the questions table.

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

Sidebar

Related Questions

I keep making attempts at properly using HTML5 but I feel like it's still
// Java programmers, when I mean method, I mean a 'way to do things'...
According to wikipedia : functional programming is a programming paradigm that treats computation as
I do mean the ??? in the title because I'm not exactly sure. Let
Here a couple of examples in a pseudocode to show what I mean. This
Is there a way to make the text in a JTextPane look similar to
I'm an experienced C/C++ programmer getting into Java and looking for a good IDE
I have a task tracking application, which is very basic. It currently has a
I want to create a PDO class for handling data base connections. Here is
I have an issue here where I'm trying to call a class method on

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.