0% found this document useful (0 votes)
87 views5 pages

(M9-ForMATIVE) Data Control Language

Uploaded by

Rome Sumatra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views5 pages

(M9-ForMATIVE) Data Control Language

Uploaded by

Rome Sumatra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

SELECT table1.column, table2.

column
FROM table1
[NATURAL JOIN table2] |
[JOIN table2 USING (column_name)] |
PROGRAM OUTCOME/S
[JOIN table2 (PO) ADDRESSED BY THE LABORATORY EXERCISE
ON (table1.column_name = table2.column_name)]|
a. [LEFT|RIGHT|FULL
Apply knowledge through the use of current
OUTER JOINtechniques and tools necessary for the IT profession. [PO: I]
table2
ON (table1.column_name = table2.column_name)]|
[CROSS JOIN table2];
I. COURSE LEARNING OUTCOME/S (CLO) ADDRESSED BY THE LABORATORY EXERCISE
 Create SQL statements that retrieve information requirements of the organization needed for reports generation.
[CLO: 4]

II. INTENDED LEARNING OUTCOME/S (ILO) OF THE LABORATORY EXERCISE


At the end of this exercise, students must be able to:
 Use SQL command to manipulate the data in the table
 Use the commit, rollback and save point as transaction control

III. BACKGROUND INFORMATION

• Join–a relational operation that causes two or more tables with a common domain to be combined into a single table or
view
• Equi-join–a join in which the joining condition is based on equality between values in the common columns;
common columns appear redundantly in the result table
• Natural join–an equi-join in which one of the duplicate columns is eliminated in the result table
• Outer join–a join in which rows that do not have matching values in common columns are
nonetheless included in the result table (as opposed to inner join, in which rows must have
Figure 7-2 matching values in order to appear in the result table)
Visualization of different join types
• Union join–includes with
all columns from each table in the join, and an instance for each row of each
results returned in shaded
table area
IV. GRADING SYSTEM / RUBRIC

CCS0021L-Information Management Page 2 of


5
V. LABORATORY ACTIVITY

Scenario
Team up with other students for this exercise about controlling access to database objects.

Task
Write the appropriate SQL statement for the following queries. The result of the queries will be checked from your
computer.

1. What privilege should a user be given to log on to the Oracle server? Is this a system privilege or an object privilege?

2. What privilege should a user be given to create tables?

3. If you create a table, who can pass along privileges to other users on your table?

4. You are the DBA. You are creating many users who require the same system privileges. What should you use to make
your job easier?

5. What command do you use to change your password?

6. User1 is the owner of the EMP table and grants the DELETE privilege to User2 by using the WITH GRANT OPTION
clause. User2 then grants the DELETE privilege on EMP to User3. User1 now finds that User3 has the privilege and
revokes it from User2. Which user can now delete from the EMP table?

7. You want to grant SCOTT the privilege to update data in the DEPARTMENTS table. You also want to enable SCOTT
to grant this privilege to other users. What command do you use?

8. Grant another user query privilege on your table. Then, verify whether that user can use the privilege. Note: For this
exercise, team up with another group. For example, if you are user ora21, team up with another user ora22.
a. Grant another user privilege to view records in your REGIONS table. Include an option for this user to further
grant this privilege to other users.
b. Have the user query your REGIONS table.
c. Have the user pass on the query privilege to a third user (for example, ora23).
d. Take back the privilege from the user who performs step b.

CCS0021L-Information Management Page 3 of


5
Note: Each team can run exercises 9 and 10 independently.
9. Grant another user query and data manipulation privileges on your COUNTRIES table. Make sure that the user cannot
pass on these privileges to other users.

10. Take back the privileges on the COUNTRIES table granted to another user.

Note: For exercises 11 through 17, team up with another group.


11. Grant another user access to your DEPARTMENTS table. Have the user grant you query access to his or her
DEPARTMENTS table.

12. Query all the rows in your DEPARTMENTS table.

13. Add a new row to your DEPARTMENTS table. Team 1 should add Education as department number 500. Team 2
should add Human Resources as department number 510. Query the other team’s table.

14. Create a synonym for the other team’s DEPARTMENTS table.

15. Query all the rows in the other team’s DEPARTMENTS table by using your synonym.

Team 1 SELECT statement results:

Team 2 SELECT statement results:

16. Revoke the SELECT privilege from the other team.

CCS0021L-Information Management Page 4 of


5
17. Remove the row you inserted into the DEPARTMENTS table in step 13 and save the changes.

VI. QUESTION AND ANSWER

1. What is the difference between a Join and a Natural Join?

VII. REFERENCES

 Hoffer, J., Ramesh, V., Topi, H. (2013). Modern Database Management 11 th Edition, Prentice Hall.
 Singh, P., Pottle, B. (2009). Oracle Database 11g: SQL Fundamentals I, Oracle.

CCS0021L-Information Management Page 5 of


5

You might also like