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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:50:56+00:00 2026-06-02T23:50:56+00:00

Lets assume I have the following table create table Article ( ART_ID bigint not

  • 0

Lets assume I have the following table

create table Article
(
  ART_ID        bigint not null auto_increment,
  ART_NAME      varchar(25) not null,
  ART_COST      decimal(8,2) not null,
  ART_DESC      text,
  primary key(ART_ID)
);

and also this table

create table Fruits
(
  FRUITS_ID     bigint not null auto_increment,
  FRUITS_TYPE   varchar(15),
  FRUITS_FROZEN timestamp DEFAULT CURRENT_TIMESTAMP,
  primary key(FRUITS_ID )
);

I want the Fruits table to have all the fields of the table Article. How can I implement this? Should I reference it by some relation or is there another trick?

  • 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-02T23:50:57+00:00Added an answer on June 2, 2026 at 11:50 pm

    I think what you need here is to add an ARTICLE_ID field to Fruits, and then reference it to Articles.ART_ID via a FOREIGN KEY constraint to ensure data consistency.

    Note that this means that for each fruit, to have some “article” fields set, a corresponding record in Articles must exist. If you don’t want article fields to be mandatory for a fruit, you can make the ARTICLE_ID field nullable. This still allows a foreign key to be defined, but it will only enforce a reference if the value stored in ARTICLE_ID is not NULL.

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

Sidebar

Related Questions

Let's assume that I have the following table: CREATE TABLE [dbo].[PricesHist] ( [Product] [varchar](6)
Lets assume I have the following 3 entities: Customer,Order,Product which interact in the View
Lets assume we have the following code: abstract class Base1 { protected int num;
Lets assume i have a query like the following $query_search = SELECT * FROM
I have the following HQL query and for simplicity sake lets assume the mappings
Let's assume I have the following structure <table> <tr> <td> <input type=text name=name />
Lets assume I have the following Java code: public String foo() { // returns
I have the following question: Let's assume the code below: ... <h:form id=..> <table>
Let's assume you have a table and the following Jquery code var rows =
Let's assume I have following table in the database: Id ProductId ColorId IsDeleted 1

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.