SQL Joins

Highlighted
Padawan

SQL Joins

Hello Forum,

 

I'm just trying to familiarize myself with the PS table structures. I'm using Oracle SQL Developer 3.2.20.10. 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')
and
a.entrydate >= '12-aug-19'
and a.enroll_status = '0'
and
a.schoolid ='101'
and
b.course_number = '22222222'

1 Reply
Highlighted
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 19.11.2.1