• No results found

Understanding Data Schema Using Pass-Through SQL Queries

N/A
N/A
Protected

Academic year: 2021

Share "Understanding Data Schema Using Pass-Through SQL Queries"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

Understanding Data Schema Using

Pass-Through SQL Queries

Peter Yustat

(3)

Agenda

• What is a Pass Through?

• Infinite Campus Schema

• Getting started

• Basic SQL

• Creating pass-through SQL queries

• Examples

• Census

• Curriculum • Grading

(4)

What are Pass-Through Queries?

• Ad Hoc Reporting tool that uses SQL

• Accesses Infinite Campus tables and views

• Student & Course Information is school specific (you must have a school chosen in your calendar drop down). NOTE: Census/Staff info is not specific to a school.

• Returns lists of students, people, or courses with pre-defined information.

• Student type returns grade: Last Name, First Name, Student Number

• Census/Staff: Last Name, First Name

(5)

Background – Relational Databases

Relational Database: Multiple

tables with records tied together by key fields called Primary Keys

1

1 1

• Some commonly used Campus key fields

• calendarID • personID • courseID • sectionID

(6)

What are the Advantages?

• Powerful and flexible • Highly Customizable • Can be shared

• Accesses the entire Infinite Campus Schema

• Best way to build cohort-based, longitudinal filters • Requires knowledge of SQL

(7)

Ad Hoc Filter Types

Selection Editor

• Set list

• Query Wizard

• Dynamic List based on selected criteria

• Pass Through Filter

(8)

Setting Expectations

• What do you expect to see in your results • Do you know where the data is?

• Can you build the SQL?

(9)

Pass-Through Fundamentals

• It all starts with the Student View

(10)
(11)

The beginning part of the query is already written (Select DISTINCT...)

In the Text box below the SELECT statement you can join to other tables.

The WHERE clause is a condition that will give you all students. You may filter further by adding more such as:

Box A: continues the

Select Statement Box B: Specifies conditions 1 2 3 1 2 3

Query Editor

(12)

Pass-Through Parameters

• IS NULL (not blank – there is a Null in the filed)

• IS NOT NULL (there is data in the field)

• =, <>, >=, <= (Mathematical operations)

• BETWEEN (dates, numeric fields, alpha fields)

• LIKE (uses % as a wildcard)

(13)

SELECT – retrieves information from a Database and MUST have a

FROM. An * will return all columns of data.

FROM – names the table you are retrieving information from. WHERE – (Filter) conditionally limits your results (result set).

IN( ) – allows multiple values in a WHERE statement

ORDER BY – (Sort) sorts in ascending order the column chosen. AND & OR – filters by more than one condition.

DISTINCT – used in the SELECT statement it returns ONLY

different values.

(14)

JOINS

INNER JOIN

• commonly used

• Returns rows that match both tables

Joins are used to reference additional tables in a query, based on a condition or column that both tables have in common.

c d

c d

LEFT OUTER JOIN

• Allows a check for unmatched records

(15)

Census Tips

Contact

• Contact table refers to individual contact information • Email, cellphone, contact language

Relationships

• RelatedPair table links personID1 with personID2 • Guardian, Messenger, Portal Flags

• StartDates and EndDates

Households

• HouseholdMember table links on personID • StartDates and EndDates

(16)

Let’s Begin

• Access Interchange1

-https://training.ccsappservices.com/campusTraining/ny1.jsp

• User – Interchange • Password – ICny2016

(17)

Students without Guardians

Box A

LEFT OUTER JOIN RelatedPair rp ON rp.personID1 = student.personID AND rp.guardian = 1

Box B

(18)

Use your new Filter

• Once the Filter is complete, you can access record set • Share with other Campus Users

(19)

Individuals in Multiple Households

INNER JOIN householdMember hm on individual.personID = hm.personid

and hm.enddate is null

group by individual.personid, individual.lastname, individual.firstname having count(*) > 1

Box B Box A

(20)

Student Emails

Box A

Inner join Contact c on student.personid = c.personid

Box B

(21)

Curriculum Tips

Courses

• Trial – locate active calendar

• Course – Course information, linked to calendar • Section – linked to courseID

• Roster – Linked to sectionID

(22)

Courses without Sections

Box A

LEFT OUTER JOIN [Section] s ON s.courseID = course.courseID LEFT OUTER JOIN Trial tr on tr.trialID = s.trialID AND tr.active = 1

Box B

AND s.sectionID IS NULL AND course.active = 1

(23)

Grading Tips

GradingTaskCredit

• Courses grading setup table

Grading Scores

• V_GradingDetail view pulls all grading score and grading standard tables and links personID, courseID…

GPA

• V_TermGPA – view calculates termGPA by personID, term, calendarID

Transcript

(24)

Grading Task Scores

Box A

inner join v_gradingDetail gd on gd.personid = student.personID

Box B

and gd.task = 'Quarter Grade' and score > '95'

(25)

Courses without Grading Tasks

LEFT OUTER JOIN gradingtaskcredit gtc ON gtc.courseID = course.courseID AND gtc.calendarID = course.calendarID

AND gtc.taskCreditID IS NULL

Box B Box A

(26)

Honor Roll

Box A

LEFT OUTER JOIN [dbo].[v_termGPA] GPA on student.personid = GPA.personid

and student.calendarid = gpa.calendarid

Box B

(27)

Custom Data

Box A

inner join CustomStudent cs on student.personID = cs.personID inner join CampusAttribute ca on cs.attributeid = ca.attributeid

Box B

AND ca.element = 'MailRC' and cs.value = '1'

(28)

12th Graders with less than 20 credits

Box A

INNER JOIN v_transcriptdetail v on v.personID = student.personID

Box B

AND student.grade = '12'

GROUP BY student.personID, student.lastName, student.firstName,

student.grade, student.studentNumber

(29)

Testing Your Queries

(30)

Data Viewer

• Turn your Ad-Hoc into a Report • Export and Share

(31)

Tips

• Learn SQL (Transact-SQL) • Alias your tables

• Explore and Understand the Schema • Test your results

• Store your Pass Through Filters together • Build on your successes

(32)

Two Truths and a Lie

Peter Yustat

• #p12_a1 – I once had a beer with Paul McCartney

• #p12_a2 – I met my wife when I was 12

• #p12_a3 – I have hugged the Stanley Cup - twice

Send a direct tweet of the Lie to @2016icnycgame Sample Tweet: @2016icnycgame #p12_a1

(33)

Keep learning!

• From Custom Computer Specialists, Inc. • Online Resources

• http://www.w3schools.com/sql/

https://www.khanacademy.org/computing/computer-programming/sql

• https://msdn.microsoft.com/en-us/library/bb510741.aspx

To request a training class contact

References

Related documents

You will be granted to python in an expiration time you are user in python sql create schema test_schema owned by creating dbo schema example is unoptimized queries as tables..

You update our database tables sql query lists all the schema view the data rows in operator, software tools for objects that you are database.. Ms sql script you have rectangular

The Chair will have the discretion to permit a student to advance to the diploma from certificate or from a diploma to advanced diploma level of their program even if the conditions

on the Ohio dataset show that our method retrieves 99% of the objects in the detection step, 78% of connected objects are correctly segmented, and 82% of correctly segmented ones

Critical levels and associated error rates were estimated for each sampling dates for the following plant and soil N indicators: (i) petiole NO 3 -N concentrations (dry weight basis),

schema diagram to create materialized view of schemas, created for an entity framework works for table data stored in tables.. Selected Tables In Sql Developer featured under How

The range extends from a comprehensive portfolio of telematics solutions for driver, vehicle and transport management, to financing, vehicle rental, servicing and ensuring

Specify multiple methods, sql drop everything and sql delete based on its unique key used for closing this will assume no schema.. DROP TABLE emp;