Getting started with SQL Queries and Programming Jeremy Brinkman Assistant VP for Information Technology University of Northwestern Ohio.

Slides:



Advertisements
Similar presentations
Database Relationships in Access As you recall, the data in a database is stored in tables. In a relational database like Access, you can have multiple.
Advertisements

SQL/PL SQL Oracle By Rana Umer. Quiz 2 Q1.Create a table called "Persons" that contains five columns: PersonID, LastName, FirstName, Address, and City.
Chapter 4 Joining Multiple Tables
Ashley Ohmann June 20, * What is Custom SQL? * What can I do with it? * Join conditions * Unions and Self Joins * Ranks * Derived Tables.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
UniData to SQL Conversion Don’t lose your Informer investment…
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
Reporting Panel – ODS / Informer / SQL Server Reporting Services Jeremy Brinkman, University of Northwestern Ohio Alan Crowley, Alma College Jonathan Martindell,
Some Introductory Programming 1. Structured Query Language (SQL) - used for queries. - a standard database product. 2. Visual Basic for Applications -
The Use of Microsoft based Technologies for the benefit of the Community Prof. Avi Mendelson – Microsoft & Technion - Taub 643.
Concepts of Database Management Sixth Edition
Utility Service Database Design a database to keep track of service calls for a utility company: Customers call to report problems Call center manages.
Inner join, self join and Outer join Sen Zhang. Joining data together is one of the most significant strengths of a relational database. A join is a query.
Some Introductory Programming 1. Structured Query Language - used for queries. - a standard database product. 2. Visual Basic for Applications - use of.
Introduction to Information and Computer Science Databases and SQL Lecture b This material (Comp4_Unit6b) was developed by Oregon Health & Science University,
Microsoft Access 2007 Microsoft Access 2007 Introduction to Database Programs.
Jeremy Brinkman Director of Administrative Systems University of Northwestern Ohio Great Lakes Users’ Group Conference August 10-11,
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
Insert Presentation Title Heremm.dd.yy, City, ST SQL Reporting Services – Building the Report Kevin Ford Services Consaultant Accela, Inc.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
Chapter 15: Using LINQ to Access Data in C# Programs.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
Chapter 9 Joining Data from Multiple Tables
102 VISTA VIEWS REPORT BUILDING PowerCampus Version
1 Agenda – 03/25/2014 Login to SQL Server 2012 Management Studio. Answer questions about HW#7 – display answers. Exam is 4/1/2014. It will be in the lab.
Using SAS® Information Map Studio
1 Definition of a subquery Nested subqueries Correlated subqueries The ISNULL function Derived tables The EXISTS operator Mixing data types: CAST & CONVERT.
Software. Records Fields Each record is made up of fields – categories of information. The fields here are Name, Surname, Address, Telephone and Date.
1 Intro to JOINs SQL INNER JOIN SQL OUTER JOIN SQL FULL JOIN SQL CROSS JOIN Intro to VIEWs Simple VIEWs Considerations about VIEWs VIEWs as filters ALTER.
Relational Databases Database Driven Applications Retrieving Data Changing Data Analysing Data What is a DBMS An application that holds the data manages.
Introduction to SQL Server JOINS © Meganadha Reddy K., Meganadha Reddy K. Technical Trainer | NetCom Learning
Using Special Operators (LIKE and IN)
CIS 338: Using Queries in Access as a RecordSource Dr. Ralph D. Westfall May, 2011.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
Database Development Tr ươ ng Quý Quỳnh. References UDEMY: SQL Database MasterClass: Go From Pupil To Master! Database Systems - A Practical Approach.
Chapter 4Introduction to Oracle9i: SQL1 Chapter 4 Joining Multiple Tables.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
Intro to SQL Management Studio. Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your.
SQL 101 – Class 1 Lee Turner. Agenda 1. This is your life – SQL A brief history of SQL What SQL is and what it is not Normalization 2. Some Super Simple.
Programming in R SQL in R. Running SQL in R In this session I will show you how to: Run basic SQL commands within R.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
(SQL - Structured Query Language)
A Guide to SQL, Eighth Edition Chapter Five Multiple-Table Queries.
INFANL01-3 ANALYSE 3 WEEK 3 March 2015 Institute voor Communication, Media en Informatietechnology.
Manipulating Data Lesson 3. Objectives Queries The SELECT query to retrieve or extract data from one table, how to retrieve or extract data by using.
Database Overview What is a database? What types of databases are there? How are databases more powerful than spreadsheets?
Creating Saved List Queries in the Financial Aid Module Session 5003 Monday, April 6, By Eric Mayo Lead Consultant Datatel, Inc
DAY 7: ACCESS Rahul Kavi March 29,
Understanding the Architecture of Colleague FA. Types of Files in Financial Aid 3 Types of files for data about the student as a recipient of financial.
Jacksonville SQL Saturday May 9, 2015 Introduction to Power BI.
Select Complex Queries Database Management Fundamentals LESSON 3.1b.
Understanding the Architecture of Colleague FA Bonnie Coffey Financial Aid Developer/Designer, Datatel, Inc Richard F. Lee Lead Systems Analyst, Vermont.
IFS180 Intro. to Data Management Chapter 10 - Unions.
SQL - Training Rajesh Charles. Agenda (Complete Course) Introduction Testing Methodologies Manual Testing Practical Workshop Automation Testing Practical.
Introduction to PL/SQL Programing
SQL Query Joins ASP.Net 2.0 – Visual Studio 2005
Maintain to RDBMS Interaction
Database Management  .
INNER JOIN INNER SPRIDEN SARADAP
SQL Fundamentals in Three Hours
Data Management Innovations 2017 High level overview of DB
C# - EF Core Intro IT College, Andres Käver, , Fall semester
September 12-14, 2018 Raleigh, NC.
SQL Server Fundamentals for Beginners
Use of SQL – The Patricia database
Navigating SSMS Primer for Beginners
Presentation transcript:

Getting started with SQL Queries and Programming Jeremy Brinkman Assistant VP for Information Technology University of Northwestern Ohio

Private, Non-profit Institution Founded in students from all 50 states and 24 foreign countries Five Colleges: College of Applied Technologies, College of Business, College of Occupational Professions, College of Health Professions, Graduate College University of Northwestern Ohio

The SQL developer’s toolbox Locating data in Colleague SQL query fundamentals Presentation Overview

The SQL Developer’s Toolbox

SQL Server Management Studio The SQL Developer’s Toolbox

Colleague Screens – RDEL – RDEP – RFEI – RDSF The SQL Developer’s Toolbox

Colleague Screens Continued – EOFM The SQL Developer’s Toolbox

Simple but effective: browse the data SELECT TOP 10 * FROM TABLE The SQL Developer’s Toolbox

Other useful tools – SQL Server Profiler – Colleague Studio – Red-gate SQL Prompt The SQL Developer’s Toolbox

Locating Data in Colleague

Locating Data on Colleague Screens Field help Form/process help F1

Locating Data on Colleague Screens

Lookup the field on RDEL to get the file name.

Locating Data on Colleague Screens Match the file name from RDEL to the SQL table

Locating Data on Colleague Screens Interpreting RDEL Replace the “.” with “_” to derive the SQL table name from the UniData file name. Data Fields (D) – data can be found inside the table listed in the File Name field. List Fields (L) – Data can be found in the _LS table version of the table in the File Name field. PERSON_LS is one example. Associated Fields (A) – Data can be found in a SQL table named for the association listed on RDEL. X Pointer and Q Pointer Fields – Related data can be found in the Secondary Pointer/File. For X Pointer fields, the pointer exists in the SQL table itself. For Q Pointer fields, the pointer exists in the _LS table.

Locating Data on Colleague Screens Q Pointer example:

Locating Data on Colleague Screens Q Pointer example in SQL Server:

Locating Data on Colleague Screens Associated field example:

Locating Data on Colleague Screens Associated field example in SQL Server:

Locating Data on Colleague Screens Q Pointer + Association example:

Locating Data on Colleague Screens Q Pointer + Association in SQL:

Locating Data on Colleague Screens A few more tips: The POS field is used to store the position of data in multivalued fields or associations. “VAR” fields found on Colleague forms do not represent actual fields in the SQL database. File Suites are often difficult to interpret. In general, when you see “ACYR” in a file, you can replace it with the file suite year.

SQL Query Fundamentals

SELECT FROM WHERE ORDER BY Elements of a basic SQL Query

SELECT PERSON.FIRST_NAME, PERSON.LAST_NAME FROM PERSON WHERE PERSON.LAST_NAME = ‘Flintstone’ ORDER BY PERSON.FIRST_NAME SQL Query Example #1

Coding Tip: Always prefix your field names with a table name or alias. Coding Tip

Using a Computed Column SQL Query Example #2 SELECT PERSON.FIRST_NAME, PERSON.LAST_NAME, dbo.AGE(PERSON.ID) FROM PERSON WHERE PERSON.LAST_NAME = 'Flintstone' ORDER BY PERSON.FIRST_NAME

SELECT FROM INNER JOIN ON = WHERE ORDER BY Let’s Join Another Table

SELECT PERSON.FIRST_NAME, PERSON.LAST_NAME, PERSON_LS.POS, PERSON_LS.PER_ETHNICS FROM PERSON INNER JOIN PERSON_LS ON PERSON_LS.ID = PERSON.ID WHERE PERSON.LAST_NAME = ‘Flintstone’ ORDER BY PERSON.FIRST_NAME SQL Query Example #3

Coding Tip: Keep code clean by using proper indentation. Coding Tip

Most Common Join Types INNER JOIN – Include only records where the join field(s) matches in the left and right table. LEFT OUTER JOIN – Include all records from the left table and only those in the right table that match the join field(s)

SQL Query Example #4 List all addresses for a person SELECT PERSON.FIRST_NAME, PERSON.LAST_NAME, ADDRESS_LS.ADDRESS_LINES, ADDRESS.CITY, ADDRESS.STATE, ADDRESS.ZIP FROM PERSON INNER JOIN PSEASON ON PERSON.ID = PSEASON.ID INNER JOIN ADDRESS ON PSEASON.PERSON_ADDRESSES = ADDRESS.ADDRESS_ID INNER JOIN ADDRESS_LS ON ADDRESS.ADDRESS_ID = ADDRESS_LS.ADDRESS_ID AND ADDRESS_LS.POS = 1 WHERE PERSON.LAST_NAME = 'Flintstone'

Questions?

Contact Information Jeremy Brinkman Assistant VP for Information Technology University of Northwestern Ohio