Program: db_menu.c
CS-161: Software Project
Instructor: Rob Bruce
Spring 2016

This is a command line program that enables the user to select, insert, update, and delete data from a simple Postgres table called students.

The students table is defined as follows:

STUDENTS
student_id bigserial
first_name varchar(100)
last_name varchar(100)

Note: before running this program, you will need to do the following in Postgres:

  • Create a database called cs-161 in Postgres
  • Create the students table (above).
  • Modify db_menu.c to utilize your Postgres database password (when you initially create a database handle).

The full source code for db_menu.c is available at http://www.cs.sjsu.edu/~bruce/programs/spring_2016_cs161/db_menu/db_menu.c

A makefile to compile db_menu.c is available at http://www.cs.sjsu.edu/~bruce/programs/spring_2016_cs161/db_menu/Makefile

To compile db_menu.c, type make within a shell command prompt in the same directory containining db_menu.c and your Makefile.