Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Cross reference multiple tables in SQL

$
0
0

Hi, I need to write a query that will cross reference multiple tables and output the results 


So I would like to get the values of the table RATINGS. Currently this would output the values

1,1,2,1,1,1

2,2,2,1,3,2

3,2,2,2,2,3

Whereas what I would like it to include is the values from the relevant tables incorporated into the output.

rated_id & rater_id from the users table
round_id from the rounds table
skill_id from the skills table

1,ben,john,Apple,walking,1

2,john,john,Apple,sleeping,2

3,david,john,Orange,standing,3

----------------------------------------------------------

ratings
IDrated_idrater_idround_idSkill_idrating
 1 1 2 1 1 1
 2 2 2 1 3 2
 3 2 2 2 2 3

users
IDnameemail


 1 ben ben@email.com   
 2john  john@email.com   
 3 david david@email.com  

 

rounds
IDtitletype


 1 applefruit    
 2 orange fruit   
 3 pear fruit   

skills
IDtitle



 1 walking    
 2 standing    
 3 sleeping    




Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>