the exam will start tomorrow at 3 pm end at 4pm (California time zone )

Programming

California State University - East Bay

Question Description

this is a Database Management system class, the exam will include 15-20 multiple choice questions.

Unformatted Attachment Preview

Midterm Exam Sample Questions PART 1 NOTE: Use the following tables to answer questions. These tables may or may not be normalized. The following tables are for keeping data about a company's employees, departments, projects, and project assignments. Each employee works in one department. An employee can work on multiple projects and a project usually has many employees working on it. Each project has a manager who is one of the employees. Also, each department has a manager who is one of the employees. Each employee has a supervisor, who is another employee. Supervisor-ID column in the EMPLOYEE table contains employee-id of the employee who is supervising other employees. EMPLOYEE (Employee-ID, Employee-Full-Name, Project#, Supervisor-ID) PROJECT (Project#, Project-Name, Manager-ID, Manager-Name) DEPARTMENT (Dept-ID, Dept-Name) PROJECT-ASSIGNMENTS (Project#, Employee-ID, Employee-Full-Name, Hours-Worked) 1. Which of the following tables has a composite attribute? (a) EMPLOYEE (b) PROJECT (c) PROJECT-ASSIGNMENT (d) all of the above 2. Which of the following is a weak entity? (a) EMPLOYEE (b) PROJECT (c) PROJECT-ASSIGNMENT (d) none of the above 3. Which of the following is a multi-valued attribute in EMPLOYEE table? (a) Employee name (b) Supervisor-ID (c) none of the above 4. Which of the following is a FK column in PROJECT-ASSIGNMENTS table? (a) Project# (b) Employee-ID (c) both a and b above (d) neither is a FK column 5. Which of the following tables has a composite primary key? (a) EMPLOYEE (b) DEPARTMENT (c) PROJECT (d) PROJECT-ASSIGNMENT (e) none of the above 6. Do the EMPLOYEE and PROJECT tables satisfy referential integrity constraint? (a) Yes (b) No (c) information available is not sufficient to answer this question 7. The relationship between EMPLOYEE and DEPARTMENT tables is strong: (a) true (b) false 8. Which of the following functional dependence is valid? (a) Employee-ID --> Employee-Full-Name (c) Employee-ID --> Project# (b) Project# --> Employee-ID (d) none of the above 9. What normal form is EMPLOYEE table in? (a) 0NF (b) 1NF (c) 2NF (d) 3NF 10. What normal form is PROJECT table in? (a) 0NF (b) 1NF (c) 2NF (d) 3NF 11. What normal form is DEPARTMENT table in? (a) 0NF (b) 1NF (c) 2NF (d) 3NF 12. What normal form is PROJECT-ASSIGNMENTS table in? (a) 0NF (b) 1NF (c) 2NF (d) 3NF 13. What is the primary key of the PROJECT-ASSIGNMENTS table? (a) Project# (b) Employee-ID (c) Employee-Full-Name (d) none PART 2 (SQL) Please use the following database schema for these questions. Assume all PK and FK columns have INTEGER data type and data types of all other columns are as expected. CUSTOMER (CustomerID, FirstName, LastName, AmountDue, City, State) PRODUCT (ProductCode, Description, Price, SupplierID) SUPPLIER (SupplierID, Supplier-Name, City, State) INVOICE (Invoice#, Invoice-Date, Invoice-Amount, CustomerID) QUESTION #1: For each state, you want to display name of the state and number of customers that the company has in the state. Review this statement and determine if it contains a syntax error, and if so on which line. 1. SELECT state, COUNT(*) 2. FROM CUSTOMER 3. GROUP BY state; The above statement has: (a) no error (b) error on line 1 (c) error on line 2 (d) error on line 3 QUESTION #2: Does the following statement contain any syntax error? SELECT COUNT(*) FROM CUSTOMER GROUP BY state; The above statement: (a) it has no error (b) it has a syntax error QUESTION #3: You write the following statement to know how many total suppliers the company has. Is this the right statement for this purpose? SELECT COUNT(*) FROM supplier; (a) Yes (b) No QUESTION #4: You write the following statement to know how many total suppliers the company has. Is this the right statement for this purpose? SELECT COUNT(supplierID) FROM product; (a) Yes (b) No QUESTION #5: Does the following statement contain any syntax error? select ProductCode from product where ProductCode = 21225 or supplierID is null; The above statement: (a) has no error (b) has a syntax error QUESTION #6: Suppose you want to remove all of the records in the PRODUCT table but keep the empty table. Which of the following SQL statements is good for this purpose? (a) (b) (c) (d) DELETE FROM product; DROP product; DROP table product; UPDATE product; QUESTION #7: Suppose you want to reduce the price of all products by 7%. Which of the following SQL statements is good for this purpose? (a) (b) (c) (d) UPDATE product SET price = 93%; UPDATE price = price*.93; UPDATE price to price*.93; none of the above UPDATE product SET price = price*.93; QUESTION #8: Suppose you want to remove the PRODUCT table from the database. Which of the following SQL statements is good for this purpose? (a) (b) (c) (d) DELETE table product; DROP product; DROP table product; REMOVE table product; ...
Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!