Introduction to SQL and SQL in R. LISA Short Courses Xinran Hu

Size: px
Start display at page:

Download "Introduction to SQL and SQL in R. LISA Short Courses Xinran Hu"

Transcription

1 Introduction to SQL and SQL in R LISA Short Courses Xinran Hu 1

2 Laboratory for Interdisciplinary Statistical Analysis LISA helps VT researchers benefit from the use of Statistics Collaboration: Visit our website to request personalized statistical advice and assistance with: Experimental Design Data Analysis Interpreting Results Grant Proposals Software (R, SAS, JMP, SPSS...) LISA statistical collaborators aim to explain concepts in ways useful for your research. Great advice right now: Meet with LISA before collecting your data. Short Courses: Designed to help graduate students apply statistics in their research Walk-In Consulting: M-F 1-3 PM GLC Video Conference Room; 11 AM-1 PM Old Security Building Room 103 For questions requiring <30 mins All services are FREE for VT researchers. We assist with research not class projects or homework. 2

3 Course Plan Part I. SQL 1. Basic Concepts in SQL 2. Querying From One Table 3. Nested Queries 4. Querying From Multiple Tables Part II. SQL in R 1. sqldf Package 2. Write SQL Command in R 3

4 Why SQL? SQL is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS). (wikipedia) In the era of Big Data, (1) Simple Method + Massive Dataset (2) The time spent on data management often exceeds the time spent on analysis. 4

5 Basic Concepts: Table A Table (or a Relation) is a set of records that have the same attributes. 1. A table always have an unique table name in SQL. Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor 5

6 Basic Concepts: Column A Column ( or Attribute or Field) is a characteristics of objects. 1. A column always have a unique column name within a table. 2. A column is either numeric (age), categorical (gender) or one of the other pre-defined types in SQL, e.g. date. 3. Primary Key: a column that has unique value for each object. Name(PK) Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor 6

7 Basic Concepts: Row A Row ( or a Tuple or Record) is an object represented by a list of attributes. 1. A row always have an unique value in Primary Key. Name(PK) Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor 7

8 Basic SQL Command Example dataset: a world fact dataset (sqlzoo.net) (Table name: world) 8

9 SELECT FROM Function: Selecting one or more columns from a table. Example: SELECT * FROM world SELECT name FROM world SELECT name, gdp FROM world A SQL query always start with a SELECT FROM command. 9

10 DISTINCT Clause Function: Removing duplicate records in query result. Example: SELECT continent FROM world (This query includes duplicate results) SELECT DISTINCT continent FROM world (This query excludes duplicate results) 10

11 LIMIT clause Function: Limiting the number of records returned. Example: SELECT DISTINCT continent FROM world (This query returns all distinct results) SELECT DISTINCT continent FROM world LIMIT 3 (This query returns three distinct results) 11

12 WHERE clause Function: Filtering the records returned by a select command. Example: Filtering based on a numeric attribute SELECT name, area FROM world /* do not forget this line*/ WHERE area = (km^2) WHERE area<> WHERE area > WHERE area < 1 WHERE area IN (0, ) WHERE area BETWEEN AND WHERE area NOT BETWEEN 1 AND

13 WHERE clause (cont.) Example: Filtering based on a categorical attribute. SELECT name, continent FROM world WHERE continent = 'north america' WHERE continent <> 'north america' WHERE continent >'north america' WHERE continent < 'north america' WHERE continent IN ('north america', south america') WHERE continent BETWEEN D AND F WHERE continent NOT BETWEEN D AND F WHERE continent LIKE '%america 13

14 WHERE clause (cont.) Example: Filtering based on two or more conditions. SELECT name, continent FROM world WHERE area> AND area< WHERE continent = 'north america AND area> WHERE continent = 'north america OR area> WHERE (continent = 'north america AND area>500000) OR (continent = south america AND area>500000) 14

15 ORDERED BY clause Function: Sorting the query result by a column. Example: Sort Ascending (Default) SELECT name, area FROM world ORDER BY area (ASC) Sort Descending SELECT name, area FROM world ORDER BY area DESC 15

16 Arithmetic operations SQL permits arithmetic operations on columns. Example: Query GDP: select name, gdp from world order by gdp DESC Query GDP in Trillion: select name, gdp/ from world order by gdp DESC Query GDP per capita select name, gdp/population from world order by gdp/population DESC 16

17 Practice: SQLZOO:SELECT basics Write the SQL queries in the first tutorial. 17

18 Aggregate Functions Function: Producing descriptive statistics of a column. Example: Query the average GDP of the world. SELECT avg(gdp) FROM world More Aggregate Functions: max(), min(), sum(), count(), var(), stdev() Note, max() and min() operates on strings as well. 18

19 GROUP BY Function: Stratifying aggregate result by a categorical column Example: Query the average GDP of each continent. SELECT avg(gdp) FROM world. GROUP BY continent 19

20 HAVING Clause Function: Filtering aggregate results. Example: Find the continent with average country area greater than 1 million. SELECT continent, avg(area) FROM world GROUP BY continent HAVING avg(area)>

21 Nested Query Query result can be used in the where clause of another query. This is referred as Nested Query SELECT name FROM world WHERE population > (SELECT population FROM world WHERE name= Russia') If we run the nested query, we will get , so the above query is equivalent to SELECT name FROM world WHERE population >

22 UNION Command Function: Concatenating two tables vertically Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor Name Gender Age Occupation James Male 23 Student Anna Female 22 Staff Andy Male 45 Professor Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor James Male 23 Student Anna Female 22 Staff Andy Male 45 Professor 22

23 UNION Command Example: SELECT * FROM world WHERE name = Germany UNION SELECT * FROM world WHERE name= France Why is UNION command useful if we can use WHERE clause? Answer: These queries could come from different tables. 23

24 JOIN Command Function: Concatenating two tables horizontally. Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor Name Jessica Michael Emma Department Math Statistics Art Name Gender Age Occupation Department Jessica Female 28 Student Math Michael Male 28 Professor Statistics Emma Female 34 Professor Art 24

25 JOIN Command JOIN is generally more complicated than union because you have to specify a common attribute to link two tables. In the previous example, we joined tables with the name column. If both tables contain a column with the same column name, we should distinguish two columns by attaching the table name in front Table1Name.ColumnName vs Table2Name.ColumnName 25

26 JOIN Command There are four different types of join: (1) INNER JOIN (2) LEFT JOIN (3) RIGHT JOIN (4) FULL OUTER JOIN 26

27 INNER JOIN INNER JOIN produce a record if it exist in BOTH tables Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor Name Jessica John Department Math CS Name Gender Age Occupation Department Jessica Female 28 Student Math 27

28 LEFT JOIN LEFT JOIN produce a record if it exists in the left table Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor Name Jessica John Department Math CS Name Gender Age Occupation Department Jessica Female 28 Student Math Michael Male 28 Professor NULL Emma Female 34 Professor NULL 28

29 RIGHT JOIN RIGHT JOIN produce a record only if it exists in the right table Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor Name Jessica John Department Math CS Name Gender Age Occupation Department Jessica Female 28 Student Math John NULL NULL NULL CS 29

30 FULL OUTER JOIN FULL OUTER JOIN produce a record if it exists in either table. Note, FULL OUTER JOIN is not supported in MySQL. Name Gender Age Occupation Jessica Female 28 Student Michael Male 28 Professor Emma Female 34 Professor Name Jessica John Department Math CS Name Gender Age Occupation Department Jessica Female 28 Student Math Michael Male 28 Professor NULL Emma Female 34 Professor NULL John NULL NULL NULL CS 30

31 JOIN syntax Olympic Game Dataset Left Table Name: Games Right Table Name: City Year City 1896 Athens 1948 London 2004 Athens 2008 Beijing 2012 London Name Sydney Athens Beijing London Country Australia Greece China UK 31

32 JOIN Example INNER JOIN SELECT * FROM games JOIN city ON games.city=city.name LEFT JOIN SELECT * FROM games LEFT JOIN city ON games.city=city.name RIGHTT JOIN SELECT * FROM games RIGHT JOIN city ON games.city=city.name FULL OUTER JOIN SELECT * FROM games FULL OUTER JOIN city ON games.city=city.name 32

33 SQL in R Two ways of applying SQL queries in R (1) A Local Way. Query from a dataframe. (2) A Remote Way Accessing a SQL database remotely. 33

34 Package sqldf Package sqldf allows us writing SQL-like commands to query from a dataframe just like querying from a relational table. All we need to do is wrap a SQL command in double quotation and send it to the sqldf function. E.g. library(sqldf) sqldf( select * from hpc ) 34

COMP 5138 Relational Database Management Systems. Week 5 : Basic SQL. Today s Agenda. Overview. Basic SQL Queries. Joins Queries

COMP 5138 Relational Database Management Systems. Week 5 : Basic SQL. Today s Agenda. Overview. Basic SQL Queries. Joins Queries COMP 5138 Relational Database Management Systems Week 5 : Basic COMP5138 "Relational Database Managment Systems" J. Davis 2006 5-1 Today s Agenda Overview Basic Queries Joins Queries Aggregate Functions

More information

Oracle SQL. Course Summary. Duration. Objectives

Oracle SQL. Course Summary. Duration. Objectives Oracle SQL Course Summary Identify the major structural components of the Oracle Database 11g Create reports of aggregated data Write SELECT statements that include queries Retrieve row and column data

More information

SQL SELECT Query: Intermediate

SQL SELECT Query: Intermediate SQL SELECT Query: Intermediate IT 4153 Advanced Database J.G. Zheng Spring 2012 Overview SQL Select Expression Alias revisit Aggregate functions - complete Table join - complete Sub-query in where Limiting

More information

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Outline More Complex SQL Retrieval Queries

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along

More information

Introduction to Microsoft Jet SQL

Introduction to Microsoft Jet SQL Introduction to Microsoft Jet SQL Microsoft Jet SQL is a relational database language based on the SQL 1989 standard of the American Standards Institute (ANSI). Microsoft Jet SQL contains two kinds of

More information

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

SQL - QUICK GUIDE. Allows users to access data in relational database management systems. http://www.tutorialspoint.com/sql/sql-quick-guide.htm SQL - QUICK GUIDE Copyright tutorialspoint.com What is SQL? SQL is Structured Query Language, which is a computer language for storing, manipulating

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: + 38516306373 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the

More information

Database Query 1: SQL Basics

Database Query 1: SQL Basics Database Query 1: SQL Basics CIS 3730 Designing and Managing Data J.G. Zheng Fall 2010 1 Overview Using Structured Query Language (SQL) to get the data you want from relational databases Learning basic

More information

Relational Database: Additional Operations on Relations; SQL

Relational Database: Additional Operations on Relations; SQL Relational Database: Additional Operations on Relations; SQL Greg Plaxton Theory in Programming Practice, Fall 2005 Department of Computer Science University of Texas at Austin Overview The course packet

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: +966 12 739 894 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training is designed to

More information

Financial Data Access with SQL, Excel & VBA

Financial Data Access with SQL, Excel & VBA Computational Finance and Risk Management Financial Data Access with SQL, Excel & VBA Guy Yollin Instructor, Applied Mathematics University of Washington Guy Yollin (Copyright 2012) Data Access with SQL,

More information

Database Administration with MySQL

Database Administration with MySQL Database Administration with MySQL Suitable For: Database administrators and system administrators who need to manage MySQL based services. Prerequisites: Practical knowledge of SQL Some knowledge of relational

More information

Performing Queries Using PROC SQL (1)

Performing Queries Using PROC SQL (1) SAS SQL Contents Performing queries using PROC SQL Performing advanced queries using PROC SQL Combining tables horizontally using PROC SQL Combining tables vertically using PROC SQL 2 Performing Queries

More information

Boats bid bname color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red. Figure 1: Instances of Sailors, Boats and Reserves

Boats bid bname color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red. Figure 1: Instances of Sailors, Boats and Reserves Tutorial 5: SQL By Chaofa Gao Tables used in this note: Sailors(sid: integer, sname: string, rating: integer, age: real); Boats(bid: integer, bname: string, color: string); Reserves(sid: integer, bid:

More information

Chapter 1 Overview of the SQL Procedure

Chapter 1 Overview of the SQL Procedure Chapter 1 Overview of the SQL Procedure 1.1 Features of PROC SQL...1-3 1.2 Selecting Columns and Rows...1-6 1.3 Presenting and Summarizing Data...1-17 1.4 Joining Tables...1-27 1-2 Chapter 1 Overview of

More information

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL Chapter 9 Joining Data from Multiple Tables Oracle 10g: SQL Objectives Identify a Cartesian join Create an equality join using the WHERE clause Create an equality join using the JOIN keyword Create a non-equality

More information

Welcome to the topic on queries in SAP Business One.

Welcome to the topic on queries in SAP Business One. Welcome to the topic on queries in SAP Business One. 1 In this topic, you will learn to create SQL queries using the SAP Business One query tools Query Wizard and Query Generator. You will also see how

More information

SQL. Short introduction

SQL. Short introduction SQL Short introduction 1 Overview SQL, which stands for Structured Query Language, is used to communicate with a database. Through SQL one can create, manipulate, query and delete tables and contents.

More information

Outline. SAS-seminar Proc SQL, the pass-through facility. What is SQL? What is a database? What is Proc SQL? What is SQL and what is a database

Outline. SAS-seminar Proc SQL, the pass-through facility. What is SQL? What is a database? What is Proc SQL? What is SQL and what is a database Outline SAS-seminar Proc SQL, the pass-through facility How to make your data processing someone else s problem What is SQL and what is a database Quick introduction to Proc SQL The pass-through facility

More information

Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query

Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query Objectives The objective of this lab is to learn the query language of SQL. Outcomes After completing this Lab,

More information

SQL Basics. Introduction to Standard Query Language

SQL Basics. Introduction to Standard Query Language SQL Basics Introduction to Standard Query Language SQL What Is It? Structured Query Language Common Language For Variety of Databases ANSI Standard BUT. Two Types of SQL DML Data Manipulation Language

More information

Using Multiple Operations. Implementing Table Operations Using Structured Query Language (SQL)

Using Multiple Operations. Implementing Table Operations Using Structured Query Language (SQL) Copyright 2000-2001, University of Washington Using Multiple Operations Implementing Table Operations Using Structured Query Language (SQL) The implementation of table operations in relational database

More information

A Brief Introduction to MySQL

A Brief Introduction to MySQL A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term

More information

Information Systems SQL. Nikolaj Popov

Information Systems SQL. Nikolaj Popov Information Systems SQL Nikolaj Popov Research Institute for Symbolic Computation Johannes Kepler University of Linz, Austria popov@risc.uni-linz.ac.at Outline SQL Table Creation Populating and Modifying

More information

ICAB4136B Use structured query language to create database structures and manipulate data

ICAB4136B Use structured query language to create database structures and manipulate data ICAB4136B Use structured query language to create database structures and manipulate data Release: 1 ICAB4136B Use structured query language to create database structures and manipulate data Modification

More information

Effective Use of SQL in SAS Programming

Effective Use of SQL in SAS Programming INTRODUCTION Effective Use of SQL in SAS Programming Yi Zhao Merck & Co. Inc., Upper Gwynedd, Pennsylvania Structured Query Language (SQL) is a data manipulation tool of which many SAS programmers are

More information

Microsoft Access 3: Understanding and Creating Queries

Microsoft Access 3: Understanding and Creating Queries Microsoft Access 3: Understanding and Creating Queries In Access Level 2, we learned how to perform basic data retrievals by using Search & Replace functions and Sort & Filter functions. For more complex

More information

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff D80198GC10 Oracle Database 12c SQL and Fundamentals Summary Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff Level Professional Delivery Method Instructor-led

More information

2012 Teklynx Newco SAS, All rights reserved.

2012 Teklynx Newco SAS, All rights reserved. D A T A B A S E M A N A G E R DMAN-US- 01/01/12 The information in this manual is not binding and may be modified without prior notice. Supply of the software described in this manual is subject to a user

More information

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA www.sybex.com

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA www.sybex.com Essential SQL 2 Essential SQL This bonus chapter is provided with Mastering Delphi 6. It is a basic introduction to SQL to accompany Chapter 14, Client/Server Programming. RDBMS packages are generally

More information

Inquiry Formulas. student guide

Inquiry Formulas. student guide Inquiry Formulas student guide NOTICE This documentation and the Axium software programs may only be used in accordance with the accompanying Ajera License Agreement. You may not use, copy, modify, or

More information

SQL Nested & Complex Queries. CS 377: Database Systems

SQL Nested & Complex Queries. CS 377: Database Systems SQL Nested & Complex Queries CS 377: Database Systems Recap: Basic SQL Retrieval Query A SQL query can consist of several clauses, but only SELECT and FROM are mandatory SELECT FROM

More information

Click to create a query in Design View. and click the Query Design button in the Queries group to create a new table in Design View.

Click to create a query in Design View. and click the Query Design button in the Queries group to create a new table in Design View. Microsoft Office Access 2010 Understanding Queries Queries are questions you ask of your database. They allow you to select certain fields out of a table, or pull together data from various related tables

More information

Access Queries (Office 2003)

Access Queries (Office 2003) Access Queries (Office 2003) Technical Support Services Office of Information Technology, West Virginia University OIT Help Desk 293-4444 x 1 oit.wvu.edu/support/training/classmat/db/ Instructor: Kathy

More information

Join Example. Join Example Cart Prod. www.comp-soln.com 2006 Comprehensive Consulting Solutions, Inc.All rights reserved.

Join Example. Join Example Cart Prod. www.comp-soln.com 2006 Comprehensive Consulting Solutions, Inc.All rights reserved. Join Example S04.5 Join Example Cart Prod S04.6 Previous joins are equijoins (=) Other operators can be used e.g. List all my employees older than their manager SELECT emp.name FROM employee emp, manager

More information

Query-by-Example (QBE)

Query-by-Example (QBE) Query-by-Example (QBE) Module 3, Lecture 6 Example is the school of mankind, and they will learn at no other. -- Edmund Burke (1729-1797) Database Management Systems, R. Ramakrishnan 1 QBE: Intro A GUI

More information

Introduction to SQL for Data Scientists

Introduction to SQL for Data Scientists Introduction to SQL for Data Scientists Ben O. Smith College of Business Administration University of Nebraska at Omaha Learning Objectives By the end of this document you will learn: 1. How to perform

More information

Lecture 25: Database Notes

Lecture 25: Database Notes Lecture 25: Database Notes 36-350, Fall 2014 12 November 2014 The examples here use http://www.stat.cmu.edu/~cshalizi/statcomp/ 14/lectures/23/baseball.db, which is derived from Lahman s baseball database

More information

Netezza SQL Class Outline

Netezza SQL Class Outline Netezza SQL Class Outline CoffingDW education has been customized for every customer for the past 20 years. Our classes can be taught either on site or remotely via the internet. Education Contact: John

More information

MOC 20461C: Querying Microsoft SQL Server. Course Overview

MOC 20461C: Querying Microsoft SQL Server. Course Overview MOC 20461C: Querying Microsoft SQL Server Course Overview This course provides students with the knowledge and skills to query Microsoft SQL Server. Students will learn about T-SQL querying, SQL Server

More information

Database Applications Microsoft Access

Database Applications Microsoft Access Database Applications Microsoft Access Lesson 4 Working with Queries Difference Between Queries and Filters Filters are temporary Filters are placed on data in a single table Queries are saved as individual

More information

A Comparison of Database Query Languages: SQL, SPARQL, CQL, DMX

A Comparison of Database Query Languages: SQL, SPARQL, CQL, DMX ISSN: 2393-8528 Contents lists available at www.ijicse.in International Journal of Innovative Computer Science & Engineering Volume 3 Issue 2; March-April-2016; Page No. 09-13 A Comparison of Database

More information

Ad Hoc Advanced Table of Contents

Ad Hoc Advanced Table of Contents Ad Hoc Advanced Table of Contents Functions... 1 Adding a Function to the Adhoc Query:... 1 Constant... 2 Coalesce... 4 Concatenate... 6 Add/Subtract... 7 Logical Expressions... 8 Creating a Logical Expression:...

More information

Introduction to Proc SQL Steven First, Systems Seminar Consultants, Madison, WI

Introduction to Proc SQL Steven First, Systems Seminar Consultants, Madison, WI Paper #HW02 Introduction to Proc SQL Steven First, Systems Seminar Consultants, Madison, WI ABSTRACT PROC SQL is a powerful Base SAS Procedure that combines the functionality of DATA and PROC steps into

More information

Creating QBE Queries in Microsoft SQL Server

Creating QBE Queries in Microsoft SQL Server Creating QBE Queries in Microsoft SQL Server When you ask SQL Server or any other DBMS (including Access) a question about the data in a database, the question is called a query. A query is simply a question

More information

Microsoft' Excel & Access Integration

Microsoft' Excel & Access Integration Microsoft' Excel & Access Integration with Office 2007 Michael Alexander and Geoffrey Clark J1807 ; pwiueyb Wiley Publishing, Inc. Contents About the Authors Acknowledgments Introduction Part I: Basic

More information

Comp 5311 Database Management Systems. 3. Structured Query Language 1

Comp 5311 Database Management Systems. 3. Structured Query Language 1 Comp 5311 Database Management Systems 3. Structured Query Language 1 1 Aspects of SQL Most common Query Language used in all commercial systems Discussion is based on the SQL92 Standard. Commercial products

More information

3.GETTING STARTED WITH ORACLE8i

3.GETTING STARTED WITH ORACLE8i Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer

More information

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle Database 12c: Introduction to SQL Ed 1.1 Oracle University Contact Us: 1.800.529.0165 Oracle Database 12c: Introduction to SQL Ed 1.1 Duration: 5 Days What you will learn This Oracle Database: Introduction to SQL training helps you write subqueries,

More information

More on SQL. Juliana Freire. Some slides adapted from J. Ullman, L. Delcambre, R. Ramakrishnan, G. Lindstrom and Silberschatz, Korth and Sudarshan

More on SQL. Juliana Freire. Some slides adapted from J. Ullman, L. Delcambre, R. Ramakrishnan, G. Lindstrom and Silberschatz, Korth and Sudarshan More on SQL Some slides adapted from J. Ullman, L. Delcambre, R. Ramakrishnan, G. Lindstrom and Silberschatz, Korth and Sudarshan SELECT A1, A2,, Am FROM R1, R2,, Rn WHERE C1, C2,, Ck Interpreting a Query

More information

Kaseya 2. Quick Start Guide. for VSA 6.3

Kaseya 2. Quick Start Guide. for VSA 6.3 Kaseya 2 Custom Reports Quick Start Guide for VSA 6.3 December 9, 2013 Agreement The purchase and use of all Software and Services is subject to the Agreement as defined in Kaseya s Click-Accept EULA as

More information

Microsoft Excel 2007 Mini Skills Overview of Tables

Microsoft Excel 2007 Mini Skills Overview of Tables To make managing and analyzing a group of related data easier, you can turn a range of cells into a Microsoft Office Excel table (previously known as an Excel list). A table typically contains related

More information

Instant SQL Programming

Instant SQL Programming Instant SQL Programming Joe Celko Wrox Press Ltd. INSTANT Table of Contents Introduction 1 What Can SQL Do for Me? 2 Who Should Use This Book? 2 How To Use This Book 3 What You Should Know 3 Conventions

More information

Beginning C# 5.0. Databases. Vidya Vrat Agarwal. Second Edition

Beginning C# 5.0. Databases. Vidya Vrat Agarwal. Second Edition Beginning C# 5.0 Databases Second Edition Vidya Vrat Agarwal Contents J About the Author About the Technical Reviewer Acknowledgments Introduction xviii xix xx xxi Part I: Understanding Tools and Fundamentals

More information

BIG DATA HANDS-ON WORKSHOP Data Manipulation with Hive and Pig

BIG DATA HANDS-ON WORKSHOP Data Manipulation with Hive and Pig BIG DATA HANDS-ON WORKSHOP Data Manipulation with Hive and Pig Contents Acknowledgements... 1 Introduction to Hive and Pig... 2 Setup... 2 Exercise 1 Load Avro data into HDFS... 2 Exercise 2 Define an

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database technology.

More information

David M. Kroenke and David J. Auer Database Processing: Fundamentals, Design and Implementation

David M. Kroenke and David J. Auer Database Processing: Fundamentals, Design and Implementation David M. Kroenke and David J. Auer Database Processing: Fundamentals, Design and Implementation Chapter Two: Introduction to Structured Query Language 2-1 Chapter Objectives To understand the use of extracted

More information

Chapter 5. SQL: Queries, Constraints, Triggers

Chapter 5. SQL: Queries, Constraints, Triggers Chapter 5 SQL: Queries, Constraints, Triggers 1 Overview: aspects of SQL DML: Data Management Language. Pose queries (Ch. 5) and insert, delete, modify rows (Ch. 3) DDL: Data Definition Language. Creation,

More information

Microsoft Excel 2010 Part 3: Advanced Excel

Microsoft Excel 2010 Part 3: Advanced Excel CALIFORNIA STATE UNIVERSITY, LOS ANGELES INFORMATION TECHNOLOGY SERVICES Microsoft Excel 2010 Part 3: Advanced Excel Winter 2015, Version 1.0 Table of Contents Introduction...2 Sorting Data...2 Sorting

More information

DBMS / Business Intelligence, SQL Server

DBMS / Business Intelligence, SQL Server DBMS / Business Intelligence, SQL Server Orsys, with 30 years of experience, is providing high quality, independant State of the Art seminars and hands-on courses corresponding to the needs of IT professionals.

More information

Using AND in a Query: Step 1: Open Query Design

Using AND in a Query: Step 1: Open Query Design Using AND in a Query: Step 1: Open Query Design From the Database window, choose Query on the Objects bar. The list of saved queries is displayed, as shown in this figure. Click the Design button. The

More information

Data Tool Platform SQL Development Tools

Data Tool Platform SQL Development Tools Data Tool Platform SQL Development Tools ekapner Contents Setting SQL Development Preferences...5 Execution Plan View Options Preferences...5 General Preferences...5 Label Decorations Preferences...6

More information

Access 2010: Creating Queries Table of Contents INTRODUCTION TO QUERIES... 2 QUERY JOINS... 2 INNER JOINS... 3 OUTER JOINS...

Access 2010: Creating Queries Table of Contents INTRODUCTION TO QUERIES... 2 QUERY JOINS... 2 INNER JOINS... 3 OUTER JOINS... Access 2010: Creating Queries Table of Contents INTRODUCTION TO QUERIES... 2 QUERY JOINS... 2 INNER JOINS... 3 OUTER JOINS... 3 CHANGE A JOIN PROPERTY... 4 REMOVING A JOIN... 4 CREATE QUERIES... 4 THE

More information

Katie Minten Ronk, Steve First, David Beam Systems Seminar Consultants, Inc., Madison, WI

Katie Minten Ronk, Steve First, David Beam Systems Seminar Consultants, Inc., Madison, WI Paper 191-27 AN INTRODUCTION TO PROC SQL Katie Minten Ronk, Steve First, David Beam Systems Seminar Consultants, Inc., Madison, WI ABSTRACT PROC SQL is a powerful Base SAS 7 Procedure that combines the

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: 001-855-844-3881 & 001-800-514-06-97 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals

More information

Oracle Database 11g SQL

Oracle Database 11g SQL AO3 - Version: 2 19 June 2016 Oracle Database 11g SQL Oracle Database 11g SQL AO3 - Version: 2 3 days Course Description: This course provides the essential SQL skills that allow developers to write queries

More information

Advanced Query for Query Developers

Advanced Query for Query Developers for Developers This is a training guide to step you through the advanced functions of in NUFinancials. is an ad-hoc reporting tool that allows you to retrieve data that is stored in the NUFinancials application.

More information

SUBQUERIES AND VIEWS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 6

SUBQUERIES AND VIEWS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 6 SUBQUERIES AND VIEWS CS121: Introduction to Relational Database Systems Fall 2015 Lecture 6 String Comparisons and GROUP BY 2! Last time, introduced many advanced features of SQL, including GROUP BY! Recall:

More information

Structured Query Language (SQL)

Structured Query Language (SQL) Objectives of SQL Structured Query Language (SQL) o Ideally, database language should allow user to: create the database and relation structures; perform insertion, modification, deletion of data from

More information

Introduction to SQL: Data Retrieving

Introduction to SQL: Data Retrieving Introduction to SQL: Data Retrieving Ruslan Fomkin Databasdesign för Ingenjörer 1056F Structured Query Language (SQL) History: SEQUEL (Structured English QUery Language), earlier 70 s, IBM Research SQL

More information

1 Structured Query Language: Again. 2 Joining Tables

1 Structured Query Language: Again. 2 Joining Tables 1 Structured Query Language: Again So far we ve only seen the basic features of SQL. More often than not, you can get away with just using the basic SELECT, INSERT, UPDATE, or DELETE statements. Sometimes

More information

AN INTRODUCTION TO THE SQL PROCEDURE Chris Yindra, C. Y. Associates

AN INTRODUCTION TO THE SQL PROCEDURE Chris Yindra, C. Y. Associates AN INTRODUCTION TO THE SQL PROCEDURE Chris Yindra, C Y Associates Abstract This tutorial will introduce the SQL (Structured Query Language) procedure through a series of simple examples We will initially

More information

9.1 SAS. SQL Query Window. User s Guide

9.1 SAS. SQL Query Window. User s Guide SAS 9.1 SQL Query Window User s Guide The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. SAS 9.1 SQL Query Window User s Guide. Cary, NC: SAS Institute Inc. SAS

More information

Appendix III: SPSS Preliminary

Appendix III: SPSS Preliminary Appendix III: SPSS Preliminary SPSS is a statistical software package that provides a number of tools needed for the analytical process planning, data collection, data access and management, analysis,

More information

Tutorial 3. Maintaining and Querying a Database

Tutorial 3. Maintaining and Querying a Database Tutorial 3 Maintaining and Querying a Database Microsoft Access 2010 Objectives Find, modify, and delete records in a table Learn how to use the Query window in Design view Create, run, and save queries

More information

Microsoft Office 2010

Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database Microsoft Office 2010 Objectives Find, modify, and delete records in a table Learn how to use the Query window in Design view Create, run, and save

More information

Lecture 4: More SQL and Relational Algebra

Lecture 4: More SQL and Relational Algebra CPSC 421 Database Management Systems Lecture 4: More SQL and Relational Algebra * Some material adapted from R. Ramakrishnan, L. Delcambre, and B. Ludaescher Today s Agenda Go over last week s quiz New

More information

Learning MySQL! Angola Africa 1246700 20609294 100990000000. SELECT name, gdp/population FROM world WHERE area > 50000000!

Learning MySQL! Angola Africa 1246700 20609294 100990000000. SELECT name, gdp/population FROM world WHERE area > 50000000! Learning MySQL http://sqlzoo.net/wiki/select_basics Angola Africa 1246700 20609294 100990000000 1) Single quotes SELECT population FROM world WHERE name = Germany 2) Division SELECT name, gdp/population

More information

SQL. by Steven Holzner, Ph.D. ALPHA. A member of Penguin Group (USA) Inc.

SQL. by Steven Holzner, Ph.D. ALPHA. A member of Penguin Group (USA) Inc. SQL by Steven Holzner, Ph.D. A ALPHA A member of Penguin Group (USA) Inc. Contents Part 1: Mastering the SQL Basics 1 1 Getting into SQL 3 Understanding Databases 4 Creating Tables Creating Rows and Columns

More information

Web Programming Step by Step

Web Programming Step by Step Web Programming Step by Step Chapter 11 Relational Databases and SQL References: SQL syntax reference, w3schools tutorial Except where otherwise noted, the contents of this presentation are Copyright 2009

More information

P_Id LastName FirstName Address City 1 Kumari Mounitha VPura Bangalore 2 Kumar Pranav Yelhanka Bangalore 3 Gubbi Sharan Hebbal Tumkur

P_Id LastName FirstName Address City 1 Kumari Mounitha VPura Bangalore 2 Kumar Pranav Yelhanka Bangalore 3 Gubbi Sharan Hebbal Tumkur SQL is a standard language for accessing and manipulating databases. What is SQL? SQL stands for Structured Query Language SQL lets you access and manipulate databases SQL is an ANSI (American National

More information

Cal Answers Analysis Training Part I. Creating Analyses in OBIEE

Cal Answers Analysis Training Part I. Creating Analyses in OBIEE Cal Answers Analysis Training Part I Creating Analyses in OBIEE University of California, Berkeley March 2012 Table of Contents Table of Contents... 1 Overview... 2 Getting Around OBIEE... 2 Cal Answers

More information

IT2304: Database Systems 1 (DBS 1)

IT2304: Database Systems 1 (DBS 1) : Database Systems 1 (DBS 1) (Compulsory) 1. OUTLINE OF SYLLABUS Topic Minimum number of hours Introduction to DBMS 07 Relational Data Model 03 Data manipulation using Relational Algebra 06 Data manipulation

More information

Example Instances. SQL: Queries, Programming, Triggers. Conceptual Evaluation Strategy. Basic SQL Query. A Note on Range Variables

Example Instances. SQL: Queries, Programming, Triggers. Conceptual Evaluation Strategy. Basic SQL Query. A Note on Range Variables SQL: Queries, Programming, Triggers Chapter 5 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Example Instances We will use these instances of the Sailors and Reserves relations in our

More information

SQL: Queries, Programming, Triggers

SQL: Queries, Programming, Triggers SQL: Queries, Programming, Triggers Chapter 5 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 R1 Example Instances We will use these instances of the Sailors and Reserves relations in

More information

DIPLOMA IN WEBDEVELOPMENT

DIPLOMA IN WEBDEVELOPMENT DIPLOMA IN WEBDEVELOPMENT Prerequisite skills Basic programming knowledge on C Language or Core Java is must. # Module 1 Basics and introduction to HTML Basic HTML training. Different HTML elements, tags

More information

IT2305 Database Systems I (Compulsory)

IT2305 Database Systems I (Compulsory) Database Systems I (Compulsory) INTRODUCTION This is one of the 4 modules designed for Semester 2 of Bachelor of Information Technology Degree program. CREDITS: 04 LEARNING OUTCOMES On completion of this

More information

Big Data and Analytics by Seema Acharya and Subhashini Chellappan Copyright 2015, WILEY INDIA PVT. LTD. Introduction to Pig

Big Data and Analytics by Seema Acharya and Subhashini Chellappan Copyright 2015, WILEY INDIA PVT. LTD. Introduction to Pig Introduction to Pig Agenda What is Pig? Key Features of Pig The Anatomy of Pig Pig on Hadoop Pig Philosophy Pig Latin Overview Pig Latin Statements Pig Latin: Identifiers Pig Latin: Comments Data Types

More information

SQL: Queries, Programming, Triggers

SQL: Queries, Programming, Triggers SQL: Queries, Programming, Triggers CSC343 Introduction to Databases - A. Vaisman 1 R1 Example Instances We will use these instances of the Sailors and Reserves relations in our examples. If the key for

More information

Discovering SQL. Wiley Publishing, Inc. A HANDS-ON GUIDE FOR BEGINNERS. Alex Kriegel WILEY

Discovering SQL. Wiley Publishing, Inc. A HANDS-ON GUIDE FOR BEGINNERS. Alex Kriegel WILEY Discovering SQL A HANDS-ON GUIDE FOR BEGINNERS Alex Kriegel WILEY Wiley Publishing, Inc. INTRODUCTION xxv CHAPTER 1: DROWNING IN DATA, DYING OF THIRST FOR KNOWLEDGE 1 Data Deluge and Informational Overload

More information

Introduction to Proc SQL Katie Minten Ronk, Systems Seminar Consultants, Madison, WI

Introduction to Proc SQL Katie Minten Ronk, Systems Seminar Consultants, Madison, WI Paper 268-29 Introduction to Proc SQL Katie Minten Ronk, Systems Seminar Consultants, Madison, WI ABSTRACT PROC SQL is a powerful Base SAS Procedure that combines the functionality of DATA and PROC steps

More information

How To Create A Table In Sql 2.5.2.2 (Ahem)

How To Create A Table In Sql 2.5.2.2 (Ahem) Database Systems Unit 5 Database Implementation: SQL Data Definition Language Learning Goals In this unit you will learn how to transfer a logical data model into a physical database, how to extend or

More information

IBM SPSS Direct Marketing 23

IBM SPSS Direct Marketing 23 IBM SPSS Direct Marketing 23 Note Before using this information and the product it supports, read the information in Notices on page 25. Product Information This edition applies to version 23, release

More information

Data exploration with Microsoft Excel: analysing more than one variable

Data exploration with Microsoft Excel: analysing more than one variable Data exploration with Microsoft Excel: analysing more than one variable Contents 1 Introduction... 1 2 Comparing different groups or different variables... 2 3 Exploring the association between categorical

More information

Essentials of SQL. Essential SQL 11/06/2010. NWeHealth, The University of Manchester

Essentials of SQL. Essential SQL 11/06/2010. NWeHealth, The University of Manchester NWeHealth, The University of Manchester Essentials of SQL Exercise Booklet WITH ANSWERS Queries modified from various internet resources including SQLZoo.net Dr. Georgina Moulton Education and Development

More information

Business Objects 4.1 Quick User Guide

Business Objects 4.1 Quick User Guide Business Objects 4.1 Quick User Guide Log into SCEIS Business Objects (BOBJ) 1. https://sceisreporting.sc.gov 2. Choose Windows AD for Authentication. 3. Enter your SCEIS User Name and Password: Home Screen

More information

UNIT 6. Structured Query Language (SQL) Text: Chapter 5

UNIT 6. Structured Query Language (SQL) Text: Chapter 5 UNIT 6 Structured Query Language (SQL) Text: Chapter 5 Learning Goals Given a database (a set of tables ) you will be able to express a query in SQL, involving set operators, subqueries and aggregations

More information

PSU 2012. SQL: Introduction. SQL: Introduction. Relational Databases. Activity 1 Examining Tables and Diagrams

PSU 2012. SQL: Introduction. SQL: Introduction. Relational Databases. Activity 1 Examining Tables and Diagrams PSU 2012 SQL: Introduction SQL: Introduction The PowerSchool database contains data that you access through a web page interface. The interface is easy to use, but sometimes you need more flexibility.

More information

Handling Missing Values in the SQL Procedure

Handling Missing Values in the SQL Procedure Handling Missing Values in the SQL Procedure Danbo Yi, Abt Associates Inc., Cambridge, MA Lei Zhang, Domain Solutions Corp., Cambridge, MA ABSTRACT PROC SQL as a powerful database management tool provides

More information