INTRODUCTION TO DATABASE

        

1. In AWS RDS, create a MySQL database instance (Free tier), following the recording pro-vided in Week3. (Set the inbound IP address to 0.0.0.0, which make it accessible from any- where) attach a screenshot

2. In AWS Cloud9, create an environment (Free tier instance, with Ubuntu 18.04 system), following the recording provided in Week 3. attach a screenshot

3. Connect the database instance in AWS RDS from Cloud9 environment, following the recording provided in Week 3. attach a screenshot 

4. After you connect to the MySQL database on RDS, create a database named hrdb (using SQL statement), use SQL statement to show databases. attach a screenshot

5. Create tables and load data into those tables using the hrdb.sql I provided in D2L, then use SQL statement to show tables. attach a screenshot Hint: in mysql shell, use hrdb; source hrdb.sql; 

6. Answer the following questions with SQL statements, and attach screenshots. (You need to provide SQL statements and screenshots of the results/part of the results) use employees’ table

    

0. Write a query to get a unique department ID from the employee table. 

  1. Write a query to get all employee details from the employee table order by the first name, descending.
     
  2. Write a query to get the names (first_name, last_name), salary, PF of all the employees (PF is calculated as 15% of salary).
     
  3. Write a query to get the total salaries payable to employees.
     
  4. Write a query to get the number of employees working with the company.
     
  5. Write a query to display the name (first_name, last_name) and department ID of all employees in departments 30 or 100 in ascending order.
     
  6. Write a query to display the name (first_name, last_name) and hire date for all employees who were hired in 1987.
     
  7. Write a query to display the last name of employees having e as the third character.
     
  8. Write a query to get the maximum salary of an employee working as a Programmer.
     
  9. Write a query to get the average salary and number of employees working the depart- ment 90.