Question: Generate a SEQUENCE and u lize DUAL to examine the pseudo - columns CURRVAL and NEXTVAL values. 2 . U lize an SQL command to

Generate a SEQUENCE and ulize DUAL to examine the pseudo-columns
CURRVAL and NEXTVAL values.
2. Ulize an SQL command to generate an EMPLOYEE table that includes two columns: ENO, with a
NUMERIC data type, and ENAME, with a VARCHAR data type. Once the table is created, verify its
structure using the DESCRIBE command.
3. Insert 3-4 group members' names into the EMPLOYEE table using the SEQUENCE that you inially
created (see No 1) to generate automac employee numbers. Check the data to know whether it is
successfully created or not.
4. Check the Oracle documentaon concerning pseudo-column ROWID. What is ROWID? Show ENO,
ENAME, and ROWID from the EMPLOYEE table.
5. Drop the EMPLOYEE table.
PRIMARY KEY AND FOREIGN KEY
6. Use a SQL command to create a STAFF table consisng of three atributes: STAFFID (PRIMARY KEY,
NUMERIC), SNAME (VARCHAR), and SSALARY (NUMERIC).
7. Use DESCRIBE command to see the structure of the STAFF table.
8. Use a SQL command to create a DEPARTMENT table containing two atributes: DEPARTMENTID
(PRIMARY KEY, NUMERIC) and DNAME (VARCHAR)
9. Insert ten rows of data into each table above.
10. Add an addional atribute, namely SDEPARTMENT, to the STAFF table. The SDEPARTMENT is a foreign
key that refers to the DEPARTMENTID of the DEPARTMENT table.
Also, add another atribute called MNGR to the DEPARTMENT table. The MNGR is a foreign key that
refers to the STAFFID of the STAFF table. Are there any issues? If so, how do we resolve them?
11. Create an SQL command for each of the following needs:
a. Show a staff name from a parcular department.
b. Show the names and salaries of all managers.
c. Show the number of employees in each department.
d. Show the average salary of the employee in each department.
e. Show the maximum, minimum, and average salary of all employees.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!