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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:31:48+00:00 2026-05-24T03:31:48+00:00

I am about to begin my Data Auditing section of my site. What does

  • 0

I am about to begin my “Data Auditing” section of my site. What does that mean?

Well basically users can view and update records they have submitted to the database.

This is my first time doing this and I am guessing I will need to use Joins, Selects? etc.

So I was wondering if you could help me with the logic on how I will work through this query. I don’t want code as I want to do it myself but the logic is what is bothering me.

Here is an image of my Database schema showing relationships etc:

enter image description here
https://i.stack.imgur.com/zSHSQ.png

This is what I have thought how to start (pseudocode):

-Get procedure row where procedure_id = posted value from previous
page.

-Retrieve values from that row in procedure table.

-Get patient row that matches the foreign key value in procedure table.

-Get department row that matches the foreign key value in procedure table.

-Get procedure_name row that matches the foreign key value in procedure table.

-Get dosage row that matches the foreign key value in procedure table.

However after this point I am a bit stuck on how I deal with the Many-to-Many (n–> n) relationship tables , is this where a join comes in?

What about my linking tables how do I tackle them?

If there is an easier way of doing this than what I have thought could you please tell me 🙂

Links to resources or examples would be much appreciated. Thanks in advance

Thankyou

Take Care!

  • 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-24T03:31:49+00:00Added an answer on May 24, 2026 at 3:31 am

    This is the query for your pseudocode:

    SELECT
      procedure.*,
      patient.*,
      department.*,
      procedure_name.*,
      dosage.*
    FROM
      procedure
    INNER JOIN
      patient
    ON
      patient.patient_id = procedure.patient_id
    INNER JOIN
      department
    ON
      department.department_id = procedure.department_id
    INNER JOIN
      procedure_name
    ON
      procedure_name.procedure_name_id = procedure.name_id
    INNER JOIN
      dosage
    ON
      dosage.dosage_id = procedure.dosage_id
    WHERE
      procedure.procedure_id = ?
    

    You can join any of your other tables exactly the same way. If you want rows back even if the table you’re joining has no matching rows to the rows from the rest of the query, use a LEFT OUTER JOIN instead of an INNER JOIN. Where there are multiple rows matching the current rows (1:N/N:M) you will get as many rows as there are pairs in your result set.

    If you need additional guidance/examples you’ll have to be more clear about what you want to retrieve and what you don’t understand.

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

Sidebar

Related Questions

I'd like to begin thinking about how I can scale up my algorithms that
I can't even begin to think about how this would be done. Basically, imagine
I am about to begin writing a Rails application that will allow clients to
I'm about to start an iOS project that requires pulling user's data from an
I'm about to begin work on translating client's website into spanish and french and
Possible Duplicate: iPhone development on Windows We are about to begin our first med-tech
My question concerns Google Web Toolkit (GWT). I'm about to begin development for a
To begin with, I don't know the first thing about Python ... so I
I'm about to begin work on my first ever PHP project -- building a
I was asking b4 about swapping query to swap data between rows in same

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.