Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- - # 1 Add a statement below to DROP the database if it exists - - # 2 Add a statement below to CREATE
# Add a statement below to DROP the database if it exists
# Add a statement below to CREATE the database
# Add a statement to USE the database
class table statementCREATE TABLE IF NOT EXISTS grades.class
classid INT NOT NULL AUTOINCREMENT,
departmentcode CHAR NULL,
coursenumber INT NULL,
coursesection CHAR NULL,
coursename VARCHAR NULL,
academic quarter CHAR NULL,
academicyear INT NULL,
PRIMARY KEY classid
:
INSERT INTO grades.class departmentcode, coursenumber, coursesection,
coursename, academicquarter, academicyear
VALUES INFOWW 'Full Stack App Development', FA;
CREATE TABLE IF NOT EXISTS grades.assignment
gradeid INT NOT NULL AUTOINCREMENT,
taskme VARCHAR NULI,
pointsearned INT NOT NULL,
pointspossible INT NOT NULL,
classid INT NOT NULL,
PRIMARY KEY grade id
CONSTRAINT fkassignmentclass
FOREIGN KEY classid REFERENCES class classid
grant priviledges for mgs user
GRANT DELETE, INSERT, SELECT, UPDATE ON grades. TO mgsuser@localhost;A Log in to your VM
Note: For help, reference Accessing your VM
B Download this SQL script: createGradesDbScript.sql darr
C Launch MySQL Workbench and connect to MySQL
Important: Make sure to analyze the script file and make note of important table and column attributes, including the primary and foreign keys and what values are automatically
generated for you eg autoincrements For your reference, below is a Entity Relationship Diagram ERD showing the entity structure and the relationship of the tables.
E Finish writing the script so that it creates a database called grades and two tables called class and assignment with a :M relationship respectively.
Note: Please follow the three commented prompts in the provided script. The CREATE statements for the class and assignment tables are already written for you. The script also
contains prewritten insert statements, one record for each table.
F Run the script by clicking on
G Save this updated SQL Script by selecting File Save Script As from the menu. Name your script myCreateScript.
Note: Later, you will submit this script file as a deliverable for the final project.
H Tol Take a screenshot showing that your grades database exists with the appropriate tables in MySQL Workbench. Name the screenshot gradesDb.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started