DBS201 Database Application Development Assignment

Assignment Help PL-SQL Programming
Reference no: EM132404882

DBS201 - Database Application Development - Seneca College

Objective:

In this assignment, you create a simple HR application using the C++ programming language and MySQL server. This assignment helps students learn a basic understanding of application development using C++ programming and a MySQL database.

Instruction:

In this assignment, we use the same database that you use for your labs.
Connecting to a MySQL database from a C++ Program
In your function main(), create a connection to your database. You need to implement the following functions:
int menu(void);

The menu() function returns an integer value which is the selected option by the user from the menu. This function displays the following menu options:

1) Find Employee
2) Employees Report
3) Add Employee
4) Update Employee
5) Remove Employee
0) Exit

Before printing the menu, display the following title on the screen

********************* HR Menu *********************

Prompt the user to enter an option. If the user enters an incorrect option, the user is asked to enter an option again. When the user enters a correct option (0 to 5), the function returns the selected value.

If the user selects 0 (Exit), the program terminates.

int findEmployee(MYSQL *conn, int employeeNumber, struct Employee *emp);

This function receives a MYSQL pointer (a reference variable to a MySQL database), an integer number as the employee number, and a pointer to a variable of type Employee. The function returns 0 if the employee does not exist. It returns 1 if the employee exits.
To store the employee data from the findEmployee() function, we use a variable of type structure called Employee. The Employee structure has the following members:

struct Employee{
int employeeNumber; char lastName[50]; char firstName[50]; char email[100]; char phone[50]; char extension[10];
char reportsTo[100]; char jobTitle[50]; char city[50];

};
The ReportsTo member stores the first name and the last name of the employee who is the manager of the given employee number.
If the employee exists, store the employee data into the members of an Employee variable using the third parameter in the findEmployee() function which references to that variable of type Employee.

Note: For this report, you may need to query more than one table (join).

void displayEmployee(MYSQL *conn, struct Employee emp);

If the user selects option 1, this function is called. First, prompt the user to enter a value for the employee number. Then, call function findEmployee() to check if the employee with the given employee number exists. If the returning value of function findEmployee() is 0, display a proper error message.
Sample error message:

Employee 1122 does not exist.

Otherwise, call the function displayEmployee() to display the employee information.
This function receives a MYSQL pointer (a reference variable to a MySQL database) and values of a variable of type Employee and displays all members of the emp parameter.

Display the employee information as follows: employeeNumber = 1002
lastName = Murphy firstName = Diane
email = [email protected] phone = +1 650 219 4782
extension = x5800 reportsTo = jobTitle = President city = San Francisco

void displayAllEmployees(MYSQL *conn);
If the user selects option 2 (Employees Report), call function displayAllEmployees().
This function receives a pointer of type MYSQL (a reference variable to a MySQL database) and displays all employees' information if exists.

Write a query to select and display the following attributes for all employees.

Attachment:- Database Application Development.rar

Reference no: EM132404882

Questions Cloud

Discuss the major articles of the texas constitution : Discuss the major articles of the Texas Constitution. What are the primary criticisms of this document and why does it seem pertinent to the politics
Examine the question of at-home union manufacturing : Written assignment: Examine the question of at-home union manufacturing versus overseas manufacturing for ECCO.
How can grit and growth mindset relate to one another : How can grit and growth mindset relate to one another? How could a grit or growth mindset be used to pursue goals?
Difference between your two survey results and extent : Explain if there is any difference between your two survey results and the extent to which this book has impacted your perceptions of decision-making,
DBS201 Database Application Development Assignment : DBS201 Database Application Development Assignment Help and Solution, Seneca College - Assessment Writing Service - create a simple HR application.
Explain the major components : Explain the major components that comprise the "legal system" that we see present within health care today
Describe sales and operations planning in terms : Describe sales and operations planning in terms of its purpose, components, and frequency and how they support the business strategy.
What is meant by principal agent conflict : What is meant by principal principal conflict two key means to align the interests of owners shareholders and managers in a corporation
Negotiating a service contract to subcontract : The company Appliances of Mexico is negotiating a service contract to subcontract the call service, which allows to coordinate repairs with the Spanish

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd