You are on page 1of 2

ICT 2 - REGULAR

DATABASE MANAGEMENT SYSTEMS

PRACTICAL ASSIGNMENT

Use Table 1 and Table 2 below to answer the questions that follow.

IndexNum Surname Othernames Gender


001 Yeboah Kofi M
002 Amartey Esinam F
003 Konadu Esther F
004 Owusu John F
005 Adzani Mercy F
Table 1: PersonalRecord

ID IndexNum Course Marks


1 001 Economics 85
2 001 Database Systems 67
3 001 Discrete Maths 43
4 004 Economics 75
5 004 Discrete Maths 73
6 005 Economics 70
7 005 Database Systems 63
8 005 Discrete Maths 81
Table 2: AcademicRecord

A. Write the SQL query to grant delete, insert, and update privilege on PersonalRecord
table to the user SCOTT
B. As a user with an administrative right, write the SQL query to change the password of
the user SCOTT to GOOD
C. Write an SQL command used to create the PersonalRecord table where IndexNum is
the Primary key.
D. Write the appropriate SQL command to insert the first three records into the
std_persoanl table.
E. Tabulate the result if the following SELECT query operations are used to query the
database:
i. SELECT p.Index_Num AS Index_Number, CONCAT(p.Surname ‘ ‘
p.Othernames) AS Fullname, a.Course AS Subject, a.Marks AS Marks
FROM PersonalRecord p JOIN AcademicRecord a
ON (p.Index_Num=a.Index_Num)
WHERE a.Marks<81;

ii. SELECT Index_Num, Course, Mark


FROM AcademicRecord
WHERE Course= ‘Discrete Maths’ AND Mark>80
ORDER BY Marks ASC;

F. Write an SQL query to change the Gender of Konadu Esther from ‘F’ to ‘M’ in the
PersonalRecord table.
G. Write an SQL query to add a new column or field, DOB to the PersonalRecord table.
H. Write an SQL query to completely delete the AcademicRecord table.

You might also like