Chapter 19 - Defining and updating tables by using SQL Flashcards
What are the commands to create a new table in the SQL?
» CREATE TABLE (tablename)
{
Column1 Data type,etc
Column2 Data type,etc
Column3 Data type, etc
}
What is the purpose of the NOT NULL statement?
» If you put it in when you create a new table, it is a compulsory field
What is the purpose of the PRIMARY KEY statement?
» States the column is the primary key
What is the purpose the CHAR(n) data type?
» Makes sure the data entered character’s are a fixed length of, n
What is the purpose of the VARCHAR(n) data type?
» Makes sure the data entered has a character string variable of max length, n
What is the purpose the BOOLEAN data type?
» Make sure the data entered is TRUE or FALSE
What is the purpose of the INTEGER data type?
» Makes sure the data entered is an integer
What is another way to write the INTEGER data type?
» INT
What is the purpose of the FLOAT data type?
» Make sure it is a number with a floating decimal point
What does it mean by the FLOAT(X,Y) command?
» X - Maximum number of digits is X
» Y - Maximum number after decimal point is Y
What does the DATE data type do?
» Stores the data entered as Day,Month,Year values
What is the purpose of the TIME data type?
» Stores the data entered as Hour,Minute,Second values
What does the CURRENCY data type do?
» Formats numbers in the currency used in your region
What does the CURRENCY data type do?
» Formats numbers in the currency used in your region
What is the purpose of the ALTER TABLE statement?
» To add, delete or modify columns in an exisiting table