Data Base Application for Managers (Dr. Ebrahimi, TEST3 Spring 05)
Choose 5 questions including Q1. Answer all your questions on word document and print and hand in the first question as soon as you have done.
Q1a) Copy and paste the interface of your data base project here.
Q1b) Explain how many function do you have and how they work?
Q1c) paste the search part of your data base and run a simple test.
Q1d) Show how the record deletion function is working. Run a sample test and paste it here.
Q2)Expalin what the following commands do in Linux platform?
Q2a) mkdir cgi-bin
chmod +755 cgi-bin
cd cgi-bin
pico dbase.cpp
Q2b) g++ -o dbase.cgi dbase.cpp
chmod 755 dbase.cgi
cd ..
mkdir public_html
Q2c)chmod +755 public_html
cd public_htm
pico dbase.htm
chmod +755 dbase.htm
Q2d) telnet 137.139.181.16
http://pcfox.net/~ebrahimi/dbase.htm/
Q3a) How does a CGI program handle the following string?
f=John&f=Doe
Q3b) Is this statement correct for a CGI program statement? Correct it if not.
cout<<"Content type:text/html\n";
Q3c) What does the following statement do?
for(i=2;str[i]!='&';i++){
fname[n]=str[i];
n++;}
fname[n++]=0;
Q3d) Create a HTML file which contains a database menu includes insert.html and search.html
Q4a) What does the following code do, show the possible output?
ifstream record2("employee.txt", ios::in);
cout<<"TABLE BORDER=5"><TR><TD><B>First Name</B></TD>";
while(record2>>emp[i].fname){
cout<<"<TR><TD>"<<emp[i].fname<<"</TD></TR>"; }
cout<<"</TABLE><BR><BR>";
Q4b)
public boolean search(){
System.out.print("Enter the search name: ");
String searchName = cin.readString();
for(int i = 0; i < n; i++){
if ( searchName.equalsIgnoreCase(name[i])){
System.out.println("Found: "+name[i]);
System.out.println("Grosspay: "+grosspay[i]);
return true; }//IF
}//FOR
System.out.println("Name not found");
return true;
}//SEARCH
Q5a) Why php and mysql are used frequently in building databases?
Q5b) What does the following sql command do?
SELECT * FROM Employees
WHERE HoursWorked<40
:
INSERT INTO Employees
VALUES ('John', 'Doe', 'IT', 35.50, 60)
UPDATE Employees SET HourlyRate = 50.00
WHERE LastName = 'Ebrahimi'
Q5c) How the security is achieved in a data base? Give an simple example.
Q5d) How does validation achieved in a data base? Give an example.
Q6a) What is an advantage of array over file in handling databases? Give an example
Q6b) What is an advantage of a file over the array in handling a database. Give an example.
Q6c) What is the advantage of using random access file in handling a database. Give an example.
Q6d) How is encryption achieved in a database. Give a simple solution.