Server 2 - MySQL #1 Lab

Similar documents
Server-Configuration-2-MySQL-1-HW.docx CSCI 3343 Initials P a g e 1

DB-Queries-1 - REVIEW Individual 20 Points

Intro-PHP-HW.docx CSCI 3343 Initials P a g e 1

Intro To HTML & Web & Relational Queries Individual Assignment 30 Points

Chapter 11-B Homework ScalaFX & Eclipse Individual Assignment 25 Points

Chapter 4C Homework Functions III Individual Assignment 30 Points Questions 6 Points Script 24 Points

OOP- 5 Stacks Individual Assignment 35 Points

Chapter 11-D Homework ScalaFX & Eclipse Individual Assignment 10 Points

OOP-10 BTree & B+Tree Individual Assignment 15 Points

Design Relationships, Indexes, Queries, & More (Individual/Team Of 2) Assignment 20 USE PENCIL

OOP-15-AVL Final Project-1-HW Individual Assignment 70 Points

OOP-8-DLList-1-HW.docx CSCI 2320 Initials Page 1

PCS1-Ch-3B-Basic-Loops-HW CSCI 1320 Initials P a g e 1

OOP- 4 Templates & Memory Management Print Only Pages 1-5 Individual Assignment Answers To Questions 10 Points - Program 15 Points

OOP- 6 Direct Access Files & Software Engineering Individual Assignment

Cisco Switch Lab II (1-3 Persons) Individual/Team Lab 35 Points

Linux Command Homework Individual/Team (1-2 Persons) Homework Assignment Turn In One Copy Per Person 5 Points

Clean Up Team Lab 10 Points. Cisco Switch Lab I Individual Lab 25 Points

Business Router II Lab

Simple Router Configuration Router Lab 10 Points Networking & Data Communications

Using MySQL on the Winthrop Linux Systems

3344 Database Lab. 1. Overview. 2. Lab Requirements. In this lab, you will:

IELM 511 Information Systems Design Labs 5 and 6. DB creation and Population

CSCI 201 Lab #11 Prof. Jeffrey Miller 1/23. Lab #11 CSCI 201. Title MySQL Installation. Lecture Topics Emphasized Databases

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

In-Class Exercise: SQL #2 Putting Information into a Database

CSC 3300 Homework 3 Security & Languages

HTML Forms & PHP & MySQL Database. Database Systems CSCI-3343 Dr. Tom Hicks Computer Science Department

Function Terminology

MySQL On Crux Part II The GUI Client

Database Username And Current User Schema Do Not Match Sql Server

Full file at

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

Database Systems Management

Course Outline and Objectives: Database Programming with SQL

CSC 4710 / CSC 6710 Database Systems. Rao Casturi

Lecture 5. Monday, September 15, 2014

Database Management Systems by Hanh Pham GOALS

ITCertMaster. Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way!

Database Programming - Section 16. Instructor Guide

Networks and Web for Health Informatics (HINF 6220)

CSCI 1100L: Topics in Computing Lab Lab 07: Microsoft Access (Databases) Part I: Movie review database.

LABSHEET 1: creating a table, primary keys and data types

Mysql Workbench Cannot Drop Schema

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

Big Data NoSQL Databases Individual Assignment 20 Points

TopView SQL Configuration

User's Guide c-treeace SQL Explorer

Database and MySQL Temasek Polytechnic

Chapter 3 Introduction to relational databases and MySQL

Database Systems. phpmyadmin Tutorial

CS 2316 Exam 4 Fall 2011

Course and Contact Information. Course Description. Course Objectives

Alter Schema Dbo Transfer Sql Server 2000

Your (printed!) Name: CS 1803 Exam 3. Grading TA / Section: Monday, Nov. 22th, 2010

CSC116: Introduction to Computing - Java

NoSQL Databases & Big Data Individual Assignment 50 Points

DATABASE SYSTEMS. Introduction to MySQL. Database System Course, 2018

SQL: Concepts. Todd Bacastow IST 210: Organization of Data 2/17/ IST 210

MIS2502: Data Analytics MySQL and SQL Workbench. Jing Gong

Accuterm 7 Usage Guide

Lab 1: Setup 12:00 PM, Sep 10, 2017

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

Using Relational Databases for Digital Research

Odyssey Quick Start. Quick Links: Launch Pad and Assignments Portfolio and Reports FAQs For Parents GUIDE FOR STUDENTS AND PARENTS

Relational Database Development

Module 3 MySQL Database. Database Management System

Oracle Application Express Users Guide

CS157a Fall 2018 Sec3 Home Page/Syllabus

Quick Guide to Installing and Setting Up MySQL Workbench

Locate your Advanced Tools and Applications

DOCUMENT REVISION HISTORY

Course and Contact Information. Course Description. Course Objectives

CS634 Architecture of Database Systems Spring Elizabeth (Betty) O Neil University of Massachusetts at Boston

Introduction to Computer Science and Business

CIS 3308 Web Application Programming Syllabus

CS 2316 Exam 4 Fall 2011

Data Analysis and Integration

Install & Configure Windows 10, Visual Studio, & MySQL Dr. Tom Hicks Trinity University

CS 2316 Homework 9a GT Pizza Login Due: Wednesday November 6th Out of 100 points. Premise

EE221 Databases Practicals Manual

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

Registration, Data Download, and Online Homework

CPS221 Lecture: Relational Database Querying and Updating

c r e at i N g yo u r F i r S t d ata b a S e a N d ta b l e

CPS221 Lecture: Relational Database Querying and Updating

Instructor: Craig Duckett. Lecture 14: Tuesday, May 15 th, 2018 Stored Procedures (SQL Server) and MySQL

MySQL Introduction. By Prof. B.A.Khivsara

POWERSCHOOL PARENT PORTAL. The Basics

Database Programming - Section 18. Instructor Guide

SQL Data Definition Language: Create and Change the Database Ray Lockwood

T-sql Grant View Definition Example

Tutorial.sql First Video Set April 5, 2017

CS211 Lecture: Database Querying and Updating

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Table of Contents DATA MANAGEMENT TOOLS 4. IMPORT WIZARD 6 Setting Import File Format (Step 1) 7 Setting Source File Name (Step 2) 8

Sql Server 2008 Move Objects To New Schema

GUIDE FOR STUDENTS AND PARENTS. An orange ring means you have an assignment.

CSC116: Introduction to Computing - Java

CPS352 - DATABASE SYSTEMS. Professor: Russell C. Bjork Spring semester, Office: KOSC 242 x4377

Transcription:

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 1 If this lab is an Individual assignment, you must do all coded programs on your own. You may ask others for help on the language syntax, but you must organize and present your own logical solution to the problem. No lab is complete until the student submits the signed pledge form associated with that lab. I realize that no coded programs will be graded until I turn in the sign & pledge form associated with that program; any late penalties will continue to compound until the pledge form is submitted. If this lab is a team assignment, both team members may share logic as they program side by side on their own computers. Each person must type all of his/her own code as part of the learning process. Team assignments are never to be You do this portion and I ll do that portion or You do this lab and I ll do the next lab. Some of the lab assignments will have short answer questions. These short answer questions will be spot checked and graded for completion, but not checked for accuracy. I encourage you to get into a study group to help each other prepare for exams, quizzes, etc. Once these labs are graded and returned, I encourage you to compare answers with another class member, in your study group, who has also had the lab graded and returned. I/We realize that the penalty for turning in work that is not my own, or assisting others in doing so, can range from an "F" in the class to dismissal from Trinity University. I realize that it is a violation of academic integrity to share any portion of this lab with any person (outside my 3343 team & professor)! Print Name Time Required =. Hrs. Signature (pledged) Server 2 - MySQL #1 Lab Individual/Duo Lab 35 Points In a Duo Lab, Two Class Members May Sit Side By Side And Work Through The Lab On Two Different Computers You May Choose To Help Each Other! You May Share Techniques! You May Show You re your Team Mate Your Code But Each Person Is To Do All Of Their Own Typing & Enter All Of Their Own Command. Each Person Is To Sign/Pledge & Submit Their Own Pledge Form. You May Enter Your Solutions Into The Word Document & Print If Doing This Lab Individually! Complete Windows-Database-Server-Installation-2 Sign Off On The Items Below As You Complete The Tutorial Above 1] {Initial/Pledge} I successfully installed the Rapid Environment Editor on my system. I have successfully used it to add the MySQL path to my Server. 2] {Initial/Pledge} I can successfully log into MySQL (to my Server) without entering the Path. 3] {Initial/Pledge} I can successfully use MySQL Workbench, on my server, to Access the MySQL database. 4] {Initial/Pledge} The taskbar, on my server, includes the items shown below. 5] {Initial/Pledge} From a remote system, I can now store/retrieve data from the Share folder on my server. You will be asked to figure out how to use MySQL Workbench to create a database, create an account, and assign some privileges. You may watch videos for help. You may ask your team mates for help.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 2 1] {Initial/Pledge} I have used MySQL Workbench to create a standard user, called JohnDoe I make the Password = trinity 2] {Initial/Pledge} "Schema" is a synonym for "Database". I have used MySQL to create a Database, called Test1

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 3 3] {Initial/Pledge} I have used MySQL to configure user JohnDoe as an administrator on only Database test1 see the screen captures above. 4] {Initial/Pledge} "Schema" is a synonym for "Database". I have used MySQL to create a Database, called Library1

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 4 5] {Initial/Pledge} With the Command Prompt, I can use my JohnDoe account to login successfully. It appears that JohnDoe can also Use Test1 6] {Initial/Pledge} With the Command Prompt, I can use my JohnDoe account to login successfully. It appears that JohnDoe can not Use Library1 7] {Initial/Pledge} I have watched the video: https://www.youtube.com/watch?v=ypu6qv5byu4 this video will answer some of the SQL Question You may have to refer to your CSCI 2320 notes or use google to find the answers to some of the problems below. Run Query Native Passwords 1] {Initial/Pledge} I have created JohnDoe @ localhost & JohnDoe @ % ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'trinity' ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'trinity' ALTER USER 'JohnDoe'@'localhost' IDENTIFIED WITH mysql_native_password BY 'trinity' ALTER USER 'JohnDoe'@'%' IDENTIFIED WITH mysql_native_password BY 'trinity' 2] {Initial/Pledge} I have run the scripts above. The new MySQL has some issues with Native Passwords; these sometimes create issues with some of the support tools. Run the Queries above substitute your password.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 5 DB-Queries REVIEW FROM CSCI-2320 ANSWER ALL SQL QUESTIONS USING MySQL Don't Forget The Semicolons At The End Of Statements! Hand write these solutions ANSWER ALL SQL QUESTIONS USING MySQL Don't Forget The Semicolons At The End Of Statements! You may either hand write your solution or you may paste in solutions you have tested & print when done. Connection & Theory 1] Write the line of code to start MySQL, from the command line, in one of the cs labs. 2] SQL is an acronym for _?_. 3] How do you launch a windows command window. 4] DBMS is an acronym for _?_. SHOW x 1] Write the line of SQL code to display a list of all of the databases. 2] {T/F} All SQL Queries are case sensitive. CREATE DATABASE 1] Write the SQL command to create a database, called Trinity 2] Write the SQL command to create a database, called Library?? (replace the?? with your initials) DROP DATABASE x 1] Write the SQL Command to delete database LibraryTH. 2] Write the SQL Command to delete database Trinity.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 6 USE 1] Write the line of SQL code to make LibraryTH the current database. 2] Write the line of SQL code to make Trinity the current database. CREATE TABLE 1] Now that Trinity is your current database, write the block SQL code to create table Universities; it is to have an auto incrementing ID, a Name, a City, and a State. 2] Write the SQL code to create to create the Users table (shown in the MySQL Workbench table above).

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 7 DROP TABLE 1] Write the SQL Command to delete table Universities. 2] Write the SQL Command to delete table Faculty. DESCRIBE x SHOW FIELDS IN x 1] Write the block of SQL code to add the Evan Barnett record, above, to the Users table. 2] Write the block of SQL code to add the Laural Bean record, above, to the Users table. 3] Write the block of SQL code to add Trinity University to the Universities table.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 8 INSERT INTO 1] Write the block of SQL code to add the Evan Barnett record, above, to the Users table. 2] Write the block of SQL code to add the Laural Bean record, above, to the Users table. 3] Write the block of SQL code to add Trinity University to the Universities table. Import Library1.sql Using MySQL Workbench 1] Place Library1.sql on your desktop. 2] Push the Open SQL Script File Button.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 9 3] Go to the desktop and select file Library1.sql Push the Open Button. 4] You will notice that Library1 appears three times. When this database is restored, it will be called Library1 if you were to replace all three of these instances with MyLibrary, then the library restoration would create a database called MyLibrary 5] Press the Lightning Bolt to execute the script. This will create the database.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 10 6] All of the green check marks indicate success, but the database does not show up in the schema list until you refresh them. 7] Refresh the schema and Library1 appears. Library1 Database Use Library1 For The Remainder Of The Queries 1] Library1 contains _?_ tables. 2] The names of the tables in Library1 are _?_. 3] Table Users has _?_ Records.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 11 4] Table Users has _?_ Fields. 5] Table Books has _?_ Records. 6] Table Books has _?_ Fields. Table Library1.Users Table Library1.Books

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 12 SELECT * FROM 1] Write the line of SQL code to display all of the information about all of the Users. 2] Write the line of SQL code to display all of the information about all of the Books. SELECT COUNT(*) FROM 1] Write the line of SQL code to display the number of Users records. 2] Write the line of SQL code to display the number of University records. 3] Write the line of SQL code to display the number of Users records in which the Last name is not NULL. do not use WHERE in the query! SELECT * FROM WHERE ID? 1] Write the line of SQL code to display all of the information about all of the Users whose ID at least 20 2] Write the line of SQL code to display all of the information about all of the Users whose ID is 20 3] Write the line of SQL code to display all of the information about all of the Users whose ID is at least 20 and no more than 40 4] Write the line of SQL code to display all of the information about all of the Users whose ID is not 20 5] Write the line of SQL code to display all of the information about all of the Users whose ID is an even number. 6] Write the line of SQL code to display the number of Users records whose ID is an odd number.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 13 SELECT * FROM WHERE Last Like 1] Write the line of SQL code to display all of the information about all of the Users whose Last Name starts with an 'A' 2] Write the line of SQL code to display all of the information about all of the Users whose Last Name starts with an 'B' 3] Write the line of SQL code to display the number of Users records whose Last Name starts with a 'B' 4] Write the line of SQL code to display the number of Users records whose Last Name contains a 'B' SELECT x, y, z FROM 1] Write a query that displays the ID, First, Last, & FullName of all Users. 2] Write a query that displays the First, Last, & FullName, & ID of all Users. 3] Write a query that displays the ID, FullName, UserName, & Password of all Users Whose last name contains an 'A' SELECT * FROM ORDER BY

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 14 1] Write a query that displays all of the information in the Users table in order by FullName. 2] Write a query that displays the ID and FullName of all Users table in order by ID. 3] Write a query that displays the ID and FullName of all Users table in descending order by ID. 3] Write a query that displays the ID, First, & Last of all Users whose ID is in the range 10 20 order by FullName. DO NOT USE BETWEEN! 4] Write a query that displays the ID, First, & Last of all Users whose ID is in the range 10-20 order by FullName. USE BETWEEN! 5] Write a query that displays the ID, First, & Last of all Users whose ID in the range {2,4,6,8, } in order by First name

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 15 6] Write a query that displays the ID, First, & Last of all Users whose ID in the range {3,6,9,12., } in descending order by Last. 7] Write a query that displays the ID, First, & Last of all Users whose ID are multiples of 2 or 5 in descending order by ID SELECT * FROM LIMIT X 1] Execute the query below. Unfortunately, LIMIT is not supported in most databases, including MSSQL. SELECT First FROM Users LIMIT 3; 2] Execute the query below. Unfortunately, LIMIT is not supported in most databases, including MSSQL. SELECT First FROM Users WHERE ID >= 10 LIMIT 3,2; 3] The query below shows only the first user in the query view. Who is that person? SELECT First

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 16 FROM Users LIMIT 0,1; 4] The query below shows only the second user in the query view. Who is that person? SELECT First FROM Users LIMIT 1,1; 5] The query below shows only the third user in the query view. Who is that person? SELECT First FROM Users LIMIT 2,1; 6] Write a query that displays all of the information about the twenty-first user in the Users table. Query Output 1] Write SELECT 2 * 3 + 4 * 5 2] Write SELECT 2 * (3 + 4) * 5 3] Write SELECT pow(2,8) Concatenate

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 17 1] Write a query that will display the results of combining all of the First and Last names of all Users TomHicks 2] Write SELECT CONCAT (UserName, Password) FROM Users WHERE ID = 100 3] Write SELECT CONCAT ("One", "=", "Two") Left & Right 1] Write SELECT Left ("Trinity University", 4) 2] Write SELECT Right ("Trinity University", 4) Update 1] Write a query that replaces the first name, of the record whose ID is 6, with Dan. 2] Write a query that replaces the passwd of all of the Users with 'trinity'; 3] Write a query that replaces the UserNames of all of the Users with blank ('').

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 18 4] Write a query that replaces the UserNames of all of the Users with the first-last (dash between); 5] Write a query that replaces the FullName of all of the Users with the Last, First (comma blank between); UPPER UCASE 1] Write SELECT UCASE ("Trinity") 2] Write SELECT UPPER ("University") 3] Write a query that displays the first and last name of all Users using upper case letters. LOWER LCASE

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 19 1] Write SELECT LCASE ("Trinity") 2] Write SELECT UPPER ("University") 3] Write a query that displays the first and last name of all Users using lower case letters. 4] Write a query that replaces the EMail of all of the Users with blank (''). 5] Write a query that replaces the EMail of all of the Users with the UserName plus @trinity.edu (all lower case). The UserName may be no more than 8 characters in length. Video & Internet #1 MySQL Tutorial (41 Min) https://www.youtube.com/watch?v=ypu6qv5byu4 1] According to the video, a Primary Key U_?_ identifies a row or record. 2] According to the video, each P_?_ Key must be unique to the row. 3] According to the video, each Primary Key must be given a value when the row is C_?_ and that value can't be NULL. 4] According to the video, the original value of a Primary Key _?_ {can/cannot} be changed.

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 20 5] {T/F} According to the video, it is probably best to auto increment the Primary Key. 6] According to the video, every table should focus on describing just o_?_ thing. 7] According to the video, you don't want to include M_?_ values in one cell/field. https://dev.mysql.com/doc/refman/8.0/en/integer-types.html 8] What MySQL Numeric Type should be used when all of the values are in the range 127 to -128? 9] What MySQL Numeric Type should be used when all of the values are in the range 32,767 to -32,768? 10] What MySQL Numeric Type should be used when all of the values are in the range 8,388,607 to -8,388,608? 11] What MySQL Numeric Type should be used when all of the values are in the range 9,223,372,036,854,775,807 to - 9,223,372,036,854,775,808? 12] What MySQL String Type should be used for a fixed length character string? 13] What MySQL String Type should be used for a variable length character string? https://philihp.com/blog/2011/maximum-sizes-of-mysql-blob-fields/ 14] What MySQL String Type should be used for a container that can handle up to 65536 characters? Data might include executables, images, etc. 15] What MySQL String Type should be used for a container that can handle up to 16 Megabytes. Data might include executables, images, etc. 16] What MySQL String Type should be used for a container that can handle up to 4 Gigabytes. Data might include executables, images, etc. 17] What MySQL Date & Time Type should be used for date in the format YYYY-MM-DD 18] What MySQL Date & Time Type should be used for date in the format HH:MM:SS 19] What MySQL Date & Time Type should be used for date in the format YYYYMMDDHHMMSS 20] What MySQL Date & Time Type should be used for date in the format YYYY

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials P a g e 21 21] According to the video, a F_?_ Key is used to make references to the Primary Key of another table. 22] According to the video, a foreign key can have a different N_?_ from the primary key name. Hint: Suppose we have table/class Users (whose primary key is ID) and table/class UserType (whose primary key is ID) Within table Users, I would call our Foreign Key UserTypeID. 23] According to the video, the value of a Primary Key cannot be NULL and the value of a Foreign Key _?_ {can/cannot} be NULL. 24] According to the video, the value of a Foreign Key _?_ {does/does not} have to be unique. 1] All pages of this lab with questions completed. What To Turn In - - - - - - - - - - - No Lab Is Complete Until Both Are Complete - - - - - - - - - - - 1] You sign & submit the Pledge form at the top of this lab!. No Lab Will Be Considered Complete until this is done. Late penalties will continue to accrue until the pledge form is submitted. a) Sign & Pledge b) Record the amount of time you think you spent on this lab c) Staple all pages of this lab. Fold in half length-wise (like a hot-dog). Put your name on the outside. Place it on the professor desk before the beginning of lecture on the day it is due. The penalty for late homework will not exceed 25% off per day. d) Short answer questions must be hand written, unless the professor has granted an exception for physical reasons. 2] Place all programming code associated with this program, if any, in the Professor s Code Drop Box or on the Virtual System as directed. I do not accept programs by mail; do not submit labs via email!