groupon/tdsql — pull request #1 by richievos (2012-10-26 04:12:31+00:00)
Title: Document some commonly used commands

Adds /cheatsheet as a command:

tdsql> /cheatsheet
Common Teradata commands:

List databases
select databasename from dbc.databases order by databasename;

Describe things
help database dbc; /* a database */;
help table dbc.databases; /* a table */;
show view [database].[table]; /* a view */;

Change a password
modify user [username] as password = newpassword;

Switch to a database
database [database_name];

Example queries
select top [count] * from [table]; /* limit the number of results returned */
select * from [table] \G; /* show results in column format */;

Optimizing
explain [sql statement];
collect statistics on [tablename] column ([columnname]);

tdsql>