Professional Documents
Culture Documents
Database Programming Test Answers
Database Programming Test Answers
Question Two:
a. Creating the table Patient and adding a column called PhoneNumber: the code I used to change the table
name is this: RENAME Patient TO HospitalPatient;
Dropping column DOB, creating an index on LastName:
Question Three:
a. Creating schema and creating tables with foreign keys:
b. Adding, enrolling, listing students, listing courses, updating a course description, and
deleting an enrolment:
c. Trigger to enforce policy:
Question Four:
i. Creating tables:
Inserting into sales and customers, adding columns to the tables, and designing a
unique index:
Creating a view and updating it:
Question Five:
Structure for table named 2018markschanged where data is inserted post-trigger execution:
a. Trigger for the Cyber College of Technology (CCT) named 2018markschange, invoked
BEFORE an UPDATE operation:
b. SQL query to update the studentsmarks2018 table:
Question Six:
Syntax and execution of a stored procedure:
a. Stored procedure to create accounts for staff members: