List all databases and users in Teradata

Sometimes you may need to check all the available databases in the Teradata server. Teradata provides a couple of different ways to get the information. The easiest way to list all the databases in Teradata using the following query: SELECT … Read more »

Teradata COUNT Function

The COUNT function in Teradata returns the total number of qualified rows in the value expression.  Syntax COUNT ( [TYPE] value_expression ); Here, value_expression – A literal or column expression for which the total count is computed. The expression cannot contain … Read more »

Teradata SUM Function

Teradata SUM function returns the arithmetic sum of value_expression or specific column. Syntax SELECT SUM(DISTINCT/ALL value_expression ) FROM tables WHERE predicates; Here, DISTINCT – DISTINCT is used in the SUM function to eliminates all the duplicates and non-null while calculating … Read more »

Teradata MAX (Maximum) Function

Teradata MAX is used to get the maximum value from the value_expression.  Teradata MAX Syntax The syntax of the Teradata MAX is as follows. MAX/MAXIMUM (DISTINCT/ALL value_expression) Here, DISTINCT – If DISTINCT is used in the MAX function then all … Read more »

Teradata MIN (Minimum) Function

Teradata MIN is used to get the minimum value from the value_expression.  Teradata MIN Syntax The syntax of the Teradata MIN is as follows. MIN/MINIMUM (DISTINCT/ALL value_expression) Here, DISTINCT – If DISTINCT is used in the MIN function then all … Read more »

Teradata AVG (Average) Function

The average function in Teradata returns the arithmetic average of all values in value_expression. This is generally used to calculate the average value from a specified column. Teradata average function syntax The syntax of the Teradata average function is as … Read more »

List of all dbc tables in Teradata

The below query list all the dbc tables in Teradata. Query to list all the dbc tables in Teradata SELECT DatabaseName, TableName, CreateTimeStamp, LastAlterTimeStamp FROM DBC.TablesV WHERE TableKind = ‘T’ and DatabaseName = ‘DBC’ ORDER BY TableName; Here, DatabaseName – … Read more »

How to Check Teradata Database Release and Version

DBC.DBCINFO table in Teradata will have all the related information related to the Teradata release and version. You can check Teradata Database Release and Version using the following query. select * from dbc.dbcinfo; Here, dbc – Database computer. dbcinfo – … Read more »

Changing the screen width in Teradata BTEQ

The default width in Teradata BTEQ setting display maximum of 75 characters in a single line. If we need to display more than 75 characters in a single line, we can set the width of the screen in Teradata BTEQ. … Read more »