Skip to main content

Activity 2.3B


Inserting Records

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.

Produce the following reports:

Report 1: a list of HNC course numbers and names - sort the results on the course name

Report 2: the number and name of all 'photography' units (hint - use the OR clause to get all units starting or ending with the word 'photography')

Report 1

SELECT course_number, course_name

FROM course

WHERE course_name LIKE 'HNC%' ORDER BY course_name;

Output from the SELECT course_number, course_name FROM course[D]

Report 2

SELECT unit_number, unit_name

FROM unit

WHERE unit_name LIKE 'Photography%'

OR unit_name LIKE '%Photography';

Output from the SELECT unit_number, unit_name[D]

Check your answer

Next: Activity 2.3C