GEO 425: SPRING 2012 LAB 9: Introduction to Postgresql and SQL

Size: px
Start display at page:

Download "GEO 425: SPRING 2012 LAB 9: Introduction to Postgresql and SQL"

Transcription

1 GEO 425: SPRING 2012 LAB 9: Introduction to Postgresql and SQL Objectives: This lab is designed to introduce you to Postgresql, a powerful database management system. This exercise covers: 1. Starting and using the basic operations of the Postgresql interpreter. 2. Importing tables from dump (SQL) files. 3. Basic and intermediate queries using SQL. Task Overview Create a new directory under your labs folder called lab09. Next, save the data files from the course web page to that directory. Start and stop the Postgresql interpreter. Import the tables from the data files. Use SQL to query the tables in increasingly interesting ways. Complete the ten questions comprising the report and provide them to your TA. Remember to log out! About Postgresql Postgresql is a relational database management system (RDBMS). It is mature and widely used for all kinds of large and small database applications, including those using spatial data. Postgresql is free software; you can install and use it on your own computer for free. The main website is: Postgresql data are stored in relations, or tables. Like other major database packages, postgresql uses standard query language (SQL) to interact with your data. Postgresql is a more powerful database program, but you ll recognize the SQL syntax from queries you ve done in other programs like ArcGIS. As it is for many of the heacy hitting programs out there, the basic interface for postgresql is from the command line. This lab will introduce you to postgresql and help you get more adept at using SQL generally. At a fundamental level, you will work with data stored in one or more tables (relations), all of which are stored in a particular database. To work with that data, you have to connect to the database server with a catch-all command: psql. You can create tables, fill them with data, and do analysis. Note that you do not work directly with table files - the DBMS takes care of that, and in fact you don't see them in your directories or have the ability to modify them with UNIX commands, as opposed to psql commands. About the Data Two datasets about Michigan are available for this lab. Both are spatial datasets; the unit of analysis is the county. One contains a variety of census data aggregated for each Michigan county. The other contains voting data by county for the 2008 Presidential election. These datasets are stored in two files: census.sql and election.sql. They will need to be 'restored' as tables within postgresql before they can be abused with SQL queries. Page 1

2 Instructions Step 1: Import the data 1. Open a terminal window on your desktop. 2. If you haven't already, create a directory called labs in your home folder. You can do this with the file manager application, or from the command line with: mkdir ~/labs 3. Create a directory called lab09 under labs, perhaps with: mkdir ~/labs/lab09 4. Use a web browser to download census.sql and election.sql from the lab web page to the lab09 directory. (Hint: A right-click, then Save As may work best here or otherwise the browser may simply display the contents of the file) 5. In the terminal window, change your location to this directory: cd ~/labs/lab09 Type ls -l (lower case L). Do you see the files you downloaded? 6. Type more census.sql. This lists the contents of the census.sql file to the screen. Since this is a text file, you can read it. Hit space to scroll down. This file actually contains the commands to construct a table and populate it with data; all the commands are postgresql and basic SQL instructions. Note lines like CREATE TABLE and ALTER TABLE and COPY: those are SQL. Hit q to exit back to the UNIX prompt. 7. To build those tables, you are going to execute the workhorse postgresql command psql and pipe the contents of each of the downloaded file to it. Here's the command to do the census table, assuming your location is the same directory as that with the census.sql file (but don't type it yet!): psql [database name] < census.sql But you need to figure out what the database is and insert that in place of the brackets. To list all existing databases available to you, type the following in the terminal window (those are lower-case 'L' s here): psql -l You will be asked for your password; use the original password you got for your Geo 425 class account. There should only be one database that you own printed in this list. Write down the name of the database that you own: Now write down the command syntax to use psql to load the census table to your existing database (look 3 paragraphs up): Execute it. Type your password. You will get an error about the ownership of the table, but you can ignore it. Then try loading the election table as well. Note: Do not run the psql [database name] < census.sql command twice - it will load the data twice into the table, so you will have duplicate records (e.g. two Ingham County records). Page 2

3 Step 2: Using the SQL interpreter 1. Start the command line interpreter with: psql [database name] where [database name] is the database where you stored those tables. Type your password when prompted. Some info appears and you should have a new prompt: => Note: This is NOT the normal command line prompt! Linux commands won't work here! 2. Aside from SQL commands, postgresql instructions from this prompt are 'slash' commands. A number are listed at the end of this lab. The most important is \q. Type this now. You're back at the UNIX prompt, having exited the interpreter. Go ahead and start the interpreter again. 3. Another slash command lists tables: \d How many tables are there? Who owns them? 4. You can also describe all the fields in a table. Type: \d census Use the up and down arrows to look at the fields in that table, if it doesn't all fit on the screen. How many fields are there? Use Q or q to quit back to the interpreter, if the list is longer than your terminal window. 5. The interpreter tracks previous commands you typed. At the interpreter prompt, hit the up arrow. Hit it again. Do this to go back and rerun old commands, or to fix the syntax on a command you mistyped. Step 3: Basic queries 1. The classic query selects all records in a table. Try this: SELECT * FROM census; The * is the wildcard for every row. You have to put the semicolon on, or the interpreter will assume you want to type more. The output is a scrollable 'text table'. You may need to push the space bar to get all of it printed to your window. After the table is all there (the darkened More-- text goes away), then you can use the window arrows to scroll up and down through the records. Expand your terminal window if all of the fields are not shown. What is the last county in Michigan, alphabetically? 2. Write down the SQL command to select all records in the election table: Run it and examine the output. Did you notice any duplicate records? Everything look ok? 3. If you saw duplicates, you will need to delete that table and then reload it. To delete a table, type: DROP TABLE [table name]; After dropping the table, quit the interpreter and run the psql command to import the table again. Then restart the interpreter and continue. 4. Multiline commands are definitely allowed and can be easier to read. To type a command on more than one line, simply hit enter, like this: SELECT * FROM census; Note that I am capitalizing the SQL-specific commands and not capitalizing table (and field) names. That's pretty standard style, but is it necessary? Try typing: select * from CENSUS; Did that work? 5. Instead of the wildcard that gets you all fields, let's select a single field - how about name? Type: Page 3

4 SELECT name FROM census; Interesting, but not very informative. How about a couple of fields? SELECT name, pop FROM census; 6. You can also select subsets of records. Try this: SELECT name, pop FROM census WHERE name = 'Ingham'; What does this next one do? SELECT name, pop FROM census WHERE pop > ; What is the biggest county by population in the state? 7. It would be nice to be able to sort your query results so that the largest (or smallest) are on top. Well, that is possible! Try this: SELECT name, pop, land_area_mi FROM census WHERE pop > ORDER BY pop; As your SQL statements get longer it becomes more useful to write them on multiple lines. Note that in the last example the order was ascending. To order the other way, with the largest first, try this: SELECT name, pop, land_area_mi FROM census WHERE pop > ORDER BY pop DESC; Remember, you don t have to retype all of these. You can use the up arrow to get previous commands you entered and then you can edit them. 8. Queries can employ conditions that use more than one field. You might want to see which counties had more McCain votes than Obama votes; that is, where the mccain field is larger than the value in the obama field. No problem: WHERE mccain > obama; That's nice, but what about ordering it in terms of the margin of victory? You will use ORDER, but how? Read and then execute this command: WHERE mccain > obama ORDER BY mccain-obama DESC; mccain - obama is an operation; it subtracts the obama vote for each county from the mccain vote. Larger numbers mean relatively more McCain votes. Suppose you want to know which county had the largest margin of victory, regardless of which candidate won. You already did one like this: you need something like mcain-obama. However, if Obama won big, this number will be negative. What you want is the absolute value of this difference. Recall that the absolute value of -3 is 3; the absolute value of -99 is 99, and so on. This is easy to calculate in SQL: ORDER BY ABS(mccain-obama) DESC; Note that we didn't use a WHERE statement in this one. 9. Queries can involve multiple variables. For example, suppose you want to find all of the counties in which the Page 4

5 Obama vote was above 40,000 and the McCain vote was below 30,000: SELECT county, obama, mccain from election WHERE obama > AND mccain < ORDER BY obama DESC; AND means that both conditions must be met. OR means one or both can be met. Report For each of the following questions, write down the postgresql command you used as well as the answer. Do this in a text editor. your TA with the answers. 1. How many fields are in the election table? 2. What is the population of Oscoda County? 3. What is the name of the county with exactly people? 4. Which counties had more than 100,000 votes for Obama? 5. Which counties had more than 100,000 votes for McCain? 6. What county is farthest north, according to the census data? 7. What is the largest Michigan county, in terms of land area? How many square miles is it? 8. How many counties had a margin of less than 100 votes between Obama and McCain? (hint: use ABS so you can include counties that went for either candidate). 9. How many counties south of latitude 45N have a population less than 50,000 and a land area of more than 550 square miles? 10. Which counties had at least 5% as many votes for 'other' as for McCain? Hints When you experience an error message, spend a moment trying to figure it out. Problems mostly involve typing mistakes or being situated in the wrong location. IMPORTANT: Make sure you log out every time you finish in the lab!!! Some helpful Postgresql commands: psql -l (from unix prompt) Lists databases psql [dbname] (from unix prompt) Starts interactive interpreter in [dbname] \q Quits interpreter \d List tables in database \d [tablename] Describe fields in [tablename] Some helpful SQL commands: SELECT [field/s] FROM [table]; Generic query statement. * Wildcard all fields, e.g. SELECT * from [table]; WHERE [condition] Modify query AND [condition] Logical AND an additional query modifier OR [condition] Logical OR an additional query modifier ORDER BY [field] Modify order of query output DESC In descending order of magnitude ABS(expression) Numerical operator: absolute value of the value (could be a field) DROP TABLE [name]; Delete a table Page 5

GEO 425: SPRING 2012 LAB 10: Intermediate Postgresql and SQL

GEO 425: SPRING 2012 LAB 10: Intermediate Postgresql and SQL GEO 425: SPRING 2012 LAB 10: Intermediate Postgresql and SQL Objectives: In the introductory SQL lab you worked with basic queries on two tables. This lab builds on that one by providing more advanced

More information

Lesson 1: Creating and formatting an Answers analysis

Lesson 1: Creating and formatting an Answers analysis Lesson 1: Creating and formatting an Answers analysis Answers is the ad-hoc query environment in the OBIEE suite. It is in Answers that you create and format analyses to help analyze business results.

More information

This has both postgres and postgis included. You need to enable postgis by running the following statements

This has both postgres and postgis included. You need to enable postgis by running the following statements 1 Lab 0 (2016) Installing Initial Software for Spatial Databases Course Lecturer Pat Browne This note describes how to install some of the course software on Windows 7. Lab0 only covers installation for

More information

1. Managing Information in Table

1. Managing Information in Table 1. Managing Information in Table Spreadsheets are great for making lists (such as phone lists, client lists). The researchers discovered that not only was list management the number one spreadsheet activity,

More information

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Objective: Learn some basic aspects of the UNIX operating system and how to use it. What is UNIX? UNIX is the operating system used by most computers

More information

Lab 7: Tables Operations in ArcMap

Lab 7: Tables Operations in ArcMap Lab 7: Tables Operations in ArcMap What You ll Learn: This Lab provides more practice with tabular data management in ArcMap. In this Lab, we will view, select, re-order, and update tabular data. You should

More information

Easy Windows Working with Disks, Folders, - and Files

Easy Windows Working with Disks, Folders, - and Files Easy Windows 98-3 - Working with Disks, Folders, - and Files Page 1 of 11 Easy Windows 98-3 - Working with Disks, Folders, - and Files Task 1: Opening Folders Folders contain files, programs, or other

More information

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing

More information

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting Slide 1: Cover Welcome to lesson 3 of the db2 on Campus lecture series. Today we're going to talk about tools and scripting, and this is part 1 of 2

More information

Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory

Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory 1 Logging In When you sit down at a terminal and jiggle the mouse to turn off the screen saver, you will be confronted with a window

More information

CMSC 201 Spring 2017 Lab 05 Lists

CMSC 201 Spring 2017 Lab 05 Lists CMSC 201 Spring 2017 Lab 05 Lists Assignment: Lab 05 Lists Due Date: During discussion, February 27th through March 2nd Value: 10 points (8 points during lab, 2 points for Pre Lab quiz) This week s lab

More information

CSC Web Programming. Introduction to SQL

CSC Web Programming. Introduction to SQL CSC 242 - Web Programming Introduction to SQL SQL Statements Data Definition Language CREATE ALTER DROP Data Manipulation Language INSERT UPDATE DELETE Data Query Language SELECT SQL statements end with

More information

Setup of PostgreSQL, pgadmin and importing data. CS3200 Database design (sp18 s2) Version 2/9/2018

Setup of PostgreSQL, pgadmin and importing data. CS3200 Database design (sp18 s2)   Version 2/9/2018 Setup of PostgreSQL, pgadmin and importing data CS3200 Database design (sp18 s2) https://course.ccs.neu.edu/cs3200sp18s2/ Version 2/9/2018 1 Overview This document covers 2 issues: 1) How to install PostgreSQL:

More information

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java) Goals - to learn how to compile and execute a Java program - to modify a program to enhance it Overview This activity will introduce you to the Java programming language. You will type in the Java program

More information

Text Input and Conditionals

Text Input and Conditionals Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()

More information

LAB 6 Testing the ALU

LAB 6 Testing the ALU Goals LAB 6 Testing the ALU Learn how to write testbenches in Verilog to verify the functionality of the design. Learn to find and resolve problems (bugs) in the design. To Do We will write a Verilog testbench

More information

Unix Computer To open MATLAB on a Unix computer, click on K-Menu >> Caedm Local Apps >> MATLAB.

Unix Computer To open MATLAB on a Unix computer, click on K-Menu >> Caedm Local Apps >> MATLAB. MATLAB Introduction This guide is intended to help you start, set up and understand the formatting of MATLAB before beginning to code. For a detailed guide to programming in MATLAB, read the MATLAB Tutorial

More information

STOP DROWNING IN DATA. START MAKING SENSE! An Introduction To SQLite Databases. (Data for this tutorial at

STOP DROWNING IN DATA. START MAKING SENSE! An Introduction To SQLite Databases. (Data for this tutorial at STOP DROWNING IN DATA. START MAKING SENSE! Or An Introduction To SQLite Databases (Data for this tutorial at www.peteraldhous.com/data) You may have previously used spreadsheets to organize and analyze

More information

CMSC 201 Fall 2016 Lab 09 Advanced Debugging

CMSC 201 Fall 2016 Lab 09 Advanced Debugging CMSC 201 Fall 2016 Lab 09 Advanced Debugging Assignment: Lab 09 Advanced Debugging Due Date: During discussion Value: 10 points Part 1: Introduction to Errors Throughout this semester, we have been working

More information

Tutorial 1: Unix Basics

Tutorial 1: Unix Basics Tutorial 1: Unix Basics To log in to your ece account, enter your ece username and password in the space provided in the login screen. Note that when you type your password, nothing will show up in the

More information

CSE115 Lab exercises for week 1 of recitations Spring 2011

CSE115 Lab exercises for week 1 of recitations Spring 2011 Introduction In this first lab you will be introduced to the computing environment in the Baldy 21 lab. If you are familiar with Unix or Linux you may know how to do some or all of the following tasks.

More information

Finding MATLAB on CAEDM Computers

Finding MATLAB on CAEDM Computers Lab #1: Introduction to MATLAB Due Tuesday 5/7 at noon This guide is intended to help you start, set up and understand the formatting of MATLAB before beginning to code. For a detailed guide to programming

More information

An introduction to Linux Part 4

An introduction to Linux Part 4 An introduction to Linux Part 4 Open a terminal window (Ctrl-Alt-T) and follow along with these step-by-step instruction to learn some more about how to navigate in the Linux Environment. Open the terminal

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Introduction: MATLAB is a powerful high level scripting language that is optimized for mathematical analysis, simulation, and visualization. You can interactively solve problems

More information

MITOCW watch?v=4dj1oguwtem

MITOCW watch?v=4dj1oguwtem MITOCW watch?v=4dj1oguwtem PROFESSOR: So it's time to examine uncountable sets. And that's what we're going to do in this segment. So Cantor's question was, are all sets the same size? And he gives a definitive

More information

Using IDLE for

Using IDLE for Using IDLE for 15-110 Step 1: Installing Python Download and install Python using the Resources page of the 15-110 website. Be sure to install version 3.3.2 and the correct version depending on whether

More information

Use mail merge to create and print letters and other documents

Use mail merge to create and print letters and other documents Use mail merge to create and print letters and other documents Contents Use mail merge to create and print letters and other documents... 1 Set up the main document... 1 Connect the document to a data

More information

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information Tutorial A database is a computerized record keeping system used to collect, store, analyze and report electronic information for a variety of purposes. Microsoft Access is a database. There are three

More information

BE Share. Microsoft Office SharePoint Server 2010 Basic Training Guide

BE Share. Microsoft Office SharePoint Server 2010 Basic Training Guide BE Share Microsoft Office SharePoint Server 2010 Basic Training Guide Site Contributor Table of Contents Table of Contents Connecting From Home... 2 Introduction to BE Share Sites... 3 Navigating SharePoint

More information

User's Guide c-treeace SQL Explorer

User's Guide c-treeace SQL Explorer User's Guide c-treeace SQL Explorer Contents 1. c-treeace SQL Explorer... 4 1.1 Database Operations... 5 Add Existing Database... 6 Change Database... 7 Create User... 7 New Database... 8 Refresh... 8

More information

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based. Unix tutorial Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based. Terminal windows You will use terminal windows to enter and execute

More information

One of the hardest things you have to do is to keep track of three kinds of commands when writing and running computer programs. Those commands are:

One of the hardest things you have to do is to keep track of three kinds of commands when writing and running computer programs. Those commands are: INTRODUCTION Your first daily assignment is to modify the program test.py to make it more friendly. But first, you need to learn how to edit programs quickly and efficiently. That means using the keyboard

More information

Unix Tutorial Haverford Astronomy 2014/2015

Unix Tutorial Haverford Astronomy 2014/2015 Unix Tutorial Haverford Astronomy 2014/2015 Overview of Haverford astronomy computing resources This tutorial is intended for use on computers running the Linux operating system, including those in the

More information

Introduction to ArcGIS for Brushy Creek

Introduction to ArcGIS for Brushy Creek Introduction to ArcGIS for Brushy Creek Course exercise for CE 374K Hydrology University of Texas at Austin Prepared by Sili Liu and David R. Maidment January, 2012 DESCRIPTION A geographic information

More information

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab MATH 495.3 (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab Below is a screen similar to what you should see when you open Matlab. The command window is the large box to the right containing the

More information

Barchard Introduction to SPSS Marks

Barchard Introduction to SPSS Marks Barchard Introduction to SPSS 22.0 3 Marks Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data

More information

Working with Attribute Data and Clipping Spatial Data. Determining Land Use and Ownership Patterns associated with Streams.

Working with Attribute Data and Clipping Spatial Data. Determining Land Use and Ownership Patterns associated with Streams. GIS LAB 3 Working with Attribute Data and Clipping Spatial Data. Determining Land Use and Ownership Patterns associated with Streams. One of the primary goals of this course is to give you some hands-on

More information

1. Managing Information in Table

1. Managing Information in Table 1. Managing Information in Table Spreadsheets are great for making lists (such as phone lists, client lists). The researchers discovered that not only was list management the number one spreadsheet activity,

More information

Lab #2 Physics 91SI Spring 2013

Lab #2 Physics 91SI Spring 2013 Lab #2 Physics 91SI Spring 2013 Objective: Some more experience with advanced UNIX concepts, such as redirecting and piping. You will also explore the usefulness of Mercurial version control and how to

More information

How to make a Work Profile for Windows 10

How to make a Work Profile for Windows 10 How to make a Work Profile for Windows 10 Setting up a new profile for Windows 10 requires you to navigate some screens that may lead you to create the wrong type of account. By following this guide, we

More information

Introductory Exercises in Microsoft Access XP

Introductory Exercises in Microsoft Access XP INFORMATION SYSTEMS SERVICES Introductory Exercises in Microsoft Access XP This document contains a series of exercises which give an introduction to the Access relational database program. AUTHOR: Information

More information

version staff had them to share viewing this this user guide. >Reports, as Logging In the SQL login User Name for your district. perform the guides.

version staff had them to share viewing this this user guide. >Reports, as Logging In the SQL login User Name for your district. perform the guides. This report is available for use by all administrative and teaching staff. Data presented in the report is organized by teacher s rosters. The report has been shown to several districts and the teaching

More information

CS/CIS 249 SP18 - Intro to Information Security

CS/CIS 249 SP18 - Intro to Information Security Lab assignment CS/CIS 249 SP18 - Intro to Information Security Lab #2 - UNIX/Linux Access Controls, version 1.2 A typed document is required for this assignment. You must type the questions and your responses

More information

Stat Wk 3. Stat 342 Notes. Week 3, Page 1 / 71

Stat Wk 3. Stat 342 Notes. Week 3, Page 1 / 71 Stat 342 - Wk 3 What is SQL Proc SQL 'Select' command and 'from' clause 'group by' clause 'order by' clause 'where' clause 'create table' command 'inner join' (as time permits) Stat 342 Notes. Week 3,

More information

Downloading shapefiles and using essential ArcMap tools

Downloading shapefiles and using essential ArcMap tools CHAPTER 1 KEY CONCEPTS downloading shapefiles learning essential tools exploring the ArcMap table of contents understanding shapefiles customizing shapefiles saving projects Downloading shapefiles and

More information

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information Tutorial A database is a computerized record keeping system used to collect, store, analyze and report electronic information for a variety of purposes. Microsoft Access is a database. There are three

More information

CMSC 201 Spring 2017 Lab 01 Hello World

CMSC 201 Spring 2017 Lab 01 Hello World CMSC 201 Spring 2017 Lab 01 Hello World Assignment: Lab 01 Hello World Due Date: Sunday, February 5th by 8:59:59 PM Value: 10 points At UMBC, our General Lab (GL) system is designed to grant students the

More information

CMSC 201 Spring 2019 Lab 06 Lists

CMSC 201 Spring 2019 Lab 06 Lists CMSC 201 Spring 2019 Lab 06 Lists Assignment: Lab 06 Lists Due Date: Thursday, March 7th by 11:59:59 PM Value: 10 points This week s lab will put into practice the concepts you learned about lists: indexing,

More information

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt

More information

Introduction to Unix - Lab Exercise 0

Introduction to Unix - Lab Exercise 0 Introduction to Unix - Lab Exercise 0 Along with this document you should also receive a printout entitled First Year Survival Guide which is a (very) basic introduction to Unix and your life in the CSE

More information

Tutorial 4 - Attribute data in ArcGIS

Tutorial 4 - Attribute data in ArcGIS Tutorial 4 - Attribute data in ArcGIS COPY the Lab4 archive to your server folder and unpack it. The objectives of this tutorial include: Understand how ArcGIS stores and structures attribute data Learn

More information

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28 Programming Lab 1 (JS Hwk 3) Due Thursday, April 28 Lab You may work with partners for these problems. Make sure you put BOTH names on the problems. Create a folder named JSLab3, and place all of the web

More information

MITOCW ocw f99-lec07_300k

MITOCW ocw f99-lec07_300k MITOCW ocw-18.06-f99-lec07_300k OK, here's linear algebra lecture seven. I've been talking about vector spaces and specially the null space of a matrix and the column space of a matrix. What's in those

More information

Chapter 6. Building Maps with ArcGIS Online

Chapter 6. Building Maps with ArcGIS Online Chapter 6 Building Maps with ArcGIS Online Summary: ArcGIS Online is an on-line mapping software that allows you to upload tables with latitude and longitude geographic coordinates to create map layers

More information

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum

Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum Introduction to Git and GitHub for Writers Workbook February 23, 2019 Peter Gruenbaum Table of Contents Preparation... 3 Exercise 1: Create a repository. Use the command line.... 4 Create a repository...

More information

GIS Exercise 10 March 30, 2018 The USGS NCGMP09v11 tools

GIS Exercise 10 March 30, 2018 The USGS NCGMP09v11 tools GIS Exercise 10 March 30, 2018 The USGS NCGMP09v11 tools As a result of the collaboration between ESRI (the manufacturer of ArcGIS) and USGS, ESRI released its Geologic Mapping Template (GMT) in 2009 which

More information

Statistics 13, Lab 1. Getting Started. The Mac. Launching RStudio and loading data

Statistics 13, Lab 1. Getting Started. The Mac. Launching RStudio and loading data Statistics 13, Lab 1 Getting Started This first lab session is nothing more than an introduction: We will help you navigate the Statistics Department s (all Mac) computing facility and we will get you

More information

Here we will look at some methods for checking data simply using JOSM. Some of the questions we are asking about our data are:

Here we will look at some methods for checking data simply using JOSM. Some of the questions we are asking about our data are: Validating for Missing Maps Using JOSM This document covers processes for checking data quality in OpenStreetMap, particularly in the context of Humanitarian OpenStreetMap Team and Red Cross Missing Maps

More information

Introduction to SPSS

Introduction to SPSS Introduction to SPSS Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data file and calculate

More information

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes

commands exercises Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes Linux System Administration and IP Services AfNOG 2015 Linux Commands # Notes * Commands preceded with "$" imply that you should execute the command as a general user not as root. * Commands preceded with

More information

Tutorial 1: Finding and Displaying Spatial Data Using ArcGIS

Tutorial 1: Finding and Displaying Spatial Data Using ArcGIS Tutorial 1: Finding and Displaying Spatial Data Using ArcGIS This tutorial will introduce you to the following: Websites where you may browse to find geospatial information Identifying spatial data, usable

More information

Introduction to GIS & Mapping: ArcGIS Desktop

Introduction to GIS & Mapping: ArcGIS Desktop Introduction to GIS & Mapping: ArcGIS Desktop Your task in this exercise is to determine the best place to build a mixed use facility in Hudson County, NJ. In order to revitalize the community and take

More information

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client Lab 2.0 - MySQL CISC3140, Fall 2011 DUE: Oct. 6th (Part 1 only) Part 1 1. Getting started This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client host

More information

Configuring Ubuntu to Code for the OmniFlash or OmniEP

Configuring Ubuntu to Code for the OmniFlash or OmniEP Configuring Ubuntu to Code for the OmniFlash or OmniEP Table of Contents Introduction...2 Assumptions...2 Getting Started...2 Getting the Cross Compiler for ARM...2 Extracting the contents of the compressed

More information

Post Experiment Interview Questions

Post Experiment Interview Questions Post Experiment Interview Questions Questions about the Maximum Problem 1. What is this problem statement asking? 2. What is meant by positive integers? 3. What does it mean by the user entering valid

More information

My First iphone App. 1. Tutorial Overview

My First iphone App. 1. Tutorial Overview My First iphone App 1. Tutorial Overview In this tutorial, you re going to create a very simple application on the iphone or ipod Touch. It has a text field, a label, and a button. You can type your name

More information

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel 1 In this chapter, you will learn: The basic commands

More information

AVL Loom Configuration Tool

AVL Loom Configuration Tool AVL Loom Configuration Tool This program is only for those computers running the Windows operating system. It will not run on a Mac. It is intended to be a very simple application that will not run into

More information

Barchard Introduction to SPSS Marks

Barchard Introduction to SPSS Marks Barchard Introduction to SPSS 21.0 3 Marks Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data

More information

A Brief Introduction to the Linux Shell for Data Science

A Brief Introduction to the Linux Shell for Data Science A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like

More information

Module 1: Introduction RStudio

Module 1: Introduction RStudio Module 1: Introduction RStudio Contents Page(s) Installing R and RStudio Software for Social Network Analysis 1-2 Introduction to R Language/ Syntax 3 Welcome to RStudio 4-14 A. The 4 Panes 5 B. Calculator

More information

9.2 Linux Essentials Exam Objectives

9.2 Linux Essentials Exam Objectives 9.2 Linux Essentials Exam Objectives This chapter will cover the topics for the following Linux Essentials exam objectives: Topic 3: The Power of the Command Line (weight: 10) 3.3: Turning Commands into

More information

MySQL Workshop. Scott D. Anderson

MySQL Workshop. Scott D. Anderson MySQL Workshop Scott D. Anderson Workshop Plan Part 1: Simple Queries Database concepts getting started with Cloud 9 practical skills using MySQL simple queries using SQL Part 2: Creating a database, inserting,

More information

Ph3 Mathematica Homework: Week 1

Ph3 Mathematica Homework: Week 1 Ph3 Mathematica Homework: Week 1 Eric D. Black California Institute of Technology v1.1 1 Obtaining, installing, and starting Mathematica Exercise 1: If you don t already have Mathematica, download it and

More information

Lab: Supplying Inputs to Programs

Lab: Supplying Inputs to Programs Steven Zeil May 25, 2013 Contents 1 Running the Program 2 2 Supplying Standard Input 4 3 Command Line Parameters 4 1 In this lab, we will look at some of the different ways that basic I/O information can

More information

Lab 1 Introduction to UNIX and C

Lab 1 Introduction to UNIX and C Name: Lab 1 Introduction to UNIX and C This first lab is meant to be an introduction to computer environments we will be using this term. You must have a Pitt username to complete this lab. NOTE: Text

More information

You can write a command to retrieve specified columns and all rows from a table, as illustrated

You can write a command to retrieve specified columns and all rows from a table, as illustrated CHAPTER 4 S I N G L E - TA BL E QUERIES LEARNING OBJECTIVES Objectives Retrieve data from a database using SQL commands Use simple and compound conditions in queries Use the BETWEEN, LIKE, and IN operators

More information

Chapter 4. Unix Tutorial. Unix Shell

Chapter 4. Unix Tutorial. Unix Shell Chapter 4 Unix Tutorial Users and applications interact with hardware through an operating system (OS). Unix is a very basic operating system in that it has just the essentials. Many operating systems,

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG 1 Notice Class Website http://www.cs.umb.edu/~jane/cs114/ Reading Assignment Chapter 1: Introduction to Java Programming

More information

Using Windows 7 Explorer By Len Nasman, Bristol Village Computer Club

Using Windows 7 Explorer By Len Nasman, Bristol Village Computer Club By Len Nasman, Bristol Village Computer Club Understanding Windows 7 Explorer is key to taking control of your computer. If you have ever created a file and later had a hard time finding it, or if you

More information

CMPSCI 105 Midterm Exam Solution Spring 2004 March 25, 2004 Professor William T. Verts

CMPSCI 105 Midterm Exam Solution Spring 2004 March 25, 2004 Professor William T. Verts CMPSCI 105 Midterm Exam Solution Spring 2004 March 25, 2004 Professor William T. Verts GENERAL KNOWLEDGE 8 Points Fill in your answer into the box at the left side of each question. Show your work

More information

Linux/Unix Filesystems

Linux/Unix Filesystems Linux/Unix Filesystems Objectives: The lab exercise is designed to introduce you to the linux operating system and environment employed in the Geography Department's Lab. This exercise covers: - How to

More information

Note on homework for SAS date formats

Note on homework for SAS date formats Note on homework for SAS date formats I m getting error messages using the format MMDDYY10D. even though this is listed on websites for SAS date formats. Instead, MMDDYY10 and similar (without the D seems

More information

ORACLE Reference. 2. Modify your start-up script file using Option 1 or 2 below, depending on which shell you run.

ORACLE Reference. 2. Modify your start-up script file using Option 1 or 2 below, depending on which shell you run. ORACLE Reference 1 Introduction The ORACLE RDBMS is a relational database management system. A command language called SQL*PLUS (SQL stands for Structured Query Language ) is used for working with an OR-

More information

Physics REU Unix Tutorial

Physics REU Unix Tutorial Physics REU Unix Tutorial What is unix? Unix is an operating system. In simple terms, its the set of programs that makes a computer work. It can be broken down into three parts. (1) kernel: The component

More information

GETTING STARTED GUIDE

GETTING STARTED GUIDE SETUP GETTING STARTED GUIDE About Benchmark Email Helping you turn your email list into relationships and sales. Your email list is your most valuable marketing asset. Benchmark Email helps marketers short

More information

Chapter 2 The SAS Environment

Chapter 2 The SAS Environment Chapter 2 The SAS Environment Abstract In this chapter, we begin to become familiar with the basic SAS working environment. We introduce the basic 3-screen layout, how to navigate the SAS Explorer window,

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Introduction This handout briefly outlines most of the basic uses and functions of Excel that we will be using in this course. Although Excel may be used for performing statistical

More information

STA 303 / 1002 Using SAS on CQUEST

STA 303 / 1002 Using SAS on CQUEST STA 303 / 1002 Using SAS on CQUEST A review of the nuts and bolts A.L. Gibbs January 2012 Some Basics of CQUEST If you don t already have a CQUEST account, go to www.cquest.utoronto.ca and request one.

More information

Part I. Introduction to Linux

Part I. Introduction to Linux Part I Introduction to Linux 7 Chapter 1 Linux operating system Goal-of-the-Day Familiarisation with basic Linux commands and creation of data plots. 1.1 What is Linux? All astronomical data processing

More information

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information Tutorial A database is a computerized record keeping system used to collect, store, analyze and report electronic information for a variety of purposes. Microsoft Access is a database. There are three

More information

Basics of Stata, Statistics 220 Last modified December 10, 1999.

Basics of Stata, Statistics 220 Last modified December 10, 1999. Basics of Stata, Statistics 220 Last modified December 10, 1999. 1 Accessing Stata 1.1 At USITE Using Stata on the USITE PCs: Stata is easily available from the Windows PCs at Harper and Crerar USITE.

More information

Part 6b: The effect of scale on raster calculations mean local relief and slope

Part 6b: The effect of scale on raster calculations mean local relief and slope Part 6b: The effect of scale on raster calculations mean local relief and slope Due: Be done with this section by class on Monday 10 Oct. Tasks: Calculate slope for three rasters and produce a decent looking

More information

LAB #5 Intro to Linux and Python on ENGR

LAB #5 Intro to Linux and Python on ENGR LAB #5 Intro to Linux and Python on ENGR 1. Pre-Lab: In this lab, we are going to download some useful tools needed throughout your CS career. First, you need to download a secure shell (ssh) client for

More information

STAT 113: R/RStudio Intro

STAT 113: R/RStudio Intro STAT 113: R/RStudio Intro Colin Reimer Dawson Last Revised September 1, 2017 1 Starting R/RStudio There are two ways you can run the software we will be using for labs, R and RStudio. Option 1 is to log

More information

Using the Zoo Workstations

Using the Zoo Workstations Using the Zoo Workstations Version 1.86: January 16, 2014 If you ve used Linux before, you can probably skip many of these instructions, but skim just in case. Please direct corrections and suggestions

More information

15-122: Principles of Imperative Computation

15-122: Principles of Imperative Computation 15-122: Principles of Imperative Computation Lab 0 Navigating your account in Linux Tom Cortina, Rob Simmons Unlike typical graphical interfaces for operating systems, here you are entering commands directly

More information

Contents. Session 2. COMPUTER APPLICATIONS Excel Spreadsheets

Contents. Session 2. COMPUTER APPLICATIONS Excel Spreadsheets Session 2 Contents Contents... 23 Cell Formats cont..... 24 Worksheet Views... 24 Naming Conventions... 25 Copy / Duplicate Worksheets... 27 Entering Formula & Functions... 28 Page - 23 Cell Formats cont..

More information

Geographical Information Systems Institute. Center for Geographic Analysis, Harvard University

Geographical Information Systems Institute. Center for Geographic Analysis, Harvard University Geographical Information Systems Institute Center for Geographic Analysis, Harvard University LAB EXERCISE 5: Queries, Joins: Spatial and Non-spatial 1.0 Getting Census data 1. Go to the American Factfinder

More information

A Basic Guide to Using Matlab in Econ 201FS

A Basic Guide to Using Matlab in Econ 201FS A Basic Guide to Using Matlab in Econ 201FS Matthew Rognlie February 1, 2010 Contents 1 Finding Matlab 2 2 Getting Started 2 3 Basic Data Manipulation 3 4 Plotting and Finding Returns 4 4.1 Basic Price

More information