Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using PHPMYADMIN create the database with the name COMPANYDB_YOUR_NAME_YOUR_ID, and create 2 tables: departments and employees in this database. The relationship between the departments and

Using PHPMYADMIN create the database with the name COMPANYDB_YOUR_NAME_YOUR_ID, and create 2 tables: departments and employees in this database. The relationship between the departments and employees tables is 1:M (one department may have 0, 1 or many employees, and one employee may work in one and only one department). The departments table will contain the following columns: ID (this is a department ID), Department name. Employees table will contain the following columns: id (which is employee ID), employee first name, employee last name, employee salary, employee email, department ID (this is a foreign key, references department ID in departments table where this employee is working). You have to create these tables in PHPMYADMIN and add few rows in each one. You have to decide the names of columns and proper data types and constraints. Populate the employees and departments tables with few rows (minimum 5). Create a webpage (name it YOUR_NAME_STUDENT_ID.php) with server side PHP code that connects with the database and retrieves the data from employees and departments tables (use SQL joins in your query) and puts in the HTML content (for example creates the HTML table). When the page is open from the server (from localhost) the user must see the list of employees together with department names where they are working.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions