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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:00:30+00:00 2026-06-09T23:00:30+00:00

I have a database with this tables Conversion and Client I want to create

  • 0

I have a database with this tables Conversion and Client I want to create relation between this tables
so ID_Send in Conversion Reference to ID in Client
and ID_Receive in Conversion Reference to ID in Client

create table Conversion(ID_Send int ,
                        ID_Receive int ,
                        [Time] datetime,
                        [Message] varchar(2048),
                        primary key(ID_Send,ID_Receive,[Time])
                        )

create table Client (ID int IDENTITY(1,1) primary key,
                    [First name] varchar(500) not null,
                    [Last Name]varchar(500) not null,
                    [Birth day] datetime,
                    Gender bit not null,
                    Country  varchar(200)not null,
                    City varchar(200) ,
                    [Language] varchar(200)not null, 
                    [Chat name] varchar(500)not null ,
                    [Password] varchar (500)not null,
                    --foreign key(ID) REFERENCES Conversion (ID_Send)--there is an error 
                    ) 
  • 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-09T23:00:32+00:00Added an answer on June 9, 2026 at 11:00 pm

    Motazz, there can be only one Primary key in a table like you have in the Client table. to get rid of the error:

    1st create the Client table,
    2nd replace the code for Conversion with:

    create table Conversion(ID_Send int FOREIGN KEY REFERENCES Client(ID),
                        ID_Receive int FOREIGN KEY REFERENCES Client(ID),
                        [Time] datetime,
                        [Message] varchar(2048),
                        primary key(ID_Send,ID_Receive,[Time])
                        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In this example we have 3 related tables on a SQLite database: CREATE TABLE
I have this enormous database : # # Dropping tables # DROP TABLE IF
I have this database structure, SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; CREATE TABLE IF NOT EXISTS `announces` (
We have this current database which we need to replace some tables by anther
So this is what I have, I have a SQLite database with 3 tables:
I have multiple tables in a MySQL database. Lets say they look like this:
Suppose I have 2 tables in a database. eg: Dog & Boss This is
Suppose I am building an app using current mysql database tables. I have this
i have database table like this +-------+--------------+----------+ | id | ip | date |
I have a database application in which a group is modeled like this: TABLE

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.