Task: 1

Please create a new database by the name "Empl_Training" and import the employeetraining.sql into it at phpMyAdmin webpage.

1.generate a screenshot of the list of the tables in this database and insert the screenshot here. Be sure to show all the tables clearly.

2.How many fields of Table "employee"?

3.How many records of Table "employee"?

Task: 2

Write a query to retrieve the employees' Emp_ID, First_Name, and Last_name from the Sales departments, and get a screenshot of the query output and insert it after your query.

Task: 3

At phpAdmin, create a query to retrieve the employees' First_Name, Last_name and Dept from the employees who was hired before 1/1/2007 and has completed the training course D.

Employee Training SQL

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `employeetraining`
--

-- --------------------------------------------------------

--
-- Table structure for table `course`
--

CREATE TABLE `course` (
`Training_Course` int(3) NOT NULL,
`Course_Name` char(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `course`
--

INSERT INTO `course` (`Training_Course`, `Course_Name`) VALUES
(101, 'A'),
(103, 'C'),
(202, 'E'),
(205, 'B'),
(207, 'F'),
(210, 'D');

-- --------------------------------------------------------

--
-- Table structure for table `employee`
--

CREATE TABLE `employee` (
`Emp_ID` int(5) NOT NULL,
`Last_Name` char(20) NOT NULL,
`First_Name` char(20) NOT NULL,
`Dept` char(5) NOT NULL,
`Salary` int(5) NOT NULL,
`Hire_Date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee`
--

INSERT INTO `employee` (`Emp_ID`, `Last_Name`, `First_Name`, `Dept`, `Salary`, `Hire_Date`) VALUES
(10020, 'Marvin', 'John', 'Mktg', 65000, '2004-03-01'),
(10300, 'Carter', 'Michael', 'Sales', 60000, '2005-02-01'),
(20040, 'Sanches', 'Jose', 'Sales', 58000, '2007-08-01'),
(20139, 'Gates', 'Susan', 'Acctg', 62000, '2006-03-01'),
(21113, 'Li', 'Ping', 'Ops', 55000, '2008-09-01');

-- --------------------------------------------------------

--
-- Table structure for table `registration`
--

CREATE TABLE `registration` (
`Course_Date` date NOT NULL,
`Emp_ID` int(5) NOT NULL,
`Training_Course` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `registration`
--

INSERT INTO `registration` (`Course_Date`, `Emp_ID`, `Training_Course`) VALUES
('2004-04-01', 10020, 101),
('2004-09-01', 10020, 205),
('2005-08-01', 10300, 103),
('2006-08-01', 10300, 210),
('2008-08-01', 20040, 210),
('2007-09-01', 20139, 202),
('2009-09-01', 21113, 207);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `course`
--
ALTER TABLE `course`
ADD PRIMARY KEY (`Training_Course`);

--
-- Indexes for table `employee`
--
ALTER TABLE `employee`
ADD PRIMARY KEY (`Emp_ID`);

--
-- Indexes for table `registration`
--
ALTER TABLE `registration`
ADD PRIMARY KEY (`Emp_ID`,`Training_Course`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.