Practice exam questions

The following practice exam questions test your knowledge of material that this chapter covers.

1:Which statement is false?
  1. You can put data into a table that you create by using the DB2 LOAD utility or SQL INSERT statement.

  2. When you define a base table, you define all the columns of the table.

  3. When you create a base table, DB2 records the table's definition in the DB2 directory.

  4. Creating a table does not store the application data.

2:Which statement is valid?
  1. CREATE TABLE EMP
     (EMPNO CHAR(6) NOT NULL,
      FIRSTNME VAR CHAR(12) NOT NULL,
      LASTNAME VAR CHAR(15) NOT NULL,
      PRIMARY KEY (EMPNO)
    IN MYDB.MYTS;
    
  2. CREATE TABLE EMP
     (EMPNO CHAR(6) NOT NULL,
      FIRSTNME VAR CHAR(12)  NOT NULL,
      LASTNAME VAR CHAR(15)  NOT NULL,
      PRIMARY KEY (EMPNO))
    IN MYDB.MYTS
    
  3. CREATE TABLE EMP
     (EMPNO CHAR(6) NOT NULL,
      FIRSTNME  VARCHAR(12)  NOT NULL,
      LASTNAME  VARCHAR(15)  NOT NULL,
      PRIMARY KEY (EMPNO))
    IN MYDB.MYTS;
    
  4. CREATE TABLE NAME EMP
     (EMPNO CHAR(6) NOT NULL,
      FIRSTNME VARCHAR(12) NOT NULL,
      LASTNAME VARCHAR(15) NOT NULL,
      PRIMARY KEY (EMPNO))
    IN MYDB.MYTS;
    
3:For a column that will hold the last names of people, what data type would work best?
  1. CHAR

  2. VARCHAR

  3. DBCLOB

  4. ROWID

4:If a check constraint specifies that a part cost cannot exceed the cost of the product that contains it, which statement results in a violation of the check constraint?
  1. INSERT INTO PRODPART
     (PARTNUM, PRODNUM, PARTCOST, PRODCOST)
      VALUES ('1256', 'F1109', '42.99', '45.99'),
    
  2. INSERT INTO PRODPART
     (PARTNUM, PRODNUM, PARTCOST, PRODCOST)
      VALUES ('1256', 'F1109', '45.99', '42.99'),
    
  3. INSERT INTO PRODPART
     (PARTNUM, PRODNUM, PARTCOST, PRODCOST)
      VALUES ('1256', 'F1109', '4.29', '45.99'),
    
  4. INSERT INTO PRODPART
     (PARTNUM, PRODNUM, PARTCOST, PRODCOST)
      VALUES ('1256', 'F1109', '45.99', '459.99'),
    
5:Which scenario is not well suited for referential integrity?
  1. A manufacturing company wants to make sure that each part in a PARTS table identifies a product number that equals a valid product number in the PRODUCTS table.

  2. A company wants to ensure that each value of DEPT in the EMP table equals a valid DEPTNO value in the DEPT table.

  3. A payroll manager wants to make sure that no user or application program can increase the value of the SALARY column by more than 10%.

  4. A human resources manager wants to ensure that every value of MGRNAME in the DEPT table equals a valid EMPNO value in the EMP table.

6:Which statement is false?
  1. Indexes provide efficient access to data.

  2. When you create a table that contains a primary key, you must create a unique index for that table on the primary key.

  3. Each index that you define on a table must include the column or columns that comprise the primary key.

  4. After you create the index, DB2 maintains it.

7:Which statement is false?
  1. If you attempt to create an index on a table that has no data, DB2 does not create the index.

  2. You can choose to have DB2 build an index when the CREATE INDEX statement is executed.

  3. You can choose to have DB2 defer the building of the index until later.

  4. Optimally, you should create the indexes on a table before loading the table.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.79.63