IST 634 Assignment 1 – MySQL Administration & Simple Queries
Introduction – In this laboratory exercise you will gain initial experience with MySQL Server and the MySQL Workbench application.
Instructions – Create a Microsoft Word document. For each task, paste a screenshot (more than one if necessary) into a single Word document proving that you have carried out the task. Submit the document via Blackboard. Due date: 10/1/2020 7:00am.
Download/install MySQL Server and Workbench if you have not already done so. Start the server, open MySQL Workbench and create a connection for the root account. Connect to the server using this connection. The COMPANY database of the Elmasri/Navathe text (see Figure 5.5, e.g.) will be used throughout this assignment (and possibly more assignments). Carry out each of the following tasks from SQL Workbench.
1. From your MySQL Administrator (root account), create the company database (it will be empty – you will create the components of the schema, tables, later).
2. Create a user book and grant all rights on company to the user book (book is not an administrator, so should have no other rights). This can be done using SQL commands of the following form:
CREATE USER my_user;
GRANT ALL PRIVILEGES
ON my_database.*
TO my_user
WITH GRANT OPTION;
A command can be all on one line, but having on multiple lines makes it easier to read. The ‘;’ terminates a single SQL command.
Create a MySQL Workbench connection for the book account. Use this connection to connect to the server. Choose the company database (if not part of your connection).
4. For each table in the company schema (see Figure 5.5), create a DDL statement to add the table to the database, then execute the statement. You may want to create a SQL script (file with extension .sql) for each statement to make it easier to create/modify the DDL statement. An example of such a statement is given in the file ‘employee.sql’ which is part of this assignment (you will need to take out the foreign keys from the tables – you should put them back in with ‘ALTER TABLE’ commands after you have loaded the table with data).
5. After you have created the tables in the company database, you need to fill them with data. Each table X has a file X.dat with data for that table attached to this assignment (these are text files, so have a look at them with your text editor). You will use the MySQL LOAD command to accomplish this. An example SQL script for loading the data into the employee table is attached to this assignment. Execute this script, and then a SQL ‘select *’ query to be sure that the data has been loaded. Create and execute scripts for the remaining tables, executing ‘select *’ to prove that the data has been loaded. (You may need to ‘clean up’ the data in some of the .dat files in order for it to load, you will get an error message when you try to execute the LOAD statement if this is the case – try to load and note where any errors occur – start the cleanup from there and try to load again).
IMPORTANT NOTE – THERE IS SOME DIFFICULTY USING LOAD WITH THE NEW VERSION OF MYSQL, SO FOLLOW THESE STEPS BEFORE DOING THE LOADS!
On MacOS:
1. Create a my.cnf file with the following statements:
[client]
port = 3306
[mysqld]
port = 3306
secure_file_priv=”
local-infile = 1
2. Set the my.cnf file as the default configuration file
3. Restart the MySQL server
4. Try the following statements in MySQL Workbench:
SHOW VARIABLES LIKE “local_infile”; //Should be ON
SHOW VARIABLES LIKE “secure_file_priv”; //Should have no values (not NULL but blank)
5. Put the files you want to upload in the /tmp folder
6. LOAD DATA without the LOCAL keyword (i.e., LOAD DATA INFILE ‘your_file’ INTO TABLE table_name …)
On Windows:
1. Run the following statement in MySQL Workbench:
SET GLOBAL local_infile = ‘ON’;
2. Run the following statement and make sure it shows ON:
SHOW VARIABLES LIKE “local_infile”;
3. SHOW VARIABLES LIKE “secure_file_priv”; //Then you’ll get the default path, usually C:\ProgramData\MySQL\MySQL Server 8.0\Uploads
4. Put your files into the folder shown in step 3
5. LOAD DATA without the LOCAL keyword (i.e., LOAD DATA INFILE ‘your_file’ INTO TABLE table_name …)
6. Create a query to retrieve the names of all employees in department 5 who work more than 10 hours per week on the ProductX project. Execute the query and show the results.
7. Create a query to list the names of all employees who have a dependent with the same first name as themselves. Execute the query and show the results.
8. Create a query to find the names of all employees who are directly supervised by ‘Franklin Wong’. Execute the query and show the results.
9. Create a query to change the location of department 8 from Chicago to Cleveland. Execute the query and show the results.
10. Create a query to add a new daughter born today named Sarah for Franklin Wong (make up a SSN for Sarah which is unique). Execute the query and show the results.
11. Create a query to delete the Computerization project. Execute the query and show the results.
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.