Oracle SQL Languages - Lab Exercise
Oracle SQL Languages - Lab Exercise
Practice questions |
1. Create a table with the following fields :prog, dob, doj, sex, prof1, prof2, and salary.
Include appropriate data types for each column.
|
2. Create a table named soft with the following columns: id (integer), name (varchar of length 30),
and salary (integer). Then, add an Address column of type varchar and modify the column id to Sno.
|
3. Create a table called emp with the columns empno, name, doj, address, and salary.
Add the columns commission and bonus to the table.Update the bonus column by setting it to 10% of the salary.
|
4. Write an SQL query to retrieve all data from the emp table (using the scott user) for employees whose
salary is less than 5000.
|
5. Write an SQL query to commit the first 10 rows of data. Then, insert 5 additional rows into the table.
After that, perform a rollback to undo the data changes.
|
6. Insert rows 1 to 10 and set a savepoint named
a.Insert rows 10 to 15 and set a savepoint named
b.Insert rows 15 to 20 and set a savepoint named
c.Rollback to one of the savepoints to undo the changes made after that point.
|