Summary:To apply all acquired knowledge in the last Project Assignments to create a Database Scheme. For this project, the ERD is provided to you. Deliverables: SQL Script with your
Summary:To apply all acquired knowledge in the last Project Assignments to create a Database Scheme. For this project, the ERD is provided to you.
Deliverables:
- SQL Script with your name as follows: YourLastName_Project_Ph3.sql.
- MS Word Document with your OUTPUT, named as follows: YourLastName_Project_Ph3_Output.doc.
- ZIP file to include the two files mentioned above.
Required Software:
- MySQL DBMS by Oracle. MySQL Community Server and MySQL Workbench.
Lab Steps:
Step 1: Analyze the ERD for a student information system provided below. Be alert for the specifications provided for: 1) Entities, 2) Attributes, 3) Primary Key, and 4) Relationships. You will need to have a clear understanding for these components to create your database using MySQL.
Step 2: Create a New Database in MySQL, Produce SQL File, Drop Table
- Create a new Database, using the MySQL DBMS. MySQL Database Usage & Administration. (2010). By Vaswani, Vikram. McGraw Hill. ISBN: 978-0-07-160550-2.
- Utilize the SQL dialect you learned so far in this course for MySQL. Use the file supplemental textbook: MySQL Database Usage & Administration. (2010). By Vaswani, Vikram. McGraw Hill, as supplement your knowledge of the MySQL dialect.
- Create your SCRIPT file to be named: YourLastName_Project_Ph3.sql.
Step 3: Include the following commands at the tops of your scripts:
- SET FOREIGN_KEY_CHECKS=0;
- DROP TABLE IF EXISTS STUDENT;
- DROP TABLE IF EXISTS CAMPUS;
- DROP TABLE IF EXISTS ROOM;
- DROP TABLE IF EXISTS COURSE;
- DROP TABLE IF EXISTS INSTRUCTOR;
- DROP TABLE IF EXISTS APPROVED_INSTRUCTOR;
- DROP TABLE IF EXISTS CLASS;
- DROP TABLE IF EXISTS STUDENT_GRADE;
- SET FOREIGN_KEY_CHECKS=1;
Step 4: Create Tables in your database
- Create a new Table for each of the entities provided to you in the ERD diagram in Step 1.
- Add a column to represent each attribute addressed in the ERD diagram in Step 1.
- Designate Primary Key, as noted in the ERD diagram in Step 1.
- Designate a Foreign Key relationship between the tables, as noted in the ERD diagram in Step 1.
- Enable referential integrity on the relationships, as needed.
- Enable cascade updates as needed on the relationships.
Step 5: Designate Data Types. Update the data type as needed to enforce the domain constrain of the data. This needs to be completed for every column for all tables.
- Dates: they should have a date data designation type.
- Surrogate keys: shall be auto-numbered
- Character type: shall have a character data designation type.
Step 6: Column Constraints Designation.
- Grade designation must be of one of these values as follows: A, B, C, D, E, F, W, E (E=enrolled, and W = withdrawn).
- Student's first and last names are not to be designated as NULL.
- Course Credit hours shall be BETWEEN one and four.
- The instructor first and last name must NOT be NULL
- Course name designation has to be UNIQUE and must not be NULL type.
Step 7: Data Table Addition
- Use the INSERT operator to add minimum 2-3 rows of data per each database.
- You are free to use any values you might like for each of the columns.
- NOTE/ Reminder: you are required to add data to the parent table prior to adding any data to child tables, as referential integrity is enabled.
Step 8: Executing your SCRIPT
- Must incorporate the COMMIT command at the end of your Script
- Must incorporate the SHOW TABLES command, to display the table you created. At the end of the script created.
- Must incorporate the SELECT statement to show data allocated for each table. This would be added at the end of the script.
- EXECUTE your SCRIPT.
- Copy and paste your OUTPUT into your MS Word file as follows: YourLastName_Project_Ph3_Output.doc
Step 9: Upload your work
- Upload ZIP file to include the two files as follows: 1) SQL Script with your name as follows: YourLastName_Project_Ph3.sql, and 2) MS Word Document with your OUTPUT, named as follows: YourLastName_Project_Ph3_Output.doc.
Make sure, you have all the below things accomplished before sharing the answer:
1. Tables Created: create a table for each entity as noted in the ERD diagram in Step 1.
2. Columns Created: create a column for each attribute as noted the ERD diagram in Step 1.
3. Primary Key designation: primary key addressed for all tables with unique constraints specified as column properties.
4. Data Types: Addressed for each attribute. Should include: 1) Date data type incorporated, 2) Surrogate Key Automated, 3) Numeric data shall be numeric type, 4) Character data shall have a character type.
5. Relationships Created, as noted in the ERD diagram in STEP 1. Relationships shall be enabled for referential integrity and cascade updates.
6. Data Added per row: 5 rows of data for each table.
7. Column Constraints Added: As noted in the description for the project. Checked by adding rows with invalid values. Should take into consideration constraints as follows: 1) student name cannot be NULL, 2) course credit hours are restricted to allocations between 1-4, 3) course name is unique and NOT NULL, 4) instructor last name and first name can NOT be NULL, and 5) grade restrictions to the following values: A,B,C,D,F,I,W, E.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.