CS 345 Quiz 7
What is the result of the following SQL statement? UPDATE employee SET salary = 50000 WHERE salary < 50000;
The statement increases salary to 50,000 for each employee whose salary is below 50,000
(true or false) The following is an invalid SQL statement. SELECT *, FROM employee;
true
Which of the following queries on table STUDENT will return three values as a result? a.) SELECT name FROM student WHERE class != 'Sophomore'; b.) SELECT name FROM student; c.) SELECT DISTINCT name FROM student; d.) SELECT class FROM student;
c
Which of the following queries on table STUDENT will return number 2 as a result? a.) SELECT COUNT(*) FROM student; b.) SELECT COUNT(name) FROM student; c.) SELECT COUNT(class) FROM student; d.) SELECT COUNT(DISTINCT class) FROM student;
d
How many records will the following query on table STUDENT return? SELECT * FROM student WHERE name LIKE '%or%';
4
What will be the result of the following query on table STUDENT? SELECT COUNT( *) FROM student GROUP BY class HAVING COUNT(*) <3;
2
Which of the following statements would be used to drop a column from the table? CREATE TABLE ALTER TABLE DROP TABLE UPDATE
ALTER TABLE
Which of the following is a part of a DDL statement? CREATE INSERT DELETE SELECT
CREATE
What is the result of the following SQL query? SELECT ename, esalary * 1.1 FROM employee;
For each employee, the query will display the name and the salary increased by 10%
What will be the result of the following query on table STUDENT? SELECT COUNT( *) FROM student GROUP BY class;
Numbers 2 and 3
Which of the following is a part of a DML statement? CREATE ALTER DROP SELECT
SELECT
Which of the following is an invalid SQL keyword? Select SE_LECT selectT SeLeCt
SE_LECT
What will be the result of the following query on table STUDENT? SELECT * from STUDENT;
The entire relation STUDENT will be displayed
What is the result of the following SQL query? SELECT ename FROM employee WHERE esalary = (SELECT MAX(salary) FROM employee);
The query displays the name of the employee (or employees) with the highest salary
Which of the following statements would be used to change a value in a record of a table? CREATE TABLE ALTER TABLE INSERT INTO UPDATE
UPDATE