Docsity

CSCI 2910 Database Quiz - Spring 2007 - Prof. David L. Tarnoff, Quizzes of Computer Science

Toggle sidebar
bg1
CSCI 2910 Database Part 2 Quiz โ€“ Spring 2007 Name: ________________________________
For problems 1, 2, and 3 use the partial MySQL statement shown below:
SELECT * FROM employee WHERE LAST_NAME _________________
1. What needs to be put in the blank in order to get the select statement to return a list of employees
from the employee table with a LAST_NAME starting with 'T'?
2. What needs to be put in the blank in order to get the select statement to return a list of employees
from the employee table with a LAST_NAME where the 2nd and 3rd letters are 'a' and 'w'
respectively?
3. What needs to be put in the blank in order to get the select statement to return a list of employees
from the employee table with a LAST_NAME exactly equal to "Smith"?
4. Describe the problem with performing a select query across multiple tables without using a where
clause.
For problems 5, 6, and 7, use the database table shown to the
right. Assume that the table's name is "exam_scores".
5. In the space below, write the output from the MySQL statement
select STUDENT_NAME from exam_scores where SCORE > 80;
6. What would the output be from the MySQL statement
select STUDENT_NAME, SCORE+5 from exam_scores;
7. What would the output be from the MySQL statement select * from exam_scores limit 2;
STUDENT_NAME SCORE
John Johnson 78
Kenneth Kennedy 92
David Davis 88

Partial preview of the text

Download CSCI 2910 Database Quiz - Spring 2007 - Prof. David L. Tarnoff and more Quizzes Computer Science in PDF only on Docsity!

CSCI 2910 Database Part 2 Quiz โ€“ Spring 2007 Name: ________________________________

For problems 1, 2, and 3 use the partial MySQL statement shown below:

_SELECT * FROM employee WHERE LAST_NAME __________________

  1. What needs to be put in the blank in order to get the select statement to return a list of employees from the employee table with a LAST_NAME starting with 'T'?
  2. What needs to be put in the blank in order to get the select statement to return a list of employees from the employee table with a LAST_NAME where the 2nd and 3rd letters are 'a' and 'w' respectively?
  3. What needs to be put in the blank in order to get the select statement to return a list of employees from the employee table with a LAST_NAME exactly equal to "Smith"?
  4. Describe the problem with performing a select query across multiple tables without using a where clause.

For problems 5, 6, and 7, use the database table shown to the right. Assume that the table's name is "exam_scores".

5. In the space below, write the output from the MySQL statement select STUDENT_NAME from exam_scores where SCORE > 80; 6. What would the output be from the MySQL statement select STUDENT_NAME, SCORE+5 from exam_scores;

  1. What would the output be from the MySQL statement select * from exam_scores limit 2;

STUDENT_NAME SCORE

John Johnson 78 Kenneth Kennedy 92 David Davis 88