SQL and phpPgAdmin for BaBase

[:SQL Language - The Basics:The Basics 2]

Retrieving Data from a Table 3

Retrieving columns with SELECT and FROM 4

Eliminating duplicate rows with DISTINCT 4

Filtering rows with WHERE 4

Comparisons 5

Combining and negating conditions with AND, OR, and NOT 6

Matching patterns with LIKE 6

Range filtering with BETWEEN 7

List filtering with IN 7

Testing for blanks or nulls with NULL 7

Sorting rows with ORDER BY 8

Creating column aliases with AS 8

Operators and Functions 9

Performing Arithmetic Operations 9

Summarizing and Grouping Data 9

Aggregate Functions 9

COUNT 9

MIN and MAX 10

SUM 10

FLOOR and CEILING 10

Grouping rows with GROUP BY 11

Filtering groups with HAVING 11

Qualifying column names 12

Selecting Columns from two or more tables with WHERE 12

Join two or more tables using JOIN 13

Schemas 15

Saving your query result INTO a new table 16

Queries with multiple SELECT statements 16

Temporary tables 16

Deleting tables 16

Importing Tables into your schema 16

Exporting Tables 17

Sandbox 17

Permissions 17

Permissions 18

Views 18

Saving your queries 18

A Couple Useful Queries 19

Calculate Age 19

Wiki content based upon work supported by the National Science Foundation under Grant Nos. 0323553 and 0323596. Any opinions, findings, conclusions or recommendations expressed in this material are those of the wiki contributor(s) and do not necessarily reflect the views of the National Science Foundation.