Differences between revisions 6 and 8 (spanning 2 versions)
Revision 6 as of 2007-04-05 18:54:35
Size: 1766
Editor: biodhcp-185-86
Comment:
Revision 8 as of 2007-04-05 18:58:10
Size: 1725
Editor: biodhcp-185-86
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The Basics 2  The Basics 2
Line 5: Line 5:
    Case sensitivity 2
Line 6: Line 7:
Case sensitivity 2     Conventions in SQL syntax 2
Line 8: Line 9:
    Quotation marks 2
Line 9: Line 11:
Conventions in SQL syntax 2     Data Types 3
Line 11: Line 13:
                Character 3
Line 12: Line 15:
Quotation marks 2                 Number 3
Line 14: Line 17:
 Data Types 3                 Date 3
Line 16: Line 19:
                Time 3
Line 17: Line 21:
Character 3 Retrieving Data from a Table 3
Line 19: Line 23:
Retrieving columns with SELECT and FROM 4
Line 20: Line 25:
Number 3 Eliminating duplicate rows with DISTINCT 4
Line 22: Line 27:
Filtering rows with WHERE 4
Line 23: Line 29:
Date 3 Comparisons 5
Line 25: Line 31:
Combining and negating conditions with AND, OR, and NOT 6
Line 26: Line 33:
Time 3 Matching patterns with LIKE 6
Line 28: Line 35:
Range filtering with BETWEEN 7
Line 29: Line 37:
Retrieving Data from a Table 3 List filtering with IN 7
Line 31: Line 39:
Testing for blanks or nulls with NULL 7
Line 32: Line 41:
Retrieving columns with SELECT and FROM 4 Sorting rows with ORDER BY 8
Line 34: Line 43:
Creating column aliases with AS 8
Line 35: Line 45:
Eliminating duplicate rows with DISTINCT 4 Operators and Functions 9
Line 37: Line 47:
Performing Arithmetic Operations 9
Line 38: Line 49:
Filtering rows with WHERE 4 Summarizing and Grouping Data 9
Line 40: Line 51:
Aggregate Functions 9
Line 41: Line 53:
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
COUNT 9
Line 82: Line 57:
 AVG 10   . AVG 10
Line 84: Line 59:
SUM 10
Line 85: Line 61:
SUM 10 FLOOR and CEILING 10
Line 87: Line 63:

FLOOR and CEILING 10


Grouping rows with GROUP BY 11  
Grouping rows with GROUP BY 11
Line 96: Line 67:
 Retrieving Data from Multiple Tables 12    . Retrieving Data from Multiple Tables 12
Line 101: Line 71:
 Creating joins with JOIN or WHERE 12   . Creating joins with JOIN or WHERE 12
Line 103: Line 73:
Selecting Columns from two or more tables with WHERE 12
Line 104: Line 75:
Selecting Columns from two or more tables with WHERE 12 Join two or more tables using JOIN 13
Line 106: Line 77:
Schemas 15
Line 107: Line 79:
Join two or more tables using JOIN 13 Saving your query result INTO a new table 16
Line 109: Line 81:
Queries with multiple SELECT statements 16
Line 110: Line 83:
Schemas 15 Temporary tables 16
Line 112: Line 85:
Deleting tables 16
Line 113: Line 87:
Saving your query result INTO a new table 16 Importing Tables into your schema 16
Line 115: Line 89:
Exporting Tables 17
Line 116: Line 91:
Queries with multiple SELECT statements 16 Sandbox 17
Line 118: Line 93:
Permissions 17
Line 119: Line 95:
Temporary tables 16 Permissions 18
Line 121: Line 97:
Views 18
Line 122: Line 99:
Deleting tables 16 Saving your queries 18
Line 124: Line 101:

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
A Couple Useful Queries 19

SQL and phpPgAdmin for BaBase

The Basics 2

  • Case sensitivity 2 Conventions in SQL syntax 2 Quotation marks 2 Data Types 3
    • Character 3 Number 3 Date 3 Time 3

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

  • AVG 10

SUM 10

FLOOR and CEILING 10

Grouping rows with GROUP BY 11

Filtering groups with HAVING 11

  • Retrieving Data from Multiple Tables 12

Qualifying column names 12

  • Creating joins with JOIN or WHERE 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

SQL_Language (last edited 2021-09-09 19:49:10 by JakeGordon)

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.