Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,759 members, 7,817,094 topics. Date: Saturday, 04 May 2024 at 05:12 AM

Help Joining These Tables - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Help Joining These Tables (327 Views)

How To Arrange School Broadsheet Sheet From Mysql Tables / Nairaland Uses Tables!! / How To Add Up Tables Using Php (2) (3) (4)

(1) (Reply) (Go Down)

Help Joining These Tables by walterjnr(m): 6:32pm On Feb 10, 2021
Hello Dev,
Please help me with sql code to achieve the third table i.e transaction record using tblcustomer and tbltransaction table

Image below

Re: Help Joining These Tables by Thenaijaitguy: 8:27pm On Feb 10, 2021
SELECT customer.Fullname AS CustomerName, transaction.Operation AS TypeOfOperation, transaction.Amount
FROM transaction
INNER JOIN customer ON customer.ID = transaction.ID



That's the SQL query. I also attached screen shot

1 Like

Re: Help Joining These Tables by walterjnr(m): 10:03pm On Feb 10, 2021
God bless You

will implement.
Thenaijaitguy:
SELECT customer.Fullname AS CustomerName, transaction.Operation AS TypeOfOperation, transaction.Amount
FROM transaction
INNER JOIN customer ON customer.ID = transaction.ID



That's the SQL query. I also attached screen shot
Re: Help Joining These Tables by walterjnr(m): 10:29pm On Feb 10, 2021
Thenaijaitguy:
SELECT customer.Fullname AS CustomerName, transaction.Operation AS TypeOfOperation, transaction.Amount
FROM transaction
INNER JOIN customer ON customer.ID = transaction.ID



That's the SQL query. I also attached screen shot

Re: Help Joining These Tables by Thenaijaitguy: 10:36pm On Feb 10, 2021
In a real system, a guest can not perform transaction. Except if you have Another table named quest .then you can joint it also.

1 Like

Re: Help Joining These Tables by Felixitie(m): 10:41pm On Feb 10, 2021
Instead,try use right join.
Re: Help Joining These Tables by nnamdiosu(m): 10:41am On Feb 11, 2021
[quote author=walterjnr post=98947008][/quote]


Bro,
1. You see that second table that you have a column called customer name, and instead you are putting customer id (2,1) and you still added a string called guest, it's very very wrong.

That place should be cudtomer_id and only the id of customers in the first table should be in that second table column.

2. A guest can't ever make a transaction. Everyone must be registered to have an id that will be in that second table column called customer name.


3. Also for safety and clarifications don't write deposited or withdrawal as a transaction type. Instead reference with with either 1 or 2.

It appears you are a newbie into programming? Well done...just continue practising you'll surely get there.

Cheers

1 Like

(1) (Reply)

IOS App Attest API: Improved Security For IOS 14 / Teacher And Mentor On Python / Static And Dynamic Website: What Is The Difference?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.