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 pseudocolumns
CURRVAL and NEXTVAL values.
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.
Insert group members' names into the EMPLOYEE table using the SEQUENCE that you inially
created see No to generate automac employee numbers. Check the data to know whether it is
successfully created or not.
Check the Oracle documentaon concerning pseudocolumn ROWID. What is ROWID? Show ENO,
ENAME, and ROWID from the EMPLOYEE table.
Drop the EMPLOYEE table.
PRIMARY KEY AND FOREIGN KEY
Use a SQL command to create a STAFF table consisng of three atributes: STAFFID PRIMARY KEY,
NUMERIC SNAME VARCHAR and SSALARY NUMERIC
Use DESCRIBE command to see the structure of the STAFF table.
Use a SQL command to create a DEPARTMENT table containing two atributes: DEPARTMENTID
PRIMARY KEY, NUMERIC and DNAME VARCHAR
Insert ten rows of data into each table above.
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?
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
