0% found this document useful (0 votes)
784 views3 pages

SQL Fundamentals - Practice 09

The document provides instructions to create DEPT and EMP tables based on table structure charts. It also has steps to populate the DEPT table from an existing DEPARTMENTS table, create an EMPLOYEES2 table from selected columns of the EMPLOYEES table, and drop the EMP table.

Uploaded by

Abby AR
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
784 views3 pages

SQL Fundamentals - Practice 09

The document provides instructions to create DEPT and EMP tables based on table structure charts. It also has steps to populate the DEPT table from an existing DEPARTMENTS table, create an EMPLOYEES2 table from selected columns of the EMPLOYEES table, and drop the EMP table.

Uploaded by

Abby AR
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

Practice 9

1. Create the DEPT table based on the following table instance chart. Place the
syntax in a script called lab_09_01.sql, and then execute the statement in the script to
create the table. Confirm that the table is created.
Column Name ID NAME
Key Type Primary key
Nulls/Unique
FK Table
FK Column
Data type NUMBER VARCHAR2
Length 7 25

2. Populate the DEPT table with data from the DEPARTMENTS table. Include only columns
that you need.
3. Create the EMP table based on the following table instance chart. Place the syntax in
a script called lab_09_03.sql, and then execute the statement in the script to create the
table. Confirm that the table is created.

Column Name ID LAST_NAME FIRST_NAME DEPT_ID


Key Type
Nulls/Unique
FK Table DEPT
FK Column ID
Data type NUMBER VARCHAR2 VARCHAR2 NUMBER
Length 7 25 25 7

Oracle Database 10g: SQL Fundamentals I 9 - 38


Practice 9 (continued)
4. Create the EMPLOYEES2 table based on the structure of the EMPLOYEES table. Include
only the EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY, and DEPARTMENT_ID
columns. Name the columns in your new table ID, FIRST_NAME, LAST_NAME, SALARY,
and DEPT_ID, respectively.
5. Drop the EMP table.

Oracle Database 10g: SQL Fundamentals I 9 - 39

You might also like