Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave

On successful completion of this module students will be able to

1.Understand fundamental concepts of database management systems such data independence, data models and database technologies

2.Be able to design and implement relational database systems

3.Be able to use manipulation and querying tools, including the use of Structured Query Language (SQL) for managing data held in a relational database management system (RDBMS)

4.Be able to test and document relational database systems

3.Be able to use manipulation and querying tools, including the use of Structured Query Language (SQL) for managing data held in a relational database management system (RDBMS)

4.Be able to test and document relational database systems

Kindly see the SQL script in appendix to create the above database / tables and to insert the data)

1.WriteanSQL statement to list all employees with their full names, hire date and title

2.Write anSQL statement to show the salaryof all employees and their department name.

3.Write anSQL statement to show the full names and gendersof HR department staff.

4.Write anSQL statement to showthe all departments’ name and their departments’ managers.

5.Write anSQL statement to show a list of department managers who were hired after 1986

6.Write anSQL statement to change anyemployee’s title. Assume the employee has just phoned in with his/her last name.

7.Write anSQL statement to delete employee’s record who belongs to department 'd004' and ID 10003.

8.Create a database view to list full names of all employees, their department managersand salaries.

9.Create a database view to list alldepartments and their department managers, who were hired between 1980 and 1990.

10.Write anSQL statement to increase salaries of all employees up to 10% who are working in marketing department

Understand fundamental concepts of database management systems such data independence, data models, and database technologies.

This query is used to fetch the full names of an employee, the date that the employee was hired, and the title of the employee. Because the full names are saved as first name and last name the query uses an inbuilt sql function called concat which concatenates the two columns while adding a space between the two columns. To get the title a join between employees table and titles table is needed. The type of join used is inner join using the emp_no column in both tables thus the query returns all columns for which the emp_no in the employees table matches the emp_no in the titles table.

  1. SQL to show salaries and department name of all employees

This query is used to show the full names of each employee, their current salary and the department name the employee works in. Concat function is used to show the full names of the employee by concatenating the first name and the last name of the employee. The salary of an employee is found in the salaries table thus an inner join is done between the salaries table and the employee table using the emp_no column in both tables. To get the department name that an employee works in, a join between employees table and departments table is done using the joint table dept_emp.

  1. SQL to show full names and genders of HR department staff

This query is used to show the full names and the gender of all employees working in the human resources department. The first name and the last name are concatenated using the concat function. To join the employees and departments tables a join of the dept_emp supporting table is done. Finally a condition is used to filter only employees working in the human resources department.

  1. SQL to show all department name and their department managers

Results:

This  query is used to show the names of all departments and the names of the manager for each respective department. To get the full names of the manager, concatenation of the first and last name of the manager is done using the concat function. An inner join between the departments table and dept_manager table is done and another inner join between the dept_manager and employees table is done. The dept_manager is the joint table joining departments and employees table.

  1. SQL to show department managers that were hired after 1986

This query Is used to get the department name, the name of the manager, the date that the manager was hired for all managers that were hired after 1986 which is from 1st of January 1987. To get the full names of the manager, concatenation of the first and last name of the manager is done using the concat function. An inner join between the departments table and dept_manager table is done and another inner join between the dept_manager and employees table is done. The dept_manager is the joint table joining departments and employees table.A condition is used to filter all managers who were hired after 1986.

  1. SQL to change an employee’s title using their lastname

Design and implement relational database systems.

This query is used to update the date of birth of an employee using their last name. The first query shows the details of the employees before the update is done. The second query updates only the date of birth of the employee with the last name as Simmels that is why according to the screenshot, only 1 row has been affected. The last query shows the details of the employee after the update query is done.

  1. SQL to delete an employee belonging to department d004 with id 10003

SQL Code:

This query is used to delete an employee with employee id 10003 who is working in department d004. The employee

  1. SQL to create view to list full names of all employees, their department managers and salaries

SQL Code:

Fetching the results of the query.

This view is created to get the full names of employees, their salaries and the full names of the department that the employee works in.

  1. SQL to create vies to list all departments and their department managers who were hired between 1980 and 1990.

SQL Code:

Select all the rows in the view

  1. SQL to increase salaries for all employees working in marketing department by 10%.

SQL Code:

Before Update:

Update Query

This query is used to update the salaries of all employees working in the marketing department. To update the salary you have to join the employees table to the supporting dept_emp table and then join it to the departments table and finally join it to the salaries table and restrict the update for only those employees working in the department with the department name marketing.

  1. Why database testing is important.

Database testing is important because complex applications require complex backend databases to support the application. Thus there is a need to test the database to make sure it meets the all requirements required for the efficient and accurate operation of the front end part of the application. Testing in databases is done for;

  • Validation of the acid properties of the database.- This type of testing involves testing the Atomicity, Consistency, Isolation and durability of each database transaction. Atomicity is done to test whether a transaction passes or fails where it has to pass the all-or-nothing rule. Consistency involves testing whether each transaction will leave the database in a consistent state. Isolation property involves testing the database to make sure that if multiple transactions are executed at once then state of the database should be as if the transactions were executed in order. Finally durability involves testing that once a transaction is committed, no external factors can change its outcome.
  • Data integrity- Testing to ensure data integrity involves making sure that for all tables that are related CRUD operations on each of the tables should maintain consistent data in all the tables. For example an update in the parent table should result to changes in the child tables.
  1. Testing process.
    1. Field size validation

Field size validation involves testing the database to make sure that the size of the field specified for a specific column is not violated. For example if a column has varchar data type and is restricted to a size of 50 then no data should have data exceeding 50 for this column.

To test field size validation we insert data in departments table where the dept_no should have is char(4) so we insert a record with more than 4 characters.

The query executes successfully but the value inserted in the table is trimmed to 4 characters as shown in the results below.

  1. Not null values

Not null validation ensures that a column that has a property of null must all always have a value during the insertion of a record. For example in the departments table the dept_name has not property thus inserting a null value would fail.

Query

When this query is executed it fails because dept_name should not have a null value.

  1. Primary key

Primary key validation involves making sure no duplicate primary keys exist in a table because every primary key is supposed to be unique. For example in the departments table, inserting a duplicate entry key results to an error as shown in below.

  1. Foreign key

Foreign key validation involves testing that no integrity constraints are violated. For example you cannot insert a record in the child table for a primary key that does not exist in the parent table. For example considering two tables; employees the parent table and salaries the child table, you cannot insert a salary record for an employee that does not exist as demonstrated in the screenshot below.

References

Sharma, R., Mohamed, A., Aryan, M., kuchana, r., Ramesh, M. and patra, s. (2018). Database Testing Guide (Why, How, and What About Database Testing). [online] Softwaretestinghelp.com. Available at: https://www.softwaretestinghelp.com/database-testing-process/ [Accessed 20 Nov. 2018].

Cite This Work

To export a reference to this article please select a referencing stye below:

My Assignment Help. (2021). Fundamental Concepts Of Database Management Systems And SQL In An Essay.. Retrieved from https://myassignmenthelp.com/free-samples/qac020c155a-data-modelling-and-sql-language/systems-such-data-independence.html.

"Fundamental Concepts Of Database Management Systems And SQL In An Essay.." My Assignment Help, 2021, https://myassignmenthelp.com/free-samples/qac020c155a-data-modelling-and-sql-language/systems-such-data-independence.html.

My Assignment Help (2021) Fundamental Concepts Of Database Management Systems And SQL In An Essay. [Online]. Available from: https://myassignmenthelp.com/free-samples/qac020c155a-data-modelling-and-sql-language/systems-such-data-independence.html
[Accessed 26 April 2024].

My Assignment Help. 'Fundamental Concepts Of Database Management Systems And SQL In An Essay.' (My Assignment Help, 2021) <https://myassignmenthelp.com/free-samples/qac020c155a-data-modelling-and-sql-language/systems-such-data-independence.html> accessed 26 April 2024.

My Assignment Help. Fundamental Concepts Of Database Management Systems And SQL In An Essay. [Internet]. My Assignment Help. 2021 [cited 26 April 2024]. Available from: https://myassignmenthelp.com/free-samples/qac020c155a-data-modelling-and-sql-language/systems-such-data-independence.html.

Get instant help from 5000+ experts for
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing: Proofread your work by experts and improve grade at Lowest cost

loader
250 words
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Plagiarism checker
Verify originality of an essay
essay
Generate unique essays in a jiffy
Plagiarism checker
Cite sources with ease
support
Whatsapp
callback
sales
sales chat
Whatsapp
callback
sales chat
close