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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:55:35+00:00 2026-05-25T05:55:35+00:00

I’m trying to create my first database relation and I’m confused here (I am

  • 0

I’m trying to create my first database relation and I’m confused here (I am doing lot’s of reading too but I am still confused)
I’m trying to create two tables, venues and venue_types.

‘venues’ has an ID and a VENUE_TYPE column while ‘venue_types’ has ID and TYPE_NAME.
I want the VENUE_TYPE column in ‘venues’ to reference the ID column in ‘venue_types’. Let’s say that the VENUE_TYPE is set to 3, and row three in ‘venue_types’ is Casino.

So in a way this is a one to many relationship table where ‘venue_types’ can have many venues while ‘venues’ can have only one ‘venue_type’.

This is what I have and I’m not sure if it should be the other way around, please let me know:
enter image description here

Thanks a lot everyone :)!

Edit: I am also confused that "venue_type" column has a Foreign key label beside it which I’m not sure if that means it contains a foreign key or that it is a foreign key itself?

  • 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-25T05:55:35+00:00Added an answer on May 25, 2026 at 5:55 am

    In general, the table containing the referencing column (in your example, Venues) is the ‘child’ table; the table containing the referenced column (in your example, Venue_Types) is the ‘parent’ table. Normally, the referenced column is the primary key of the table; it should be a unique identifier or candidate key for the table.

    The venue_type column in the Venues table is marked FK because it is a foreign key column; it contains values which must be present in the referenced table, the Venue_types table. You can have compound foreign keys if the referenced table has a compound primary key.

    Note that you can have a table with multiple candidate keys, but a table can only have one primary key. Consider the ‘Table of Elements’; it might be represented by:

    CREATE TABLE elements
    (
        atomic_number   INTEGER NOT NULL PRIMARY KEY CONSTRAINT c1_elements
                        CHECK (atomic_number > 0 AND atomic_number < 120),
        symbol          CHAR(3) NOT NULL UNIQUE CONSTRAINT c2_elements,
        name            CHAR(20) NOT NULL UNIQUE CONSTRAINT c3_elements,
        atomic_weight   DECIMAL(8,4) NOT NULL,
        period          SMALLINT NOT NULL
                        CHECK (period BETWEEN 1 AND 7),
        group           CHAR(2) NOT NULL
                        -- 'L' for Lanthanoids, 'A' for Actinoids
                        CHECK (group IN ('1', '2', 'L', 'A', '3', '4', '5', '6',
                                         '7', '8', '9', '10', '11', '12', '13',
                                         '14', '15', '16', '17', '18')),
        stable          CHAR(1) DEFAULT 'Y' NOT NULL
                        CHECK (stable IN ('Y', 'N'))
    );
    

    Each of the columns Symbol, Name and Atomic_Number is a perfectly good candidate key. I chose to use Atomic_Number as the primary key (most useful for isotopes and nuclear physics), but if I was more concerned with chemistry, then Symbol would be a better choice.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.