1. Learn
  2. /
  3. Courses
  4. /
  5. Creating PostgreSQL Databases

Connected

Exercise

Simplifying database records

One teacher from the high school heard rumblings about efforts to better organize student records. He would like to organize student grades in his courses. The teacher proposes the following table structure for the test_grades table:

CREATE TABLE test_grades (
    student_id INTEGER NOT NULL,
    course_name VARCHAR(50) NOT NULL,
    grades TEXT NOT NULL
);

Each record represents a student from one of the teacher's classes identified by the student's id, the course name, and the student's test grades. The teacher finds that managing the database with this structure is difficult. Inserting new grades requires a complex query. In addition, doing calculations on the grades is not very easy. In this exercise, you will help to put this table in 1st Normal Form (1NF).

Instructions

100 XP
  • Define a new version of the table with the name test_grade.
  • Include student_id and course_name columns as defined in the test_grades table.
  • In place of a grades column, include a numeric column named grade.