memorization 3

In databases, precision is the total number of digits a numeric column may store.

In databases, scale specifies the exact number of digits that can be stored to the right of the decimal point for a numeric value.

In databases, range defines the minimum and maximum values that can be stored within a column, as determined by its data type.

VARCHAR(n) is a data type that stores a string up to “n” characters longs, but will only use the minimum storage space necessary to do so.

CHAR(n) is a data type that stores a string up to “n” characters long and always uses “n” characters of storage space to do so.

DECIMAL(p,s) is a data type that stores exact values of numbers with a specific number of total digits and specific number of digits to the right of the decimal point.

INT is a data type that stores whole numbers.

DATETIME is a data type that stores the value of an hour, minute and second for a year, month and day.

Data Definition Language (DDL) statements are SQL commands used to create, modify, and delete the structure of database objects.

Data Manipulation Language (DML) statements are SQL commands used to insert, retrieve, modify, and delete data stored within the database objects.

Data Query Language (DQL) statements are SQL commands used to retrieve and view data from a database.

Data Control Language (DCL) statements are SQL commands used to manage user permissions and access rights to the database and its objects.

The USE {database name} statement sets the default (or “current”) database to work with for the session.

The SHOW DATABASES statement will display the name of all databases that you have access privileges for

The SHOW TABLES statement will display the name of tables in the currently selected database.

The SHOW COLUMNS FROM {table name} statement will display the information about the columns within a table.

The DESCRIBE {table name} statement will display the information about the columns within a table.

The CREATE DATABASE {database name} statement will add a new database on a database server.

The DROP DATABASE {database name} statement will remove an existing database on a database server.

A column property in a table definition may define a column’s name, data type and options.

A constraint property in a table definition may define a constraint with a name, type, and options.

The CREATE TABLE {table name} statement will add a new table to the currently selected database.

The DROP TABLE {table name} statement will remove an existing table in the currently selected database.

The ALTER TABLE {table name} statement will modify the structure of a table.

The ALTER TABLE {table name} ADD COLUMN {column definition} statement will add a column to a table.

The ALTER TABLE {table name} DROP COLUMN {column_name} statement will remove a column from a table.

The ALTER TABLE {table name} MODIFY COLUMN {column_definition} statement can change the column properties of a column in a table.

The ALTER TABLE {table name} CHANGE COLUMN {old_column_name} {new_column_definition} statement can change the column properties of a column in a table including renaming that column.

The ALTER TABLE {table name} ADD CONSTRAINT {constraint_name} {constraint_definition} statement can add a constraint to a table.

The ALTER TABLE {old table name} RENAME {new table name} statement will rename a table.