1/28
Looks like no tags are added yet.
precision
the total number of digits a numeric column may store.
scale
specifies the exact number of digits that can be stored to the right of the decimal point for a numeric value
range
defines the minimum and maximum values that can be stored within a column, as determined by its data type
VARCHAR(n)
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)
SQL commands used to retrieve and view data from a database.
Data Control Language (DCL)
SQL commands used to manage user permissions and access rights to the database and its objects
USE {database name}
will display the name of all databases that you have access privileges for
SHOW TABLES
display the name of tables in the currently selected database.
SHOW COLUMNS FROM
will display the information about the columns within a table
DESCRIBE
display the information about the columns within a table.
CREATE DATABASE
will add a new database on a database server.
DROP DATABASE
will remove an existing database on a database server.
column property
may define a column’s name, data type and options.
constraint property
may define a constraint with a name, type, and options.
CREATE TABLE {table name}
add a new table to the currently selected database.
DROP TABLE {table name}
remove an existing table in the currently selected database.
ALTER TABLE {table name}
will modify the structure of a table.
ADD COLUMN {column definition}
add a column to a table.
DROP COLUMN {column_name}
will remove a column from a table
MODIFY COLUMN {column_definition}
can change the column properties of a column in a table.
CHANGE COLUMN {old_column_name}
can change the column properties of a column in a table including renaming that column.
ADD CONSTRAINT {constraint_name}
can add a constraint to a table.
RENAME {new table name}
will rename a table.