Professional Documents
Culture Documents
Students will learn how to use Oracle APEX and create tables using APEX.
1
4
2 5
3
2
1. Schema: display the schemas to which you have been granted access.
4. Save button: You run your SQL or PL/SQL statement or save it for future use. To limit the
number of times you enter a common SQL or PL/SQL statement, save the statement by clicking
the Save button.
5. If you want to run the saved SQL, click Saved SQL tab on the bottom, double-click one of saved
SQLs you want to run like:
Click ‘SQL Workshop’ drop down arrow -> select SQL Scripts -> Click the ‘Create’ button.
1. Move to Script Name textbook and type your script a name like “Create copy tables”.
2. Enter SQL statements below.
3. Click “Create” button
4. Click “Run” button
5. Click “Run Now” button on the bottom.
1
2
3 4
2
2 2
2
Click SQL Workshop drop down arrow -> select Object browser -> you can see two tables added.
Task 4: Creating Tables
Click “SQL Workshop” drop down arrow -> click “SQL Commands”.
Write SQL statements for creating table with the following specification:
1. Create a table called “yourfirstname_Advisors” with the following properties:
• Create a numeric column called “advisorID” which is a primary key.
• Create a character column called “advisorMajor” with a default value ‘CS’.
• Add a varchar2 column named advisorName with the length 30.
Remember: Select statement does not have any issue but Update statements (update and delete
statements) maybe not be worked on Apex.
Your Turn:
Please open the following link: https://www.docdroid.net/uaTFHrh/oracle-11g-sql-by-joan-
casteel.pdf#page=82 and read chapter 3: Table Creation and Management and then answer the
following:
(0.7 point each) Multiple Choice: 20 questions
Writing SQL statements:
(3 pts each) Page 94, Hand-on Assignments
Question 1 through 10
(3 pts each) Advanced challenge: skip the first question, answer only second and third questions.
Please test all SQL statements on Apex.
Remember: Whenever you create a table, please begin prefix with your first name followed by the table
name. e.g., if “James” wants to create Employee table, his table name should be James_Employee.
Answers
1. C.
2. C.
3. A.
4. D.
5. D.
6. D.
7. B.
8. D.
9. B.
10. A.
11. D.
12. A.
13. A.
14. B.
15. D.
16. D.
17. B.
18. D.
19. C.
20. B.
Page 94 Hand-on Assignment
1. CREATE TABLE CATEGORY (Catcode Varchar2 (2),
CatDesc Varchar2(10));
2. Create TABLE EMPLOYEES (Emp# NUMBER (5),
Lastname Varchar2(15), Firstname Varchar2(15),
Job_class Varchar (4));
3. ALTER TABLE EMPOYEES ADD (EmpDate DATE DEFAULT SYSDATE, Endate DATE);
4. ALTER TABLE EMPLOYEES MODIFY ( Job_class Varchar (10));
5. ALTER TABLE EMPLOYRSS
6. RENAME EMPLOYEES TO JL_EMPS;
7. CREATE TABLE BOOK_PRICING (ID Number (5), Cost varchar2(20), Retail varchar2(10),
Category varchar (4));
8. ALTER TABLE BOOK_PRICING SET UNUSED (Category);
9. TRUNCATE TABLE BOOKING_PRICING;
10. DROP TABLE BOOK_PRICING PURGE;
DROP TABLE JL_EMPS;
Advance Challenge
2. CREATE TABLE COMMRATE (Comm_ID numeric (10), Comm_rank varchar (15), Rate numeric
(10,2));
3.CREATE TABLE BENEFITS (Ben_ID numeric(10), Ben_Plan char(1), Ben_Provider numeric (3),
Active char(1));
Turn-in Instructions
Write all your answers on the WORD document.
Save all results as “Assignment2_CreatingTables_yourfirstname.docx” and submit it to the E-
Portfolio/File Exchange.