SQL : PostgreSQL

  Aggregate Functions Like most other relational database products,  PostgreSQL  supports  aggregate functions . An aggregate function computes a single result from multiple input rows. For example, there are aggregates to compute the  count ,  sum ,  avg  (average),  max  (maximum) and  min  (minimum) over a set of rows. As an example, we can find the highest low-temperature reading anywhere with: SELECT max(temp_lo) FROM weather; max ----- 46 (1 row) If we wanted to know what city (or cities) that reading occurred in, we might try: SELECT city FROM weather WHERE temp_lo = max(temp_lo); WRONG but this will not work since the aggregate  max  cannot be used in the  WHERE  clause. (This restriction exists because the  WHERE  clause determines which rows will be included in the aggregate calculation; so obviously it has to be evaluated before aggregate functions are computed.) However, as is o...

SQLite tutorial

 https://www.tutorialspoint.com/sqlite/index.htm

This module's primary focus was to introduce the world of SQL to you and to get you started with a few simple querying techniques. Attached to this posting, are a few good, quality overviews of SQL that go into a little bit more depth than what we can cover in our lecture videos. I encourage you to check out and review one or more of these resources.

We introduced ER diagrams and the concept of database modeling in this module. Naturally, these are deep topics and we barely scratched the surface in our lecture videos. I encourage you to review some of the resources below to learn more about these topics in more depth.

CREDIT : UC DAVIS

Comments

Popular posts from this blog

Using BigQuery / MySQL / other SQL

SQL : PostgreSQL

About spreadsheet basics