chapter 1 homework - key -...

27
Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials ______ Page | 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.

Upload: dodung

Post on 14-Dec-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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 Lab35 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-2Sign 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.

Page 2: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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

Page 3: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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

Page 4: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

Page 5: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

Page 6: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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).

Page 7: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

Page 8: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

Page 9: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

Page 10: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

Page 11: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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

Page 12: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

Page 13: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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

Page 14: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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

Page 15: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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 UsersLIMIT 3;

2] ___________________________________________________________________________________ Execute the query below. Unfortunately, LIMIT is not supported in most databases, including MSSQL.SELECT First FROM UsersWHERE ID >= 10LIMIT 3,2;

3] ___________________________________________________________________________________ The query below shows only the first user in the query view. Who is that person?SELECT First

Page 16: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials ______ P a g e | 16

FROM UsersLIMIT 0,1;

4] ___________________________________________________________________________________ The query below shows only the second user in the query view. Who is that person?SELECT First FROM UsersLIMIT 1,1;

5] ___________________________________________________________________________________ The query below shows only the third user in the query view. Who is that person?SELECT First FROM UsersLIMIT 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 the results from executing the query below:SELECT 2 * 3 + 4 * 5

2] ___________________________________________________________________________________ Write the results from executing the query below:SELECT 2 * (3 + 4) * 5

3] ___________________________________________________________________________________ Write the results from executing the query below:SELECT pow(2,8)

Concatenate

Page 17: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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 the results from executing the query below:SELECT CONCAT (UserName, Password) FROM UsersWHERE ID = 100

3] ___________________________________________________________________________________ Write the results from executing the query below:SELECT CONCAT ("One", "=", "Two")

Left & Right

1] ___________________________________________________________________________________ Write the results from executing the query below:SELECT Left ("Trinity University", 4)

2] ___________________________________________________________________________________ Write the results from executing the query below: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 ('').

Page 18: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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 the results from executing the query below:SELECT UCASE ("Trinity")

2] ___________________________________________________________________________________ Write the results from executing the query below:SELECT UPPER ("University")

3] Write a query that displays the first and last name of all Users using upper case letters.

LOWER LCASE

Page 19: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

Server-Configuration-2-MySQL-1-HW.docx CSCI 2320 Initials ______ P a g e | 19

1] ___________________________________________________________________________________ Write the results from executing the query below:SELECT LCASE ("Trinity")

2] ___________________________________________________________________________________ Write the results from executing the query below: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.

Page 20: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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

Page 21: Chapter 1 Homework - Key - carme.cs.trinity.educarme.cs.trinity.edu/thicks/.../Server-Configuration-2-MySQL-1-HW.docx  · Web viewServer-Configuration-2-MySQL-1-HW.docx CSCI 2320

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.

What To Turn In

1] All pages of this lab with questions completed.

- - - - - - - - - - - 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 & Pledgeb) Record the amount of time you think you spent on this labc) 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!