Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

* * * * Please write an sql script with the table provide * * * Objectives: Write SQL statements to define a database, to

****Please write an sql script with the table provide***
Objectives: Write SQL statements to define a database, to define tables, to view the table structures, to upload data into the tables
This lab is designed to let you have hands-on experience writing SQL statements. It includes creating relations and loading data into each table. You have to use MySQL and a text editor (i.e., notepad++, notepad) to complete this assignment. The Lab 2 manual provides a good introduction to the basic features of SQL. After following the manual, you should be able
to complete this assignment. You may also wish to refer to Chapter 5 of the textbook. You should use a text editor to type your SQL statements and save the file as a SQL script file. An SQL script file is a text file that contains a sequence of SQL statements. Lab2Ex.sql is an example of the SQL script file. The file extension of a SQL script file is typically with a sql" extension. You may use the SOURCE command to run the whole script file (all SQL
commands) or copy and paste each SQL statement from the text editor to the MySQL client. You will be required to prepare and submit a number of SQL scripts for this and future labs.
Your task is to write SQL statements to define tables for the corresponding relations. Make sure that the data type and size for each attribute are appropriate. For example, DATE data type is a better choice than a string data type for the attribute joinedDate. In addition, you have to write SQL statements to load data into each table based on the given records. Put your SQL statements into a text editor (i.e., Notepad++) and save it as a SQL script file and submit it to Blackboard by May 30 at 7:00 PM.Make sure your SQL file can be run successfully in MySQL before submitting it because I will run and grade it. If it cant be run, your grade of this assignment will be a ZERO.
Tasks:
1. Write a SQL statement to select the database with your last name to store the data. If it does not exist in your MySQL server, use CREATE DATABASE command to create one.
2. WRITE SQL statements to remove the tables from the database.
3. Write SQL statements to define the above three tables in the database.
4. Write SQL statements to display the structure of the newly-built tables.
5. Write SQL statements to load records into the tables. Add one more record with your own data.
/*****
Task 1: Write a SQL statement to select the database with your last name to store the
data. If it does not exist in your MySQL server, use CREATE DATABASE command
to create one.
Put your response below: ******/
...
/*****
Task 2: WRITE SQL statements to remove the tables from the database.
Put your response below: ******/
...
/*****
Task 3: Write SQL statements to define the above three tables in the database.
Put your response below: ******/
...
/*****
Task 4: Write SQL statements to display the structure of the newly-built tables.
Put your response below: ******/
...
/*****
Task 5: Write SQL statements to load records into the tables. Add one more
record with your own data.
Put your response below: ******/
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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions

Question

2. Darwins notes in biology.

Answered: 1 week ago

Question

What are the symptoms and root cause of wastage in a restaurant?

Answered: 1 week ago

Question

L A -r- P[N]

Answered: 1 week ago