1 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 basic SQL commands 2. Understand the difference between left, right and full joins 3. Understand groupings and how they connect to aggregation functions 4. Understand data type basics 5. How to perform basic subqueries 1 Introduction In the information sciences, we commonly have data spread across multiple data sets or database sources. Thankfully, most database servers have an agreed upon a standard format to interact, merge and answer questions with that data: SQL (Structured Query Language). While subtle distinctions exists between database systems (SQL Server, SQLite, MySQL, Oracle and others), SQL is (mostly) a portable skill across server platforms. 1.1 Tables and Data Types In most cases, you will be interacting with or creating tables of data. Each column in a table has a specific data type. These types not only indicate how the data is stored, but how queries (questions you ask) are executed. Let s suppose you are examining student data with three simple tables. 1
2 student data table term gpa data table degrees data table Column Name Data Type Column Name Data Type Column Name Data Type id* name Integer Text id* term* gpa Integer Integer Float id* term degree* Integer Integer Char(5) * Indicates primary key of the table Amongst the seven columns there are four different data types: integer, float, char and text. Integer is arguably the simplest form of data a computer can store (ignoring booleans and tiny storage methods which are just variations on the integer). Integers are stored by simply translating the number to binary. This means that a 32 bit unsigned integer can store any number between 0 and 4, 294, 967, 295 (2 32 1). Because of its very efficient method of storage, searching, ordering and grouping integers is almost always the best option (assuming you have an option). A float is simply an integer with some part of the number indicating a position of the decimal place. For instance, traditionally in a 32 bit float, 24 bits are dedicated to the number itself (i.e. the integer) while the remaining bits are used to describe the position of the decimal place. For the purposes of database use, one should understand two basic ideas about floating points: they are an efficient form of storage, but not as good as integers and if you perform mathematical operations using both integers and floats all of the data will be converted to floats to execute the task. Chars are a fixed-length string of text. For instance, char(5) would store 5 characters. Computers can t actually store characters directly, so something called a character map is used. So, suppose you have 256 different characters in an alphabet (which is generally considered the minimum), you could have a stream of ones and zeros stored somewhere where the stream is divided into groups of 8 (this would be an 8 bit character set). Under these conditions, each letter you store would take 8 bits of storage (so a char(5) would take 40 bits per row). In a fixed length text stream environment, the entire fixed length is stored even if only part of it is used. While the text datatype stores each character the same way a char does, it doesn t have a predefined fixed length. So, there is two options: each row could be of differing lengths (this is what varchar does), or the data in this column is stored separate from the table (which is what text does). Both have bad performance results. If each row is of varying length, then aggregation 2
3 functions and groupings are far slower. But storing the data away from table isn t good either as that means searching involves a bunch of redirection operations. It is obviously important to store text data in databases, but you should always be clear on what the performance implications are, especially as you start performing joins and subqueries Primary Keys Every row should have a unique value that identifies it known as a primary key (which is a type of index). Often times this is a single, non-repeating integer (as is the case with the student data table), but it doesn t have to be: as long as the combination of columns describe a unique value. In general, accessing a row by its primary key is the fastest method. 1.2 Data To assist with our exploration of the SQL language we will define our data: id student name 1 Edith Warton 2 Dorian Gray 3 Ophelia 4 Henry James 5 Harper Lee term gpa id term gpa degrees id term degree EconS MathS CompS EngLT While your datasets will likely be very large, in the process of learning the language it is usually good to start with something that you can visually see the answer. 2 Select A select statement (which is a form of query) has three basic parts: what do want, where is it from and under what conditions. So an extremely basic command might be: 1 SELECT s. i d AS id, s. name AS name 3
4 3 WHERE s. i d =1; Which results in a single row: id name 1 Edith Warton So what s happening here? We re grabbing the id and name data (SELECT s.id AS id, s.name AS name) from the student table (which we are renaming s using the AS statement FROM student AS s) where the id column equals one (WHERE s.id=1 ). The condition (WHERE s.id=1 ) is actually executed first. Because id is the primary key, the database simply looks up the location of the row and pulls a single value (the rest of the rows are not examined). Now, let s suppose you want to attach the GPA of a specific term to these results. 1 SELECT s. i d AS id, s. name AS name, t. gpa AS gpa 3 JOIN term gpa AS t ON s. i d=t. i d 4 WHERE s. i d=1 AND t. term =2012; Which results in a single row: id name gpa 1 Edith Warton 3.51 Let s break this apart: there are actually two result sets that are then merged. The conditions on each table can be thought to be executed separately then joined on the on condition (the exact execution order is up the database optimizer). What happens if I do this? 1 SELECT s. i d AS id, s. name AS name, t. gpa AS gpa 3 JOIN term gpa AS t ON s. i d=t. i d 4 WHERE s. i d =1; Which results in a two rows: Now that s interesting, you might expect to get a single result, but because the results from term gpa result in two rows, both of which match the same row in student, when the two result 4
5 id name gpa 1 Edith Warton Edith Warton 3.51 sets are merged it results in a repeat of the student information. What if we remove the where condition entirely? What happens then: 1 SELECT s. i d AS id, s. name AS name, t. gpa AS gpa 3 JOIN term gpa AS t ON s. i d=t. i d ; id name gpa 1 Edith Warton Edith Warton Dorian Gray Dorian Gray Ophelia Henry James Henry James Henry James Harper Lee 2.99 As you can see, each record is repeated for each combination of rows that meet the criteria of the join. However, let s add another table, in this case degrees, where the id must mach the id in the student table and the term must mach the term gpa table. 1 SELECT s. i d AS id, s. name AS name, t. gpa AS gpa 3 JOIN term gpa AS t ON s. i d=t. i d 4 JOIN d e g r e e s AS d ON d. i d=s. i d AND t. term=d. term ; id name gpa 1 Edith Warton Ophelia Ophelia Henry James
6 That resulted in a lot less rows! But it makes sense: any student who didn t also exist in the degrees table (i.e. they didn t graduate), couldn t be merged with the results from the student and term gpa table. Also note that the fact that we aren t actually displaying information from the degrees table is not relevant to the merge process. 2.1 Left and Right Joins But sometimes you don t want to eliminate un-merged rows, instead you would prefer blanks when row can not be matched. This is where left and right joins come in. Consider: 1 SELECT s. i d AS id, s. name AS name, t. gpa AS gpa, d. d egree AS d egree 3 JOIN term gpa AS t ON s. i d=t. i d 4 LEFT JOIN d e g r e e s AS d ON d. i d=s. i d AND t. term=d. term ; id name gpa degree 1 Edith Warton Edith Warton 3.51 EconS 2 Dorian Gray Dorian Gray Ophelia 3.70 CompS 3 Ophelia 3.70 MathS 4 Henry James Henry James 3.21 EngLT 4 Henry James Harper Lee 2.99 This is seemingly the same criteria as before, but this time if it can t find something in the degrees table it simply attaches null values (instead of eliminating the row). The left part of the left join indicates that every row found on the left side of the join (proceeding the join) should be shown. A right join is simply the opposite 1. Often times you actually care about which values have null when you attempt to join. For instance, let s say you wanted to find all students who didn t graduate as well as their GPA: 1 SELECT s. i d AS id, s. name AS name, t. gpa AS gpa 1 While left and right joins are both in the SQL syntax, right joins are not included in all databases. Given they do the same thing (it is just a matter of code arrangement), you should use left joins. 6
7 3 JOIN term gpa AS t ON s. i d=t. i d 4 LEFT JOIN d e g r e e s AS d ON d. i d=s. i d AND t. term<=d. term 5 WHERE d. i d IS NULL; id name gpa 2 Dorian Gray Dorian Gray Henry James Harper Lee 2.99 So, what we ve got here is people that are enrolled, but have not graduated, by term. Note how Henry James is still listed because he has enrolled in a semester after his last degree. 2.2 Grouping Let s try to clean this last result up. Maybe I don t want each students GPA by term, maybe I want an average. I also might want one row to represent one student. 1 SELECT s. i d AS id, MAX( s. name ) AS name, AVG( t. gpa ) AS gpa 3 JOIN term gpa AS t ON s. i d=t. i d 4 LEFT JOIN d e g r e e s AS d ON d. i d=s. i d AND t. term<=d. term 5 WHERE d. i d IS NULL 6 GROUP BY s. i d ; id name gpa 2 Dorian Gray Henry James Harper Lee 2.99 The concept of grouping is that you have a result and you are going to group it on some criteria. Aggregation functions (e.g. AVG, MAX, SUM, COUNT ) work in conjunction with the group. So, when you use an aggregation function, it is giving you the average, sum, whatever that are rolled-up for that particular row. It also of note that you must use an aggregation function on any column in your select list that you are not grouping on. This makes sense: you don t need to use aggregation on a column where 7
8 you are grouping because they are all the same for each row (that s why they are grouped), but without the aggregation function on a non-grouped row, the database won t know which of the results for a given column/row to show. Admittedly, sometimes it looks a bit silly (as is the case with the MAX function, in the example, run on a string), but it is very consistent, which is what you want from a language. 2.3 Subquery Suppose for a moment that you wanted to get the inflation adjusted GPA of each student in the graduation term (we re assuming that GPA is inflated by 0.04 points per year) 2 : 1 SELECT s. i d AS id, MAX( s. name ) AS name, MIN(mGPA. gpa ) AS gpa 3 JOIN term gpa AS t ON s. i d=t. i d 4 JOIN d e g r e e s AS d ON d. i d=s. i d AND t. term<=d. term 5 JOIN ( 6 SELECT id, ( gpa (.04 ( term 2011) ) ) AS gpa, term 7 FROM term gpa 8 ) AS mgpa ON s. i d=mgpa. i d AND mgpa. term=d. term 9 GROUP BY s. i d ; id name gpa 1 Edith Warton Ophelia Henry James 3.17 This query involves a subquery, which is a query in its own right that is executed as a part of the larger query. In this case, the subquery is executed and produces a set of results that are then merged through the join process (much like if that data existed as a separate table). Subqueries don t have to be in any specific part of the main query. Let s say you you want to get the average GPA of each student and place it along with the students name: 1 SELECT id, name, ( 2 SELECT AVG( gpa ) 3 FROM term gpa 2 I m aware that this query could be constructed using a standard join, I ve constructed it in this form to demonstrate the use of a subquery 8
9 4 WHERE i d=s. i d 5 ) AS avg gpa 6 FROM student AS s 7 ORDER BY name ASC; id name avg gpa 2 Dorian Gray Edith Warton Harper Lee Henry James Ophelia 3.70 And you can have subqueries of subqueries. Let s suppose you are trying categorize the students based on their average GPAs: 1 SELECT id, name, ( 2 SELECT 3 CASE 4 WHEN avg gpa >=3.5 THEN 2 5 WHEN avg gpa <3.5 AND avg gpa >=3.0 THEN 1 6 ELSE 0 7 END AS gpa type FROM 8 ( 9 SELECT AVG( gpa ) AS avg gpa 10 FROM term gpa 11 WHERE i d=s. i d 12 ) AS a v g g p a t a b l e 13 ) AS gpa type 14 FROM student AS s 15 ORDER BY name ASC; id name gpa type 2 Dorian Gray 0 1 Edith Warton 1 5 Harper Lee 0 4 Henry James 1 3 Ophelia 2 So, subqueries are executed as if they are mathematical operations (from inside of the parentheticals out). So in the inner subquery we get the average GPA for that particular row, then we 9
10 classify it using as CASE statement which is returned to the main query. 2.4 Like and more complicated conditions Sometimes we would like to match part of a string. While this is a relatively slow operation, it is sometimes necessary. Suppose I m looking for a particular person in the data, but I only have their first name: 1 SELECT id, name 3 WHERE name LIKE Dorian% ; The character % states match anything of any length (and Like statements are not case sensitive in general). It is often useful to simply specify part of a string that can be different. 1 SELECT id, name 3 WHERE name LIKE Dor n% ; In this context, means match any one character (suppose you don t know the spelling of a name). You can use like conditions in very complicated settings. Let s say you want a list of graduating students with a high GPA or are in a science (assuming all of the science majors end in S ). 1 SELECT s. i d AS id, MAX( s. name ) AS name 3 JOIN d e g r e e s AS d ON d. i d=s. i d 4 WHERE ( 5 ( 6 SELECT AVG( gpa ) AS gpa 7 FROM term gpa WHERE s. i d=i d AND term<=d. term 8 ) >= OR 10 d. degree LIKE %S 11 ) 12 GROUP BY s. i d ; Henry James would appear in these results if the GPA requirement was adjusted down to something like
11 id name 1 Edith Warton 3 Ophelia 3 Indexes Indexes are a copy of a subset of a particular object s (e.g. table) data that is stored in a particular order. Indexes are commonly something called a b-tree, which is a generalization of the binomial search tree but allows for multiple child nodes. In the context of this document, we ll focus on how to think about indexes instead of how they exactly work. Imagine a library with a card catalogue containing small amounts of information about each book (namely the book name and the authors). They are also in a specific order and reference the location of the real data in the books. A database index can be thought of much in this way. An index can be on any one or more columns. This includes text columns (though you generally index a few characters per row instead of the entire column; which is what you do on numeric columns if it is not obvious to you why, please reread section 1.1). Let s suppose their is a multicolumn index on (term, gpa, id) in the term gpa table and we run the following query: 1 SELECT t. i d AS id, t. gpa AS gpa 2 FROM term gpa AS t 3 WHERE t. term=2011 AND t. gpa > GROUP BY t. i d ; Ok, so the database is able to use the first two columns of the index to satisfy the where condition and use the third to satisfy the group by. Note that the order is important: the where condition is executed first, so those columns must be the first items in the index (followed by group by and order by). So, if the multicolumn index was (term, id, gpa), it would still be used to satisfy the term condition but the database would resort to scanning the remaining rows to examine the gpa and group the results. However, (term, id, gpa) would be perfect for something like this: 11
12 1 SELECT t. i d AS id, t. gpa AS gpa 2 FROM term gpa AS t 3 WHERE t. term > GROUP BY t. id, t. gpa ; Or something like this: 1 SELECT t. i d AS id, t. gpa AS gpa 2 FROM term gpa AS t 3 WHERE t. term > ORDER BY t. i d ASC, t. gpa DESC; That is, as long as the order of the columns matches the order of execution, the index will be of some use to the database. However, consider text content. Suppose we have an index on (name, id) in the student table and we execute the following from our discussion of like: 1 SELECT id, name 3 WHERE name LIKE Dorian% ; So, in this scenario, the index on name would be helpful to at least reduce the rows that would have to be examined by the database. However, consider this query: 1 SELECT id, name 3 WHERE name LIKE %Gray ; Now, the index becomes completely useless (the database will have to examine all rows). This is because the index is ordered by the text at the beginning of the column and % can match anything. 4 Creating Reusable Code Creating code that is reusable is extremely important, especially if you work with other people. Complete reusable code files allows other users, who may not understand your logic, to run your code while modifying one important aspect of the code. 12
13 Unfortunately, this is an area that the database providers have been less-good about providing a consistent interface across systems. Nonetheless, these concepts are similar and the syntax for MySQL and MS SQL are very similar, thus we will follow their syntax. Remember this example? 1 SELECT id, name, ( 2 SELECT 3 CASE 4 WHEN avg gpa >=3.5 THEN 2 5 WHEN avg gpa <3.5 AND avg gpa >=3.0 THEN 1 6 ELSE 0 7 END AS gpa type FROM 8 ( 9 SELECT AVG( gpa ) AS avg gpa 10 FROM term gpa 11 WHERE i d=s. i d 12 ) AS a v g g p a t a b l e 13 ) AS gpa type 14 FROM student AS s 15 ORDER BY name ASC; Now, I want you to suppose that you don t want every student, but just those enrolled in a specific semester. I m going to do this by joining the student table to the term gpa table. 1 SELECT s. i d AS id, s. name AS name, ( 2 SELECT 3 CASE 4 WHEN avg gpa >=3.5 THEN 2 5 WHEN avg gpa <3.5 AND avg gpa >=3.0 THEN 1 6 ELSE 0 7 END AS gpa type FROM 8 ( 9 SELECT AVG( gpa ) AS avg gpa 10 FROM term gpa 11 WHERE i d=s. i d AND term <= ) AS a v g g p a t a b l e 13 ) AS gpa type 14 FROM student AS s 15 JOIN term gpa AS t ON s. i d=t. i d 16 WHERE t. term=
14 17 ORDER BY s. name ASC; Great! But maybe this information has to be run every year. This is how you would solve that problem in MS SQL. Listing 1: Term Report.sql 1 INT; 2 3 = ; 4 5 / L i s t o f a c t i v e s t u d e n t s by GPA type / 6 7 SELECT s. i d AS id, s. name AS name, ( 8 SELECT 9 CASE 10 WHEN avg gpa >=3.5 THEN 2 11 WHEN avg gpa <3.5 AND avg gpa >=3.0 THEN 1 12 ELSE 0 13 END AS gpa type FROM 14 ( 15 SELECT AVG( gpa ) AS avg gpa 16 FROM term gpa 17 WHERE i d=s. i d AND 18 ) AS a v g g p a t a b l e 19 ) AS gpa type 20 FROM student AS s 21 JOIN term gpa AS t ON s. i d=t. i d 22 WHERE t. 23 ORDER BY s. name ASC; Now, what s important to to see here is that we ve declared a variable at the top, defined its type and set it to a particular value. Then in the query we just type in that variable. This entire query can be saved as a some name.sql file (as noted by the title) that some other person can run. Further, you aren t limited to a single query. Suppose, in addition to students by GPA type, you want to get a list of students who are active in the next term and another list of students who are both not active in the next term and didn t graduate. 14
15 Listing 2: Complete Term Report.sql 1 INT; 2 3 = ; 4 5 / L i s t o f a c t i v e s t u d e n t s by GPA type / 6 7 SELECT s. i d AS id, s. name AS name, ( 8 SELECT 9 CASE 10 WHEN avg gpa >=3.5 THEN 2 11 WHEN avg gpa <3.5 AND avg gpa >=3.0 THEN 1 12 ELSE 0 13 END AS gpa type FROM 14 ( 15 SELECT AVG( gpa ) AS avg gpa 16 FROM term gpa 17 WHERE i d=s. i d AND 18 ) AS a v g g p a t a b l e 19 ) AS gpa type 20 FROM student AS s 21 JOIN term gpa AS t ON s. i d=t. i d 22 WHERE t. 23 ORDER BY s. name ASC; / L i s t o f a c t i v e s t u d e n t s who are a c t i v e i n the next term / SELECT s. i d AS id, s. name AS name 28 FROM student AS s 29 JOIN term gpa AS t ON s. i d=t. i d AND t. 30 JOIN term gpa AS t t ON s. i d=t t. i d AND t t. 31 ORDER BY s. name ASC; / L i s t o f a c t i v e s t u d e n t s who are not a c t i v e i n the next term and didn t graduate / SELECT s. i d AS id, s. name AS name 36 FROM student AS s 37 JOIN term gpa AS t ON s. i d=t. i d AND t. 38 LEFT JOIN term gpa AS t t ON s. i d=t t. i d AND t t. 15
16 39 LEFT JOIN d e g r e e s AS d ON s. i d=d. i d AND d. 40 WHERE t t. i d IS NULL AND d. i d IS NULL 41 ORDER BY s. name ASC; Now, what s really handy about this is that another person can simply change the value and rerun this report (and the comments tell the person what each query does). 5 Further Reading 5.1 Online Resources 1. SQL Quick Reference (http://www.w3schools.com/sql/sql quickref.asp) 2. MySQL Reference Manuals (http://dev.mysql.com/doc/#manual) 3. MS SQL Reference (http://msdn.microsoft.com/en-us/library/ms189826(v=sql.90).aspx) 5.2 Books 1. SQL Pocket Guide (http://shop.oreilly.com/product/ do) 2. Learning SQL (http://shop.oreilly.com/product/ do) 3. High Performance MySQL (http://shop.oreilly.com/product/ do) Ben Smith, 2013: Licensed under Creative Commons Attribution
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
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,
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
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
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
Physical Design Physical Database Design (Defined): Process of producing a description of the implementation of the database on secondary storage; it describes the base relations, file organizations, and
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
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
WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language
SQL DATA DEFINITION: KEY CONSTRAINTS CS121: Introduction to Relational Database Systems Fall 2015 Lecture 7 Data Definition 2 Covered most of SQL data manipulation operations Continue exploration of SQL
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.
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
sqlite driver manual A libdbi driver using the SQLite embedded database engine Markus Hoenicka email@example.com sqlite driver manual: A libdbi driver using the SQLite embedded database engine
Information Systems SQL Nikolaj Popov Research Institute for Symbolic Computation Johannes Kepler University of Linz, Austria firstname.lastname@example.org Outline SQL Table Creation Populating and Modifying
Structured Query Language (SQL) Introduction Commercial database systems use more user friendly language to specify the queries. SQL is the most influential commercially marketed product language. Other
its not in the manual An SQL Cookbook. The Back-story: I ve always liked the technical cookbook concept. For those of you who aren t familiar with the format, it s basically a loosely structured compendium
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:...
(Web) Application Development With Ian Week 3 SQL with Multiple Tables Join The join operation allows you to combine related rows of data found in two tables into a single result set. It works similarly
Database Design and Programming with SQL: Part 2 Learning Objectives This is the second portion of the Database Design and Programming with SQL course. In this portion, students implement their database
2. Creating a database Designing the database schema... 1 Representing Classes, Attributes and Objects... 2 Data types... 5 Additional constraints... 6 Choosing the right fields... 7 Implementing a table
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
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
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
3 RETRIEVING ISERIES DATA WITH MICROSOFT QUERY Microsoft Query, the helper application included with Microsoft Office, allows Office applications such as Word and Excel to read data from ODBC data sources.
Presentation Layer The presentation layer is concerned with preserving the meaning of information sent across a network. The presentation layer may represent (encode) the data in various ways (e.g., data
Appendix B Database Design B.1 Database Design and Definition Throughout the SQL chapter we connected to and queried the IMDB database. This database was set up by IMDB and available for us to use. But
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
Cal Answers Analysis Training Part III Advanced OBIEE - Dashboard Reports University of California, Berkeley March 2012 Table of Contents Table of Contents... 1 Overview... 2 Remember How to Create a Query?...
SQL Server An Overview SQL Server Microsoft SQL Server is designed to work effectively in a number of environments: As a two-tier or multi-tier client/server database system As a desktop database system
David Chappell INTRODUCING AZURE SEARCH Sponsored by Microsoft Corporation Copyright 2015 Chappell & Associates Contents Understanding Azure Search... 3 What Azure Search Provides...3 What s Required to
PeopleSoft Query Training Overview Guide Tanya Harris & Alfred Karam Publish Date - 3/16/2011 Chapter: Introduction Table of Contents Introduction... 4 Navigation of Queries... 4 Query Manager... 6 Query
Chapter 6: Physical Database Design and Performance Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden Robert C. Nickerson ISYS 464 Spring 2003 Topic 23 Database
Introduction to SQL and SQL in R LISA Short Courses Xinran Hu 1 Laboratory for Interdisciplinary Statistical Analysis LISA helps VT researchers benefit from the use of Statistics Collaboration: Visit our
Knocker main application User manual Author: Jaroslav Tykal Application: Knocker.exe Document Main application Page 1/18 U Content: 1 START APPLICATION... 3 1.1 CONNECTION TO DATABASE... 3 1.2 MODULE DEFINITION...
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
Intro to Databases ACM Webmonkeys 2011 Motivation Computer programs that deal with the real world often need to store a large amount of data. E.g.: Weather in US cities by month for the past 10 years List
G563 Quantitative Paleontology Department of Geological Sciences P. David Polly Introduction to MySQL and phpmyadmin PhpMyAdmin Interface phpmyadmin is a web-based interface to a MySQL server. The interface
CwJ Consulting Ltd SQL Server Table Design - Best Practices Author: Andy Hogg Date: 20 th February 2015 Version: 1.11 SQL Server Table Design Best Practices 1 Contents 1. Introduction... 3 What is a table?...
White Paper In the past few years, SQL Injection attacks have been on the rise. The increase in the number of Database based applications, combined with various publications that explain the problem and
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
Errors That Can Occur When You re Running a Report From Tigerpaw s SQL-based System (Version 9 and Above) Modified 10/2/2008 1 Introduction The following is an explanation of some errors you might encounter
Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics Structured Query Language HANS- PETTER HALVORSEN, 2014.03.03 Faculty of Technology, Postboks 203,
Automatic Threshold Values and Variables In this lesson, we re going to look a little deeper into the world of values, and pay special attention to the programming structures that are used to represent
LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.
Normalization of databases Database normalization is a technique of organizing the data in the database. Normalization is a systematic approach of decomposing tables to eliminate data redundancy and undesirable
Oracle Academy Introduction to Database Programming with Instructor Resource Guide INSTRUCTOR NOTES FOR SLIDES SECTION 1 LESSON 1 Introduction to Slide 1: Introduction to Slide 2: What Will I Learn? Slide
: 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 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
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
Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4) The purpose of this document is to help a beginner to install all the elements necessary to use NWNX4. Throughout
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
3 CHAPTER 1 Overview of SAS/ACCESS Interface to Relational Databases About This Document 3 Methods for Accessing Relational Database Data 4 Selecting a SAS/ACCESS Method 4 Methods for Accessing DBMS Tables
INTEGRATING MICROSOFT DYNAMICS CRM WITH SIMEGO DS3 Often the most compelling way to introduce yourself to a software product is to try deliver value as soon as possible. Simego DS3 is designed to get you
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
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
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.
CST 250 MySQL Notes (Source: www.w3schools.com) MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database objects called tables.
Lukas Smith database abstraction layers in PHP BackendMedia 1 Overview Introduction Motivation PDO extension PEAR::MDB2 Client API SQL syntax SQL concepts Result sets Error handling High level features
MIGRATION GUIDE Database Migration from MySQL to RDM Server A Birdstep Technology, Inc. Raima Embedded Database Division Migration Guide Published: May, 2009 Author: Daigoro F. Toyama Senior Software Engineer
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
Creating Tables A basic create statement for a simple student table would look like the following. create table Student (SID varchar(10), FirstName varchar(30), LastName varchar(30), EmailAddress varchar(30));
Oracle University Contact Us: 1.800.529.0165 MySQL for Beginners Ed 3 Duration: 4 Days What you will learn The MySQL for Beginners course helps you learn about the world's most popular open source database.
PHP MySQL COURSE WITH OOP COURSE COVERS: PHP MySQL OBJECT ORIENTED PROGRAMMING WITH PHP SYLLABUS PHP 1. Writing PHP scripts- Writing PHP scripts, learn about PHP code structure, how to write and execute
Using Query Manager to Create Ad Hoc Queries June 2013 Table of Contents USING QUERY MANAGER TO CREATE AD HOC QUERIES... 1 COURSE AUDIENCES AND PREREQUISITES...ERROR! BOOKMARK NOT DEFINED. LESSON 1: BASIC
The Entity- Relationship Model R &G - Chapter 2 A relationship, I think, is like a shark, you know? It has to constantly move forward or it dies. And I think what we got on our hands is a dead shark. Woody
QlikView 11.2 SR5 DIRECT DISCOVERY FAQ and What s New Published: November, 2012 Version: 5.0 Last Updated: December, 2013 www.qlikview.com 1 What s New in Direct Discovery 11.2 SR5? Direct discovery in
ESSBASE ASO TUNING AND OPTIMIZATION FOR MERE MORTALS Tracy, interrel Consulting Essbase aggregate storage databases are fast. Really fast. That is until you build a 25+ dimension database with millions
N o r m a l i z a t i o n One of the most important factors in software development is database definition. If your tables are not set up properly, it can cause you a lot of headaches down the road when
Technology Foundations Conan C. Albrecht, Ph.D. Overview 9. Human Analysis Reports 8. Create Reports 6. Import Data 7. Primary Analysis Data Warehouse 5. Transfer Data as CSV, TSV, or XML 1. Extract Data
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
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
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
Programming Database lectures for mathematics students April 25, 2015 Functions Functions are defined in Postgres with CREATE FUNCTION name(parameter type,...) RETURNS result-type AS $$ function-body $$
Using Excel as a Management Reporting Tool with your Minotaur Data with Judith Kirkness These instruction sheets will help you learn: 1. How to export reports from Minotaur to Excel (these instructions
Using Excel As A Database Access is a great database application, but let s face it sometimes it s just a bit complicated! There are a lot of times when it would be nice to have some of the capabilities
Chapter 2 Encoding Text with a Small Alphabet Given the nature of the Internet, we can break the process of understanding how information is transmitted into two components. First, we have to figure out
Your consent to our cookies if you continue to use this website.