Applying It

Independent Exercise 1:

  • Create a Table called people with columns of dept (numeric 4 positions), last_name (character 10 positions), start_date (date field), and salary (numeric 5 positions with 2 decimal positions).

Independent Exercise 2:

  • Insert the following data into the table, try out the & substitution character:

    • Dept 10, SMITH, SYSDATE, 10000

    • Dept 10, JONES, SYSDATE, 20000

    • Dept 20, KING, SYSDATE, 15000

    • Dept 20, JONES, SYSDATE, 18000

    • Dept 20, FOUNTAIN, SYSDATE, 12000

Independent Exercise 3:

  • Select those rows from Dept 20.

  • Select name and start_date with the start_date in the format of MM/DD/YYYY.

  • Give everyone in dept 10 a 10% increase in salary.

  • Set AUTOCOMMIT off, drop all the rows, and issue a ROLLBACK. Make sure all the rows are put back.

Independent Exercise 4:

  • Create a sequence that increments by 10 and begins at 10 over the current DEPT in the PEOPLE table.

    • INSERT <sequence name>.NEXTVAL, GARN, SYSDATE, 5000.

    • Create a primary key constraint on the DEPT column.

    • INSERT <sequence name>.CURRVAL, HACKETT, SYSDATE, 4500.

    • Why did you get this error?

NOTE

The next chapter uses this PEOPLE table for its Exercise examples as well.


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

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