Write the SQL statements for the following questions.
Paste the answer as SQL in the answer code section below each question.
Write the SQL statement to create a unique index on the email column of the students table in the lesson schema.
Answer:
CREATE UNIQUE INDEX students_email_idx ON lesson.students(email);Write the SQL statement to alter the teachers table in the lesson schema to add a new column subject of type VARCHAR.
Answer:
ALTER TABLE lesson.teachers ADD COLUMN subject VARCHAR;Write the SQL statement to update the email of the teacher with the name 'John Doe' to 'john.doe@school.com' in the teachers table of the lesson schema.
Answer:
UPDATE lesson.teachers
SET email = 'john.doe@school.com'
WHERE name = 'John Doe';- Submit the URL of the GitHub Repository that contains your work to NTU black board.
- Should you reference the work of your classmate(s) or online resources, give them credit by adding either the name of your classmate or URL.