Professional Documents
Culture Documents
DATE:
AIM:
To perform the concept manipulation of data and to describe different objects in sql.
PROCEDURE:
● To perform manipulating operations like inserting, updating and deleting rows into a
table.
● To perform table creation.
● To create views and other objects.
● Describe working of schema objects.
QUERIES:
OUTPUT:
2. Describe the structure of the MY_EMPLOYEE table to identify the column names.
OUTPUT:
717821L
3. Create an INSERT statement to add the first row of data to the MY_EMPLOYEE
table from the following sample data. Do not list the columns in the INSERT clause.
QUERY: INSERT INTO my_employee VALUES (1, 'Patel', 'Ralph', 'rpatel', 895);
OUTPUT:
4. Populate the MY_EMPLOYEE table with the second row of sample data from the
preceding list.
OUTPUT:
OUTPUT:
717821L
INSERT INTO my_employee (id, last_name, first_name,userid, salary) VALUES (5,
'Ropeburn','Audrey','aropebur',1550);
QUERY: COMMIT;
OUTPUT:
OUTPUT:
9. Change the salary to $1,000 for all employees who have a salary less than $900.
QUERY: UPDATE my_employee SET salary = 1000 WHERE salary < 900;
717821L
OUTPUT:
OUTPUT:
OUTPUT:
OUTPUT:
717821L
13. Commit all pending changes.
QUERY: COMMIT;
OUTPUT:
14. Populate the table with the last row of sample data.
OUTPUT:
OUTPUT:
717821L
16. Mark an intermediate point in the processing of the transaction.
QUERY: SAVEPOINT A;
OUTPUT:
OUTPUT:
19. Discard the most recent DELETE operation without discarding the earlier INSERT
operation.
QUERY: ROLLBACK TO A;
20. Confirm that the new row is still intact. QUERY: select * from my_employee
OUTPUT:
717821L
21. Make the data addition permanent.
QUERY: COMMIT;
OUTPUT:
22. Create the DEPT table based on the following table instance chart. Now confirm its
creation.
OUTPUT:
23. Populate the DEPT table with data from the DEPARTMENTS table. Include only
columns that you need.
QUERY: INSERT INTO Dept values (1,'raj') SELECT id,name FROM dept;
24. Create the EMP table based on the following table instance chart. confirm table.
OUTPUT:
25. 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.
717821L
OUTPUT:
OUTPUT:
RESULT:
Thus the manipulation of data and to describe objects in sql has been executed and
verified successfully.
717821L