DBS201 Introduction to Database Design and SQL Assignment

Assignment Help PL-SQL Programming
Reference no: EM132407260

DBS201 Introduction to Database Design and SQL - Database Application Development Assignment, Seneca College, Canada

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 complete the application from the first part to insert, update, and delete the employee information.

You need to implement the following functions:

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

This function receives a MYSQL pointer (a reference variable to a MySQL database) and a structure of type Employee and inserts the given employee information stored in the parameter emp to employee table.

In function insertEmployee(), call the function findEmployee() to see if the employee number of the given employee exists. If an employee with the same employee number exists display a proper message:

"An employee with the same employee number exists." and return to the menu.

Otherwise, insert the employee information into the employee table and display the following message:

"The new employee is added successfully."

void updateEmployee(MYSQL *conn, int employeeNumber);

This function receives a MYSQL pointer (a reference variable to a MySQL database) and an integer number as the employee number and updates the phone extension for the given employee. In function updateEmployee(), call function findEmployee() to see if the employee exists in table employees. If employee does exist, ask the user to enter the new phone extension. Store the new extension in table employees for the given employee number.

void deleteEmployee(MYSQL *conn, int employeeNumber);

This function receives a MYSQL pointer (a reference variable to a MySQL database) and an integer number as the employee number and deletes a row with the given employee number from table employees. In function deleteEmployee(), call function findEmployee() to see if the employee with the given employee number exists. If the employee does not exist display a proper message:

"The employee does not exist."

If the employee exits, delete the row from table employees and display a proper message:

"The employee is deleted."

Function main()

From the menu in the first part of the assignment, complete options 3 to 5.

1) Find Employee

2) Employees Report

3) Add Employee

4) Update Employee

5) Remove Employee

6) Exit

Add an Employee

If the user chooses option 3, prompt the user to enter the new employee information and store them into a variable of type Employee structure. Then, call function insertEmployee() to insert the new employee information in table employees.

Update an Employee

If the user chooses option 4, ask the user to enter the employee number:

Employee Number: 1216

Then, call function updateEmployee() to update the phone extension for the row with the employee number 1216. In this function, the user is asked to enter the new extension:

New Extension: x2111

The extension column of the row with the employee number 1216 will be updated with the new value x2111.

Delete an Employee

If the user chooses option 5, ask the user to enter the employee number:

Employee Number: 1818

Then, call function deleteEmployee() to remove the employee from table employees.

Note: For each query in your assignment, make sure you handle the errors and display the proper message including the error_code.

Error_code is a number returned if the query execution is not successful.

Attachment:- Database Application Development Assignment File.rar

Verified Expert

This application is based on the C++ and mysql.I have create the mysql database where i have create the different database table.This table is helps to store the record.C++ code is helps to store the record into database.C++ code has written for database connectivity and operation.

Reference no: EM132407260

Questions Cloud

Draw the new tree and find the rollback equilibrium : Now suppose the rules of the game are changed in only one respect: the president is given an extra power of a line-item veto.
Assuming that elizabeth is a rational : Assuming that Elizabeth is a rational, utility maximizer, derive the demand for good x when her income is $1,000 and the price of good y is held constant at py
What are the prices of good x and y : If the supply of goods x and y on Homothetica totals 50,000 units and 200,000 units, respectively, will there be any excess demand or excess supply
Emerging technologies and practices in next-generation data : Emerging technologies and practices in next-generation data analytics include blockchain, digital strategy, and Artificial Intelligence.
DBS201 Introduction to Database Design and SQL Assignment : DBS201 Introduction to Database Design and SQL - Database Application Development Assignment Help and Solution, Seneca College, Canada. Create a HR application
Why did the firm replaced the previous manager : Why did the firm replaced the previous manager and promoted you? Explain in detail.
Critical analysis of the approaches strengths and weaknesses : Critical analysis of the approaches strengths and weaknesses - create generalized DSS management diagrams that can represent DSS management approaches.
Taking into account the evidence mentioned above : Taking into account the evidence mentioned above, do you agree that the new employee should be fired? Explain.
Hiring four paralegals and firing some attorneys : Would your company save money in the writing of the 24 legal briefs by hiring the four new paralegals and firing some attorneys?

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