This document contains SQL commands to create three database tables: COUNTRIES, DEPARTMENTS, and EMPLOYEES. The COUNTRIES table has fields for country ID, name, and region ID. The DEPARTMENTS table stores department ID, name, manager ID, and location ID. The EMPLOYEES table begins to define fields for employee ID, first name, and last name. Comments are added to describe the purpose of each column. Indexes are created on the primary key fields of each table.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
20 views2 pages
Test
This document contains SQL commands to create three database tables: COUNTRIES, DEPARTMENTS, and EMPLOYEES. The COUNTRIES table has fields for country ID, name, and region ID. The DEPARTMENTS table stores department ID, name, manager ID, and location ID. The EMPLOYEES table begins to define fields for employee ID, first name, and last name. Comments are added to describe the purpose of each column. Indexes are created on the primary key fields of each table.
( DEPARTMENT_ID NUMBER (4) NOT NULL , DEPARTMENT_NAME VARCHAR2 (30 BYTE) NOT NULL , MANAGER_ID NUMBER (6) , LOCATION_ID NUMBER (4) ) LOGGING ;
COMMENT ON COLUMN DEPARTMENTS.DEPARTMENT_ID IS 'Primary key column of
departments table.' ;
COMMENT ON COLUMN DEPARTMENTS.DEPARTMENT_NAME IS 'A not null column that
shows name of a department. Administration, Marketing, Purchasing, Human Resources, Shipping, IT, Executive, Public Relations, Sales, Finance, and Accounting. ' ;
COMMENT ON COLUMN DEPARTMENTS.MANAGER_ID IS 'Manager_id of a department.
Foreign key to employee_id column of employees table. The manager_id column of the employee table references this column.' ; COMMENT ON COLUMN DEPARTMENTS.LOCATION_ID IS 'Location id where a department is located. Foreign key to location_id column of locations table.' ;