P.S: This is just a study guide. The questions may not appear exactly like this.
Question 1
(TCO 3) The _____ column attribute is used to indicate that a value is required for this field.
1. DEFAULT
2. AUTO_INCREMENT
3. REQUIRED
4. NOT NULL
Question 2
(TCO 5) The _____ keyword is used in an ALTER statement to add a new column to an existing table.
1. MODIFY
2. ADD
3. INSERT
4. DROP
Question 3
(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.
Question 4
(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
Question 5
(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
Question 6
(TCO 3) A foreign key constraint can only reference a column in another table that has been assigned a(n) _____ constraint.
1. NOT NULL
2. UNIQUE
3. PRIMARY KEY
4. DEFAULT
Question 7
(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.
Question 8
(TCO 3) What datatype is best to store a person’s age?
1. INTEGER
2. VARCHAR
3. DECIMAL
4. FLOAT
Question 9
(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;
Question 10
(TCO 8) When you write an INSERT statement with a column list, which columns must be specified in the column list?
1. AUTO_INCREMENT
2. DEFAULT
3. NOT NULL
4. Fields that allow NULL