Question: 4) You will create and use a new second database, sem_projectB. Your script must be able to be run repeatedly as a single file. Add

4) You will create and use a new second database, sem_projectB. Your script must be able to be run repeatedly as a single file. Add the following tables,

Add data with a single INSERT for each table: Table employee with fields ID as an integer field; do not allow NULL values; have it auto-increment firstName as a 100 variable character field; do not allow NULL values lastName as a 100 variable character field; do not allow NULL values jobTitle as a 100 variable character field; default to a NULL value salary as a double field; default to a NULL value notes as a text field Make ID the primary key.

Use the following as data for the respective fields: Robin, Jackman, Software Engineer, 5500 Taylor, Edward, Software Architect, 7200 Vivian, Dickens, Database Administrator, 6000 Harry, Clifford, Database Administrator, 6800 Eliza, Clifford, Software Engineer, 4750 Nancy, Newman, Software Engineer, 5100 Melinda, Clifford, Project Manager, 8500 Harley, Gilbert, Software Architect, 8000

Table education with fields ID as a tiny integer field; do not allow NULL values; have it auto-increment edname as a 50 variable character field; do not allow NULL values Make ID the primary key.

Use the following as data for the respective fields: BSc, MSc, MD, JD, DDS, PhD

Table employee_education with fields employeeID as an integer field; do not allow NULL values educationID as a tiny integer field; do not allow NULL values Add constraints fk_Employee_EmployeeID indicating that employeeID is a foreign key for the ID field in table employee fk_Education_EducationID indicating that educationID is a foreign key for the ID field in table education .

Make a compound primary key from employeeID and educationID Use the following as data for the respective fields: (1, 1), (2, 1), (3, 2), (3, 6) Perform the following queries:

Query 2-1: Show the employee first name, last name, and education level for all employees, utilizing the many-to-many relationship so your results are as in the following table. (Hint: only a single table select using employee; LEFT JOIN with others; do not use WHERE.)

Query 2-2: Show the employee first name, last name, and education level for only those employees with an entered education level, so that your results are as in the following table. (Hint: only a single table select using employee; JOIN with others; do not use WHERE.)

Query 2-3: Show the employee first name, last name, and education level for only those employees with an entered education level, but show all available education levels, so that your results are as in the following table. (Hint: only a single table select using employee; RIGHT JOIN with others; do not use WHERE.)

I have created the above database need some help in these 3 queries in MySQL.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!