15.00 - Databases and Users - Teradata Database

Teradata Database SQL Fundamentals

Teradata Database
Programming Reference

Databases and Users

A database is a container with an allotment of space in which users can create and maintain database objects, including tables, views, triggers, indexes, stored procedures, user-defined functions, and macros.

A user is similar to a database, except that a user has a password and can log on to the system, whereas a database cannot.

The primary Teradata Database user is DBC, which owns all system disk space and contains the Data Dictionary tables and other system objects and information.

Defining Databases and Users

Before you can create a database or user, you must have sufficient privileges granted to you.

To create a database, use the CREATE DATABASE statement. You can specify the name of the database, the amount of storage to allocate, and other attributes.

To create a user, use the CREATE USER statement. The statement authorizes a new user identification (user name) for the database and specifies a password for user authentication. Because the system creates a database for each user, the CREATE USER statement is very similar to the CREATE DATABASE statement.

Difference Between Users and Databases

Formally speaking, the difference between a user and a database is that a user has a password and a database does not. Users can also have default attributes such as time zone, date form, character set, role, and profile, while databases cannot.

You might infer from this that databases are passive objects, while users are active objects. That is only true in the sense that databases cannot execute SQL statements. However, a query, macro, or stored procedure can execute using the privileges of the database.