Home » SQL & PL/SQL » SQL & PL/SQL » Login table connection to another table. (Oracle 10g)
Login table connection to another table. [message #674105] Fri, 04 January 2019 00:47 Go to next message
Danny Freeman
Messages: 21
Registered: December 2015
Location: UK
Junior Member
Was wondering if you could just guide me in this. I don't want an answer, I want to do it my own. Just a little guidance.

I have two tables.

I have two tables one for login details and the other which has details regarding the user purchases, how to connect the primary key of login table to a foreign key of user purchases.

So I read that we can use primary key and foreign key but I was wondering if you could just have one Id in both and then compare them.
Re: Login table connection to another table. [message #674106 is a reply to message #674105] Fri, 04 January 2019 00:57 Go to previous messageGo to next message
Michel Cadot
Messages: 67134
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Usually you have one Id for each user and one Id for each purchase and one column in purchases table which refers to user id in users table.

Re: Login table connection to another table. [message #674108 is a reply to message #674106] Fri, 04 January 2019 01:01 Go to previous messageGo to next message
Danny Freeman
Messages: 21
Registered: December 2015
Location: UK
Junior Member
Thank you so much
Re: Login table connection to another table. [message #674110 is a reply to message #674105] Fri, 04 January 2019 01:46 Go to previous messageGo to next message
John Watson
Messages: 8268
Registered: January 2010
Location: Global Village
Senior Member
Consider the EMP and DEPT tables in the SCOTT demo schema. I'll attach the script that creates them, you'll see how it is done using DEPTNO as the join column.

  • Attachment: utlsampl.sql
    (Size: 3.69KB, Downloaded 216 times)
Re: Login table connection to another table. [message #674116 is a reply to message #674110] Fri, 04 January 2019 05:43 Go to previous message
Danny Freeman
Messages: 21
Registered: December 2015
Location: UK
Junior Member
Thank you for your help Smile
Previous Topic: Regarding Updatable view - Please assist
Next Topic: What does @! mean in SQL?
Goto Forum:
  


Current Time: Thu May 28 03:33:36 CDT 2020