Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- - # 1 Add a statement below to DROP the database if it exists - - # 2 Add a statement below to CREATE

-- #1 Add a statement below to DROP the database if it exists
-- #2 Add a statement below to CREATE the database
-- #3 Add a statement to USE the database
-- class table statementCREATE TABLE IF NOT EXISTS grades.class (
class_id INT NOT NULL AUTO_INCREMENT,
department_code CHAR(4) NULL,
course_number INT NULL,
course_section CHAR(4) NULL,
course_name VARCHAR(100) NULL,
academic quarter CHAR(2) NULL,
academic_year INT NULL,
PRIMARY KEY (class_id)
:
INSERT INTO grades.class (department_code, course_number, course_section,
course_name, academic_quarter, academic_year)
VALUES ('INFO','1335','WW', 'Full Stack App Development', 'FA','2023');
----
CREATE TABLE IF NOT EXISTS grades.assignment (
grade_id INT NOT NULL AUTO_INCREMENT,
task_me VARCHAR(100) NULI,
points_earned INT NOT NULL,
points_possible INT NOT NULL,
class_id INT NOT NULL,
PRIMARY KEY (grade id),
CONSTRAINT fk_assignment_class
FOREIGN KEY (class_id) REFERENCES class (class_id)
-- grant priviledges for mgs user ----------------------------
GRANT DELETE, INSERT, SELECT, UPDATE ON grades.* TO mgs_user@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. auto-increments). 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 1: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 pre-written 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.
image text in transcribed

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

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions