Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith...

25
2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used data structures in the PowerSchool database, an Oracle relational database. Understanding the data structures allow the user to more efficiently gather student information. Content includes identifying the North Carolina data structures and their relationship to the core PowerSchool structures.

Transcript of Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith...

Page 1: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

1

Data Structure inPowerSchool

Derrick SmithMark Hausner

Data Structure inPowerSchool

This lab introduces the most commonly used datastructures in the PowerSchool database, an Oraclerelational database.

Understanding the data structures allow the user to moreefficiently gather student information. Content includesidentifying the North Carolina data structures and theirrelationship to the core PowerSchool structures.

Page 2: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

2

Where to find lab information? PowerSchool Data Dictionary

https://powersource.pearsonschoolsystems.com/article/72521

The NC Extended Schema data dictionaryhttp://www.nc-sis.org/documents/requirements/PS_NC_Extended_Schema_Data_Dictionary.pdf

Lab PresentationCLASS WEBSITE

Extended Schema Cluster Reference DocumentCLASS WEBSITE

Other related Symposium presentations

Getting To Know Your SQL4 Reports

Intro to SQL

Manipulating Data Using Excel

PowerSchool DB BasicsMost PowerSchool DB Tables usually have a primary key

column that is called DCID.

Most PowerSchool DB Tables usually also have another unique column that is like a primary called ID.

Some other major tables have other columns that are greatly used for referencing (eg. Students.student_number,

schools.school_number) A lot of tables have foreign keys that reference a parent table ‘parentname’ID (eg. Studentid, sectionid …). Be aware that

schoolid is different schoolid = schools.school_number

Page 3: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

3

Basics Summarized

1. You should join table first by DCID.2. If no DCID foreign key exist then join by ID.3. If neither DCID or ID foreign keys exist

then you use one of the special columns like student_number or school_number.

Now onto the NC Extended Schema

The North Carolina extended schema is a set of tables in the PowerSchool DB that where designed especially for us. It is

created in two primary parts.

Part 1. The reporting part, which we won’t talk much about. If you want more info go to the Getting To Know Your SQL4Reports class or download thepresentation.

Part 2. The extra data part, which is furtherdivided into areas of interest orclusters. Please see the class document

Extended Schema Cluster Reference Documentwhich is full of great info explaining this area.

Let’s take a quick peek at this

Page 4: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

4

In Field List

can be used for filtering or selecting fields in and export.

Page 5: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

5

Quick Export

Page 6: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

6

Page 7: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

7

Page 8: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

8

Data Export Manager

Special Functions > Importing & Exporting

Page 9: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

9

Page 10: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

10

Go to DownloadsS_NC_GUARDIAN_Export.txtShould be there waiting for you!

SQL 4 Reports

Page 11: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

11

Page 12: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

12

Extended Schema DB BasicsCore Extension Tables usually have a primary key column named ‘parent’DCID (eg. STUDENTSDCID) with a 1to1

relationship.

Child Tables usually have a primary key column named ID with a foreign key named ‘parent’DCID (eg.

STUDENTSDCID) with a 1to many relationship.

Other tables which are in various other states. Some have no relationship at all, others are related to a core table by one or

more ID or special columns and some are related to other extended schema tables.

Page 13: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

13

Core Extension Table Query

select st.first_name, st.last_name,dem.country_of_birth_codefrom ps.s_nc_studentdemo dem, ps.students stWhere dem.studentsdcid = st.dcid

Who knows what that number in the country_of_birth_code column is/means?

Which leads us to a table you will need to know about if you plan on querying the DB the GEN

table!

The GEN TableI heard it got it’s name because it was created

as a general purpose table!

The one purpose that I use it for is codes…It is not easy to use or even consistent. But

once you get used to it, it is functional.I use this query to get me started:

select distinct cat from ps.gen order by 1

Page 14: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

14

This query will give you something like:

.

.

.codedefs

contact_prefixcontact_typescountry_codescourse_lengthscoursegroups

cte_level...

Using this new information with our original query we can find all of the students who were born outside of the United States with a query

like:

select st.first_name, st.last_name, gen.value "Country of Birth"from ps.s_nc_studentdemo dem, ps.gen, ps.students stwheredem.country_of_birth_code = gen.name andgen.cat = 'country_codes' andgen.value <> 'United States of America' anddem.studentsdcid = st.dcid

Another GEN query on steroids

select co.COURSE_NAME, co.COURSE_NUMBER, ep.VALUE "External Provider", tp.VALUE "Third Party Provider", dm.VALUE "Delivery Mode", ht.VALUE "How Taken", cl.VALUE "Course Length"

from ps.s_nc_courseinfo ciinner join ps.courses co

on ci.COURSESDCID = co.DCIDleft outer join ps.gen ep

on ci.COURSE_EXTERNAL_PROVIDER = ep.NAME and ep.CAT = 'external_prov'left outer join ps.gen tp

on ci.COURSE_THIRDPARTY_PROVIDER = tp.NAME and tp.CAT = 'thirdparty_prov'left outer join ps.gen dm

on ci.DELIVERY_MODE = dm.NAME and dm.CAT = 'delivery_mode'left outer join ps.gen ht

on ci.HOW_TAKEN_CODE = ht.NAME and ht.CAT = 'how_taken'left outer join ps.gen cl

on ci.COURSE_LENGTH_CODE = cl.NAME and cl.CAT = 'course_lengths'

Page 15: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

15

Another GEN query where they use value2

select st.first_name, st.last_name, gen.value "ADM Code", gen.value2 "ADM Desc"from ps.s_nc_studentinfo inf, ps.gen, ps.students stwhereinf.admission_status_code = gen.name andgen.cat = 'admission_stat' andinf.studentsdcid = st.dcid

Child Table Queriesselect st.first_name, st.last_name, aig.school_name, aig.start_date, aig.end_date,aig.aig_exceptionality_am, aig.aig_exceptionality_ar, aig.aig_exceptionality_igfrom ps.s_nc_aig aig, ps.students stWhere aig.studentsdcid = st.dcid;

select st.first_name, st.last_name, gen.value "Test", eat.test_grade_rangefrom ps.s_nc_ec_accommodations_test eat, ps.students st, ps.genwhereeat.studentsdcid = st.dcid andeat.test_code = gen.name andgen.cat = 'test_code‘;

Other Queriesselect st.first_name, st.last_name, gen.value "Test", eat.test_grade_range,gen2.value "Accomodation", eac.accommodation_commentfrom ps.s_nc_ec_accommodations_test eat, ps.students st, ps.gen,ps.s_nc_ec_accommodations_comment eac, ps.gen gen2whereeat.studentsdcid = st.dcid andeat.test_code = gen.name andgen.cat = 'test_code' andeat.id = eac.s_nc_ec_accommodations_testid andeac.accommodation_code = gen2.name andgen2.cat = 'accomm_code'

Page 16: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

16

Other QueriesMost of the ‘code’ tables are for internal use but here is one that you might use.

select st.first_name, st.last_name, isc.description "Immigrant Year"from ps.s_nc_imm_immigrant_data iid, ps.s_nc_imm_system_codes isc, ps.students stwhereiid.imm_year_id = isc.code andisc.area = 'Immigrant Year' andiid.studentsdcid = st.dcid

One More QueryFind all test’s that are marked to not show up on transcript.

select st.first_name, st.last_name, aca.grade_9_entry_date, stt.test_date, tst.description,act.accommodation_enabledfrom ps.students stinner join ps.s_nc_academic aca on aca.studentsdcid = st.dcidinner join ps.studenttest stt on st.id = stt.studentidinner join ps.s_nc_academic_studenttest ast on ast.studenttestdcid = stt.dcidinner join ps.test tst on stt.testid = tst.idleft outer join ps.s_nc_academic_test act on act.testdcid = tst.dcidwhereast.show_on_transcript = 'N'

Viewing Extended data from powerschool

Page 17: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

17

S_NC_STUDENTINFO

Page 18: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

18

Scroll down towards bottom of screen

S_NC_ACADEMIC

Page 19: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

19

S_NC_REENROLLMENTS

S_NC_STOREDGRADES

Page 20: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

20

Scroll down towards bottom of screen

CTE Course   VocationalLocal Use   Academic_Level_code

S_NC_COURSEINFO

Go back to main screen

Page 21: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

21

Scroll down towards bottom of screen

S_NC_SECTIONINFO

Page 22: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

22

Scroll down towards bottom of screen

S_NC_SCHOOLINFO

Page 23: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

23

Page 24: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

24

Scroll down to Extended Data Section

Most of this data comes from Educational Directory and

Demographical Information Exchange

Questions?

Page 25: Data Structure in PowerSchool - ncsis · 2/12/2015 1 Data Structure in PowerSchool Derrick Smith Mark Hausner Data Structure in PowerSchool This lab introduces the most commonly used

2/12/2015

25