Revision [7616]

This is an old revision of ResearchSQLTutorial made by JasonChow on 2013-02-05 08:25:39.

 

SQL stands for Structured Query Language, and is used as a way to manipulate, store, and retrieve information in many relational databases. To learn more, you can read the link to the Wikipedia page above. At PVS we use the PostgreSQL implementation of SQL. In this tutorial we will focus on the SELECT command to retrieve information stored in our SQL database.

First off, a brief description of how information is stored in an SQL database. You should be familiar with how spreadsheets are laid out at this point. if not, please ask a director to provide you access to, 'The_Long_Spreadsheet_Guide' in Google Docs and examine it before proceeding.

Spreadsheets store information in what looks like a two-dimensional table with an x and y axis (example below).

ABCD
1A1B1C1D1
2A2B2C2The Mighty Ducks
3A3B3C3D3
4D4B4C4D4

Cells in spreadsheets are referenced by their position in the grid of the table. In the example above, 'The Mighty Ducks' is displayed in cell D2. Using a spreadsheet to store information is a quick and easy solution for MOST data, however we run into issues with repeating data, and large files sizes among others. Also it may be more difficult to standardize data entry and display if data is directly entered into a spreadsheet. What if we had a large spreadsheet for candidates running for elections in a particular state? We may have something that looks like the table below, and imagine if we have even more data associated with each row, there could be an infinite number of columns.

ABCD
1Schumer, ChuckNYU.S. Senate2010
2Charles SchumerNYU.S. Senate2004
3Chuck Ellis SchumerNew YorkU.S. Senate1998
4SchumerNew YorkU.S. House District 91992
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki