Please read through this page entirely and carefully, before beginning your work.
Consider a MySQL-based database that stores information about employees in an organisation and their reporting chain. Write code (in a general-purpose language) that connects to this database, gathers this information into a suitable tree-like internal data structure, and then writes some portion of (or all of) this information onto standard output, using indentation and layout to represent the reporting chain.
Specifically, your program should take three or four command line arguments, operating as follows. Say your prorgam is named "foo" and is invoked as follows (square brackets denote an optional argument):
$ foo uname pwd dbname [empname] |
There is a detailed example in the file ~cs33/data/hw3_empdata.txt, which I urge you to read and understand, very carefully. You must follow the above explicit output formatting instructions as well as the implicit ones in that example.
Consider, yet again, the actors and films example from Homeworks 1 and 2. Assume that the data from the relevant files in ~cs33/data/ have been loaded into the following tables in a MySQL database on "sunapee":
actor (actor_ID, first_name, last_name) film (film_ID, film_name, description, year) actor_film (actor_ID, film_ID) |
Write code (in a general-purpose language) to perform the necessary updates on the database. Specifically, your program should read seven command line arguments as follows:
$ foo uname pwd dbname first1 last1 first2 last2 |