LoslegenKostenlos loslegen

Revisiting the appeals table

The SBA database now contains a table for storing loan applicant appeal requests. The table contains only a PRIMARY KEY and a text column for the appeal. It is useful to track additional information such as when the appeal was received, whether or not the decision was reversed after the appeal, and the date when the appeal was reconsidered. You will define a new version of the appeals table to capture this information.

Diese Übung ist Teil des Kurses

Creating PostgreSQL Databases

Kurs anzeigen

Anleitung zur Übung

  • Add a new column, received_on, which captures the date and time when the appeal was received.
  • Add an approved_on_appeal column to indicate if the loan decision was changed due to the appeal. (This field will default to NULL to indicate that no new decision has yet been reached.)
  • Add a reviewed column which stores the date when the appeal was reviewed.

Interaktive Übung

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

CREATE TABLE appeal (
	id SERIAL PRIMARY KEY,
    content TEXT NOT NULL,
  	-- Add received_on column
    ___ ___ DEFAULT CURRENT_TIMESTAMP,
  	
  	-- Add approved_on_appeal column
  	___ ___ DEFAULT NULL,
  	
  	-- Add reviewed column
    ___ ___
);
Code bearbeiten und ausführen