Reference no: EM133868940
Introduction to the Relational Database
SQL & NoSQL- Group Assignment
Purpose
The purpose of the assignment is to provide students with the opportunity to apply knowledge and skills developed during the semester regarding:
Apply skills learned in the SQL lecture to build a physical database
Application of DDL and DML components of SQL to:
creates and populates a relational database; and
Query to retrieve the data from the table
SQL to answer the provided questions
Section A
Create a database and name it
-Use the created database to create all the above tables. Make sure to include all the constraints, such as primary key, foreign key, Null, Not Null, and appropriate data type, and provide a screenshot after each table is created. Get in touch with us for online assignment help service!
Insert the data as provided in the above tables and provide a screenshot after inserting the data for each table.
Section B
Write SQL code that will create only the table structure for a table named EMPLOYEE1. This table will be a subset of the EMPLOYEE table. The basic EMPLOYEE1 table structure is summarized in the following table. Use EMP_NUM as the primary key. Note that the JOB_CODE is the FK to JOB so be certain to enforce referential integrity. Your code should also prevent null entries in EMP_LNAME and EMP_FNAME.
Write the SQL code to enter the first three records (the first three records should be the group members' first and last names). Use the hire date and job_code of the three records in the Employee1 Table below. Each row should be inserted individually without using a subquery.
Using the EMPLOYEE table that already exist, use a subquery to insert the remaining rows from the EMPLOYEE table into the EMPLOYEE1 table. Remember, your sub-query should only retrieve the column needed for the EMPLOYEE1 table and only the employees shown in the figure.
write the SQL code that will save the changes made to the EMPLOYEE2 table.
write the SQL code to change the job code to 507 for the person whose employee number (Emp_Num) is 107.
Write the SQL code to delete the row for John Alex, who was hired on November 08, 2000, and whose job code is 504. (Hint: Use logical operators to include all the information given in this problem. Remember, if you are using MySQL, you will have to first disable "safe mode.")
Write the SQL code to create a copy of EMPLOYEE1, including all its data, and name the new table EMPLOYEE2.
Using the EMPLOYEE2 table, write the SQL code that will add the attribute PCT and ProjNum to EMPLOYEE2. The PCT is the bonus percentage to be paid to each employee. The new attribute characteristics are:
PCT Numeric (5,2)
ProjNum Int
Using the EMPLOYEE2 table, write the SQL code to change the PCT value to 3.5 for the person whose employee number is 105.
Using the EMPLOYEE2 table, write the SQL code to change the PCT value to 7.5 for the employees whose employee numbers are 101,103, and 104.
Using the EMPLOYEE2 table, write a single command to change the PCT value to 15 for all employees who do not currently have a value for PCT.
Using the EMPLOYEE2 table, write a single command to add 0.75 to the PCT value of the employee's name is Fenny Fenny. (Use logical operator and Lame and FName).
Write SQL code to display the employee number, first name and last name, and project number and project name for the employees who not working on the project.
(Use EMPLOYEE and Project tables).
Write SQL code to display the employee number, first name and last name, and project number and project name for the employees who not working on any project. (Use sub-query) (Use EMPLOYEE and Project tables).
Write SQL code to find the total balance and name the field as Total Balance.
Write SQL code to display the employee's First name, and last name who have the same job code, and order the result by first name in ascending order.
Write SQL code to create virtual table For Employee1 table and name EmpVirtual and it includes the following fields (Emp_Num, LName, FName, and Job_Code) and for only employees not assigned to any project).
Write SQL code to display the results of EmpVirtual.
Section C
use a reverse engineering and draw and ERD based on the provided tables (Employee, Job, Assignment, and Project).
Use MongoDB (Studio3T) to create a database named Assi2GroupNo based on your Group Number.
Write a code to create a collection named an Assignment.
Write a code to insert the rows in the assignment table.
Write a code to display the database, Collection, and all inserted records.
Write a code to display all the records for Emp_Name, Julia.
Write a code to display all the records for Emp_Num that are not equal to 110.