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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:40:11+00:00 2026-05-25T12:40:11+00:00

Hello I am making a reservation system and I am having troubles with my

  • 0

Hello I am making a reservation system and I am having troubles with my table can someone help me with my problem.
I have a table customer and a table reservation.
My customer table handles all the customers personal info and the reservation handles the reservation details.

My customer table has a customer ID which is a primary key and auto increment. and
my reservation table has a reservation ID which is a primary key and auto increment.

MY PROBLEM IS… How could I connect the two?

I have a big problem on how to join them in my select statement because I dont know what values will I join.

*Note: Btw, I’m using c# winform and I seperated the add customer and add reservation details. I am also wondering if I can include the 2 insert statement in one button or add them seperately..

  • 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-25T12:40:12+00:00Added an answer on May 25, 2026 at 12:40 pm

    Use the SQL JOIN statement in your SELECT QUERY:

    SELECT c.CustomerName, r.ReservationTime
    FROM reservation r
    JOIN customer c ON r.CustomerId = c.CustomerId
    

    Edit: It sounds like you are having trouble understanding how to get a newly created CustomerId in order to include it in the Reservation table. The key here is LAST_INSERT_ID(). After your insert into Customer, get the value from LAST_INSERT_ID() – that is the newly created CustomerId. You can then use that value when you insert into Reservation. Eg:

    INSERT INTO Customer (CustomerName)
    VALUES ('Joe Schmoe');
    
    INSERT INTO Reservation (ReservationTime, CustomerId)
    VALUES ('2011-09-12 18:30:00', LAST_INSERT_ID());
    

    Pardon syntax errors – SQL Server is my primary language, if you hadn’t gathered that already.

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

Sidebar

Related Questions

Hello I am having a hard time making this UI element look the way
Hello I have a table on which I have denied SELECT privs to a
Hello i want to know if i can download my app before making it
First of all, Hello everyone(/world) ! I am making an Eclipse RCP app' who
Hello i am making grid menu for activity , all things are working well
Hello guys i'm making a little app in which i need to enumerate all
Hello I'm having problems making an inner join in access. Could somebody correct my
I have installed android tools and eclipse successfully (making the hello World and hello
Just a question on making good html. Say I have a header. <h1>Header</h1> <p>Hello,
Hello I have a tool tip I am making with jquery, that loads the

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.