Skip to main content

Activity 2.1

1

Creating Command Files

Using the solution to activity 1.5, found in the previous section, develop a command file to create the student table and insert records into that table. Use SQL to display the entered rows.

To ensure that you have created the above tables perform the following tasks.

Part 1: Obtain a list of your tables by executing the SQL SELECT command: SELECT * FROM cat;

Part 2: Display the structure of each table by use of the SQL*Plus desc command.

Part 3: To ensure that each table has been populated with data run the appropriate SQL SELECT command for each table to display all the columns and rows.

Show your reports to your tutor before continuing with the next activity.

Part 1

SELECT *

FROM cat;

Part 2

DESC student

DESC staff

DESC department

DESC course

DESC unit

DESC result

DESC attendance

Part 3

SELECT *

FROM student;

SELECT *

FROM staff;

SELECT *

FROM department;

SELECT *

FROM course;

SELECT *

FROM unit;

SELECT *

FROM result;

SELECT *

FROM attendance;

Check your answer

Next: Activity 2.2A