You are on page 1of 5

Laboratory #2: More MySQL Queries

Objectives:

 To create Queries using Other Queries.


 Learn the basic queries in creating database and tables.

Instructions:

 Follow the instructions below.


 Provide a screenshot for each Query.
 Each Queries = 5 pts
 Name the docx file to: surname1_surname2-Lab1.docx (Example: cerezo_divinagracia-
lab1.docx)

Create the following Queries

1. Create a Database named laboratory2.

2. Create a Table named students with the following specifications:


 studentID int(11)
 lastName varchar(255)
 firstName varchar(255)
 course varchar(255)
3. Insert the following Values

4. Using WILDCARDS, Select all values with number 12 from any position in studentID.
5. Using ALTER TABLE, add the following fields:
 Subject1 float(11,2)
 Subject2 float(11,2)
 Subject3 float(11,2)

#DCIT50 (Subject1), DCIT24A (Subject2), COSC60A (Subject3).


6. Using Update, Add values in Subject1, Subject2, and Subject3 (between 70.00 to
100.00). It must be different values.

7. Using ALIAS get the Average score of each student.;


8. Using BETWEEN Operator get values from subject1 whose score is between 85 and 100.

P.S; In the moment that we answering #8, We’ve realized that there is a question for getting values
BETWEEN 85 & 100, we were unable to lower the grade given to the students in order to lessen the
expected output. *we apologize*

9. Using WILDCARD, Select all lastName that ends with Vowel.

10. Using WILDCARD, Select all firstName that starts with Consonant.

You might also like