SQL Joins


SQL Joins

Hello Forum,


I'm just trying to familiarize myself with the PS table structures. I'm using Oracle SQL Developer For learning purposes, I'm trying to pull all High School Students that are enrolled in 8th period Student Prep and have a lunchstatus of Free or Direct Cert. I am using the Students and CC tables with the following query but the results are grossly inaccurate.What tables should I be using and what fields should I be joining on?


select a.student_number, b.studentid, a.last_name, a.first_name, b.course_number, b.expression
from students a
INNER JOIN cc b ON a.student_number = b.studentid
where a.lunchstatus IN ('F', 'FDC')
a.entrydate >= '12-aug-19'
and a.enroll_status = '0'
a.schoolid ='101'
b.course_number = '22222222'

1 Reply
PowerSchool Champion
PowerSchool Champion

Re: SQL Joins

Look in the Data Dictionary.  This is not correct:


INNER JOIN cc b ON a.student_number = b.studentid


This is the relationship:


cc.studentid = students.id

Adam Larsen
Assistant Superintendent, CUSD 220 - Oregon, IL
Principal Developer, Aurora Educational Technology

1450 students, PK-21
Single server, PS