locked
Database table interconnection RRS feed

  • Question

  • User-1557173817 posted

    Hello, am build a school portal system and created a table for the students with details, another thing is to create another table to store their result details but am wondering how to go about linking each student to respective result with their name appearing on the result.  any help

    Thursday, October 15, 2015 11:29 AM

Answers

All replies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 15, 2015 10:18 PM
  • User-166373564 posted

    Hi Dan,

    As suggested above, you can use SQL JOIN to combine rows from two or more tables, based on  a common field between them.

    With regards,

    Angie

    Monday, October 26, 2015 5:25 AM
  • User-1557173817 posted

    Thanks....Any example to do that with webmatrix syntax will help

    Monday, October 26, 2015 5:47 AM
  • User379720387 posted

    var clientsatlocation = db.Query("SELECT * FROM Clients c JOIN Locations l ON c.locationId = l.locationid WHERE LocationId=@0", locationid);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 26, 2015 8:22 AM