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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:09:54+00:00 2026-05-20T17:09:54+00:00

Database Tables ss_merchant +—————-+————–+——+—–+———+—————-+ | Field | Type | Null | Key | Default

  • 0

Database Tables

ss_merchant

+----------------+--------------+------+-----+---------+----------------+
| Field          | Type         | Null | Key | Default | Extra          |
+----------------+--------------+------+-----+---------+----------------+
| pk_merchant_id | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| name           | varchar(45)  | YES  |     | NULL    |                |
| website        | varchar(100) | YES  |     | NULL    |                |
+----------------+--------------+------+-----+---------+----------------+

ss_merchant_store

+----------------------+-------------+------+-----+---------+----------------+
| Field                | Type        | Null | Key | Default | Extra          |
+----------------------+-------------+------+-----+---------+----------------+
| pk_merchant_store_id | bigint(20)  | NO   | PRI | NULL    | auto_increment |
| fk_pk_merchant_id    | bigint(20)  | YES  |     | NULL    |                |
| street               | varchar(20) | YES  |     | NULL    |                |
| city                 | varchar(20) | YES  |     | NULL    |                |
| postcode             | varchar(8)  | YES  |     | NULL    |                |
| telephone            | varchar(15) | YES  |     | NULL    |                |
| email                | varchar(45) | YES  |     | NULL    |                |
+----------------------+-------------+------+-----+---------+----------------+

ss_merchant_store_rating

+-----------------------------+------------+------+-----+---------+----------------+
| Field                       | Type       | Null | Key | Default | Extra          |
+-----------------------------+------------+------+-----+---------+----------------+
| pk_merchant_store_rating_id | bigint(20) | NO   | PRI | NULL    | auto_increment |
| fk_pk_merchant_store_id     | bigint(20) | NO   |     | NULL    |                |
| rating                      | int(1)     | YES  |     | NULL    |                |
+-----------------------------+------------+------+-----+---------+----------------+

and my query:

SELECT *  
FROM ss_merchant 
JOIN ss_merchant_stores 
ON ss_merchant.pk_merchant_id = ss_merchant_stores.fk_pk_merchant_id 
JOIN ss_merchant_store_rating 
ON ss_merchant_stores.pk_merchant_store_id = ss_merchant_store_rating.fk_pk_merchant_store_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-20T17:09:54+00:00Added an answer on May 20, 2026 at 5:09 pm

    There isn’t anything specifically wrong with your join but it does make the assumption that all three tables have at least one row for each merchant_id. If you want to allow for non-existant merchant_store_rating rows consider using a LEFT JOIN

    If there is no matching row for the
    right table in the ON or USING part in
    a LEFT JOIN, a row with all columns
    set to NULL is used for the right
    table. You can use this fact to find
    rows in a table that have no
    counterpart in another table:

    SELECT left_tbl.*   FROM left_tbl LEFT JOIN right_tbl 
    ON left_tbl.id = right_tbl.id   WHERE right_tbl.id IS NULL; 
    

    This example finds all rows in
    left_tbl with an id value that is not
    present in right_tbl (that is, all
    rows in left_tbl with no corresponding
    row in right_tbl). This assumes that
    right_tbl.id is declared NOT NULL.

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

Sidebar

Related Questions

I have designed database tables (normalised, on an MS SQL server) and created a
DDL for Database Tables: Users: id - int - identity name - varchar -
If I have a collection of database tables (in an Access file, for example)
I need a simple app to edit database tables. Are there any code generators
Does anyone know a way to auto-generate database tables for a given class? I'm
In the past I've never been a fan of using triggers on database tables.
I'm working on trying to generate a report from a couple of database tables.
One of the core fields present on several of my app's major database tables
I have a Linux web server and I'd like to make some database tables
i have in the database typical tables like user, usergroup, and they have relations.

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.