P.S: This is just a study guide. The questions may not appear exactly like this.
(TCO 3) The _____ column attribute is used to indicate that a value is required for this field.
4. NOT NULL
(TCO 5) The _____ keyword is used in an ALTER statement to add a new column to an existing table.
(TCO 3) Which uses the least amount of storage?
1. “Example” stored in a column of type CHAR(20)
2. “Exam” stored in a column of type CHAR(20)
3. “Ex” stored in a column of type CHAR(20)
4. They all use the same amount of storage.
(TCO 3) The TIME data type in MySQL can store _____.
1. dates only
2. times only
3. dates and times
4. None of the above
(TCO 3) What constraint cannot be applied at column level?
1. Foreign key
2. Not null
3. Single field primary key
4. Composite primary key
(TCO 3) A foreign key constraint can only reference a column in another table that has been assigned a(n) _____ constraint.
1. NOT NULL
3. PRIMARY KEY
(TCO 3) You are creating a table called Department, with fields for the primary key DeptID (Integer) and department name (VARCHAR). What (if anything) is wrong with the following code?
CREATE TABLE Department
deptID INTEGER Primary Key,
deptName VARCHAR(10) NOT NULL
1. You must use curly braces, not parentheses.
2. The field names must be all lower case.
3. The keywords cannot be in upper case.
4. Nothing is wrong.
(TCO 3) What datatype is best to store a person’s age?
(TCO 5) Which statement will remove the field STATUS from the CUSTOMERS table?
1. ALTER TABLE customers REMOVE status;
2. ALTER TABLE customers DROP status;
3. ALTER TABLE customers DROP COLUMN status;
4. ALTER TABLE customers DELETE status;
(TCO 8) When you write an INSERT statement with a column list, which columns must be specified in the column list?
3. NOT NULL
4. Fields that allow NULL