LoslegenKostenlos loslegen

Designing a course table

The school's administration decides to use its database to store course details. Given that this is the first attempt at building the database, they are unsure of which columns to include in the course table. Below is a list of possible columns and a description of the data type for each. In this exercise, you will choose the appropriate columns for this table from the list of possible column choices:

  • id - a PRIMARY KEY for the course
  • name - a variable length (max 50, not NULL) string for the course name
  • meeting_time - a time representing the meeting time of the course
  • student_name - a variable length (max 50, not NULL) string representing an enrolled student
  • max_students - an integer for maximum student enrollment (classrooms can only fit 30 desks safely)

Diese Übung ist Teil des Kurses

Creating PostgreSQL Databases

Kurs anzeigen

Anleitung zur Übung

  • Create a course table which satisfies 2NF using 3 columns from the list above.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

-- Create the course table
___ ___ ___ (
    -- Add a column for the course table
	___ ___ ___ ___,
  
  	-- Add a column for the course table
  	___ ___(___) ___ ___,
  
  	-- Add a column for the course table
  	___ ___
);
Code bearbeiten und ausführen