Using the provided entity relationship diagram (ERD), you will create tables by writing the Structured Query Language (SQL) statements. Use paiza.io for MySQL to execute and troubleshoot your SQL...

Using the provided entity relationship diagram (ERD), you will create tables by writing the Structured Query Language (SQL) statements. Use paiza.io for MySQL to execute and troubleshoot your SQL statements.



It is recommended that you use Notepad to write your SQL statements. Then, copy and paste your SQL statements into paiza.io to test your statements to ensure that they execute without errors. Save your work frequently.


Write the SQL statements to create the database based on the provided ERD. Do the following:



  1. Create a database called itco231_u4.

  2. .Create the 4 tables in the provided diagram.



    1. As you will see in the diagram, primary keys (PKs) and foreign keys (FKs) are indicated. Ensure that you implement the constraints as specified, including the composite PK.

    2. All name and address type columns should not be null.

    3. Data types for student and professor IDs should be a numeric data type.

    4. Date columns should be a date data type.

    5. All other columns should be a variable character data type of an appropriate length.


  3. Next, you will make up some sample data that you will insert into each table.


    1. Add 3 students to the student table.


      1. All student IDs should be at least 5 digits long and start with the same number.


    2. Add 2 professors to the professor table.


      1. All professor IDs should be at least 4 digits long and start with the same number. It should not begin with the same number as the student IDs.


    3. Add 2 courses to the course table.

    4. Add each student to one of the courses. All students must have the same professor and start date.


  4. To test your SQL statements, copy and paste all statements into paiza.io, and click on “Run.” If you see error statements in the Output area, then at least one of your statements has an error. Review the error to help troubleshoot your code. Ideally, your statements should all run without error. If you have any error that you are not able to fix, remember that it is more important to submit a partially working file than to submit nothing.

  5. Save all of your final SQL statements into a text file using Notepad.


Jan 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here