World database using MS Access In world_access_txt.zip: cityCVS.txt countryCVS.txt countrylanguageCVS.txt CSV files. Null is empty field. MySQL's World database as three data files suitable for MS Access: Create a new blank database. External Data--Text File take defaults except for: First Row Contains Field Names (click it on) Text Qualifier is ' (instead of None) Choose my own primary key (for city and country let it use the first field, for countrylanguage choose "No primary key"). Entity integrity is enforced. There shouldn't be any errors. This creates 3 Table "objects". Click View Design to see the fields. Click View Datasheet to see the rows. In Design View of countrylanguage, select its first two fields, then click Primary Key. ---------------------------------------------------- Format?? Right-click any column header--Unhide Columns: which columns to see [Select clause] AZ ZA Sorting: choose column, click AZ or ZA [Order By] For a primary and secondary sort: first sort by secondary field, then by primary field. No sort is a sort by primary key. Filter by Selection: select a column's value (blank is null) Numeric field: filter by <, > etc Filter button: checklist of all values. Number Filters... Text Filters... Filter by Form: <>=999 Between 666 and 9999 Not Like "*i*" (use * as wildcard, not %) Is Not Null Toggle Filter remembers the filter. [Where clause] ??(Right click--Save as Query. Query object: View--SQL View) ---------------------------------------------------- All of the sorting and filtering plus Aggregate/Group functions by making a Query "object", a permanent part of the database. Create tab -- Query Design close table first. Choose table(s). Choose fields to grid. Run ! or Datasheet View to run the query. View--SQL View to see/edit/copy the ((fully parenthesized) and (qualified)) aliased SQL. Primary sort is leftmost, secondary is next... Criteria: ="NLD" >100000 <>=999 Between 666 and 999 Not Like "*i*" Is Not Null Turn on Aggregates: click Totals [E (sigma)]: choose Group By column(s) choose aggregate function(s) on other column(s) doesn't have LIMIT? Distinct f1 OK in SQL, although grid doesn't indicate. (how to do in grid???) Count(Distinct f1) not allowed? sometimes make the SQL first, then look at the GUI... or paste MySQL statement into SQL View. Relating tables (foreign key creation) Database Tools tab--Relationships Choose tables. Drag from primary key of parent to foreign key in child. Check "Enforce Referential Integrity". Makes 1-to-infinite. Join query: choose tables, select columns etc. The SQL uses alternate syntax: Select ... FROM t1 INNER JOIN t2 ON fi=fj ... (where clause does not specify the join) but the other syntax works too in SQL View. ********************************************** SKIP: Subquery: Total: Where Criteria: >(Select Avg(area) from country)