KINGDOM OF SAUDI ARABIA-JAZAN UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS 221 INFS 3 DATABASE SYSTEMS-1 REVIEW QUESTIONS Chapter 1: Databases and Database Users 1. Define the following terms: data, database, DBMS, database system, database catalog, program-data independence, user view, DBA, end user, canned transaction, deductive database system, persistent object, meta-data, and transaction-processing application. 2. What are the responsibilities of the DBA and the database designers? 3. List down the advantages of using DBMS approach. 4. Discuss the differences between database systems and information retrieval systems. 5. What do you understand by database management systems (DBMS)? 1. What four main types of actions involve databases? Briefly discuss each. 2. What are the different types of database end users? Discuss the main activities of each. 3. Discuss the main characteristics of the database approach and how it differs from traditional file systems. 4. Briefly explain the advantages of using DBMS approach. 5. Draw a simplified diagram of a database system environment. Chapter 2: Database System Concepts and Architecture 1. Define the following terms: data model, database schema, database state, internal schema, conceptual schema, external schema, data independence, DDL, DML, SDL, VDL, query language, host language, data sublanguage, database utility. 2. List down the main categories of data models. 3. What is the difference between a database schema and a database state? 4. What is the difference between logical data independence and physical data independence? 5. Draw the diagram of three-schema architecture. 6. What is the difference between procedural and nonprocedural DMLs? Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 1 of 9
7. List down the different types of user-friendly interfaces. 8. With what other computer system software does a DBMS interact? 1. Discuss the main categories of data models. 2. Describe the three-schema architecture with the help of its diagram. 3. Discuss the different types of user-friendly interfaces and the types of users who typically use each. 4. Discuss some types of database utilities and tools and their functions. Chapter 3: Data Modeling Using the Entity-Relationship (ER) Model 1. Discuss the role of a high-level data model in the database design process. 2. What do you understand by Entity-Relationship model? 3. List the various cases where use of a NULL value would be appropriate. 4. Define the following terms: entity, attribute, attribute value, relationship instance, composite attribute, multivalued attribute, derived attribute, complex attribute, key attribute, and value set (domain). 5. Explain the difference between an attribute and a value set. 6. What is meant by a recursive relationship type? Give some examples of recursive relationship types. 7. Define the terms owner entity type, weak entity type, identifying relationship type, and partial key. 8. Construct a preliminary design of Department, Employee, Product, Car, Student, Teacher, Mobile, Class, book etc with all its possible attributes. 9. For the following binary relationships, suggest cardinality ratios based on the common- sense meaning of the entity types. Entity 1 Cardinality Ratio Entity 2 1. STUDENT SOCIAL_SECURITY_CARD 2. STUDENT TEACHER 3. CLASSROOM WALL 4. COURSE TEXTBOOK 1. What is an entity type? What is an entity set? Explain the differences among an entity, an entity type, and an entity set. 2. What is a relationship type? Explain the differences among a relationship instance, a relationship type, and a relationship set. 3. Discuss the conventions for displaying an ER schema as an ER diagram. 4. Draw a simplified diagram to illustrate the main phases of database design. Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 2 of 9
5. Draw an ER diagram of UNIVERSITY database, that captures all the given below requirements. Specify key attribute(s) of each entity set. For each relationship set, specify structural constraints and participation constraints. a. For each STUDENT, the university maintains student Name, student ID, SSN (Social Security Number), Address, Phone, Birthdate, Gender, Level, Major (CS, IS, CNET). Both Social Security Number and Student Number have unique values for each student. b. Each DEPARTMENT is described by a Name, Department code, Department Phone, and Office address. Both Name and Code have unique values for each department. c. Each COURSE has a Course Name, Description, Course Code, Credit Hours, Level, and Offering Department. The value of Course Code is unique for each course. d. Each SECTION is associated with an Instructor, Semester, Year, Course, and Section Number. The Section Number distinguishes sections of the same course that are taught during the same semester. 6. Draw an ER diagram of COMPANY database, that captures all the given below requirements. Specify key attribute(s) of each entity set. For each relationship set, specify structural constraints and participation constraints. a. For each DEPARTMENT, the company maintains Name, department Number, Manager, Location. Both Name and department Number have unique values for each student. b. Each PROJECT is described by a Name, Number, Location, and Controlling Department. Both Name and Number have unique values for each department. c. Each EMPLOYEE has a SSN, Name, Sex, Department, Address, and Salary. The value of SSN is unique for each employee, whereas Name, a composite attribute has Fname, Minit and Lname as a subpart of it. 7. Draw an ER diagram of ONLINE COURSE REGISRATION database, that captures all the given below requirements. Specify key attribute(s) of each entity set. For each relationship set, specify structural constraints and participation constraints. a. For each USER, the portal maintains user ID, Name, E-mail. Each user has a unique ID. Name is a composite attributes with Fname, Midname, Lname. b. Each COURSE is described by a course Code, Description, Category, and Term. Both Code and Term have unique values for each course. c. Each LECTUR has a lecturer Title ID, Duration, and Date. The value of ID is unique for each lecturer. Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 3 of 9
Chapter 4: The Relational Data Model and Relational Database Constraints 1. Define the following terms as they apply to the relational model of data: domain, attribute, n-tuple, relation schema, relation state, degree of a relation, relational database schema, and relational database state. 2. Why are duplicate tuples not allowed in a relation? 3. What is the difference between a key and a superkey? 4. Define key, Super key, Candidate key, Primary key, and foreign key. 5. Identify the Super key, Candidate key, Primary key, Foreign Key in the below relation. T_ID Name Department Course_Code# T001 Ali IS 221 T002 Hussain CS 452 T003 Rashid CET 443 T004 Khalid CS 443 6. What is a transaction? How does it differ from an Update operation? 7. Identify the Super key and Candidate key in the given relation. Book_ID Name Author B1 XYZ ALI B2 ABC ALI B3 XYZ HAMZA B4 PQR RASHID B5 RSP ALI B6 ABC RASHID 1. Compare three differences between primary key and foreign key. 2. Discuss the entity integrity and referential integrity constraints. 3. Consider the following relations for a database that keeps track of automobile sales in a car dealership (OPTION refers to some optional equipment installed on an automobile): CAR(SerialNo, Model, Manufacturer, Price) OPTION(SerialNo, OptionName, Price) SALE(SalespersoId, SerialNo, Date, Sale_price) SALESPERSON(SalespersonId, Name, Phone) Specify the foreign keys for this schema, stating any assumptions you make. Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 4 of 9
4. A Company relations database schema is given. Display the referential integrity constrains by specifying the foreign keys for this schema. 5. Consider the following relations database schema for a STUDENT that keeps track of student atteding the course. Specify the foreign keys for this schema, stating any assumptions you make. 6. Consider the following relations for a database that keeps track of student enrollment in courses and the books adopted for each course: STUDENT (SSN, Name, Major, Bdate) COURSE (Course#, Cname, Dept) ENROLL (SSN, Course#, Quarter, Grade) BOOK_ADOPTION(Course#, Quarter, Book_ISBN) TEXT(Book_ISBN, Book_Title, Publisher, Author) Draw a relational schema diagram specifying the foreign keys for this schema. 7. Consider the following relations for a database that keeps track of business trips of salespersons in a sales office: SALESPERSON(Ssn, Name, Start_year, Dept_no) TRIP(Ssn, From_city, To_city, Departure_date, Return_date, Trip_id) EXPENSE(Trip_id, Account#, Amount) A trip can be charged to one or more accounts. Specify the foreign keys for this schema, stating any assumptions you make. Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 5 of 9
Chapter 5: The Relational Algebra 1. List the operations of relational algebra and the purpose of each. 2. Explain urinary relation operation: SELECT and PROJECT with example. 3. How are the OUTER JOIN operations different from the INNER JOIN operations? 4. How is the OUTER UNION operation different from UNION? 5. EMPLOYEE a. Retrieve the records form EMPLOYEE whose department is 4. b. Select the tuples where salary > 40000. c. Retrieve the records of all employee who are Male and work for department number 5. 6. Use above relation EMPLOYEE and write the relational algebra query. a. List each employee s First name, Last name and salary. b. List First name, Last name and salary of all employees who work in department number 5. 7. Convert the given below relational algebra operation into relational query. a. Dno=4 (EMPLOYEE) b. Salary > 30,000 (EMPLOYEE) c. (Dno=4 AND Salary > 30,000) (EMPLOYEE) 8. Convert the given below relational algebra operation into relational query. a. Ssn,Fname,Bdate( Salary>39000(EMPLOYEE)) b. Fname, Lname, Salary( Dno=5(EMPLOYEE)) 1. Explain Relational Algebra Operations: UNION, INTERSECTION, DIFFERENCE (or MINUS, ) and CARTESIAN PRODUCT ( x ) with example. 2. What is union compatibility? Why do the UNION, INTERSECTION, and DIFFERENCE operations require that the relations on which they are applied be union compatible? 3. Consider the following GRADEBOOK relational schema describing the data for a grade book of a particular instructor. (Note: The attributes A, B, C, and D of COURSES store grade cutoffs.) CATALOG(Cno, Ctitle) STUDENTS(Sid, Fname, Lname, Minit) COURSES(Term, Sec_no, Cno, A, B, C, D) ENROLLS(Sid, Term, Sec_no) Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 6 of 9
i. Retrieve the names of students enrolled in the Automata class during the fall 2009 term. ii. Retrieve the Sid values of students who have enrolled in CSc226 and CSc227. 4. Retrieve the name and address of all employees who work for the Research department. 5. List the names of all employees in department 5 who work more than 10 hours per week on the Product X project. (Use above relation schema) 6. Employee a. Retrieve the first name, last name, and salary of all employees who work in department number 5 using RENAME operator. b. Retrieve the Social Security numbers of all employees who either work in department 5 or directly supervise an employee who works in department 5. (Use RENAME) c. Retrieve a list of names of each female employee s dependents using CARTESIAN PRODUCT. 2. Apply the set theoretic operation MINUS on the given tables and draw the result. a) STUDENT INSTRUCTURE b) INSTRUCTURE STUDENT STUDENT Fn Ln Susan Yao Ramesh Shah Johnny Kohler Barbara Jones Amy Ford Jimmy Wang Ernest Gilbert INSTRUCTURE Fname Lname John Smith Ricardo Browne Susan Yao Francis Johnson Ramesh Shah Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 7 of 9
3. Apply the set theoretic operation UNION, INTERSECTION on the given tables and draw the result. a) STUDENT U INSTRUCTURE b) STUDENT Ո INSTRUCTURE STUDENT Fn Ln Susan Yao Ramesh Shah Johnny Kohler Barbara Jones Amy Ford Jimmy Wang Ernest Gilbert INSTRUCTURE Fname Lname John Smith Ricardo Browne Susan Yao Francis Johnson Ramesh Shah Chapter 5: Functional Dependencies and Normalization for Relational Databases 1. Discuss insertion, deletion, and modification anomalies. Why are they considered bad? Illustrate with examples. 2. Define functional dependency with example. 3. Write down the informal design guideline for relation schema. 4. Why do we have NULL values in the relation? What are the demerits of it? 5. What undesirable dependencies are avoided when a relation is in 2NF? 6. What undesirable dependencies are avoided when a relation is in 3NF? 7. What is multivalued dependency? When does it arise? 1. Describe in detail the 1NF,2NF and also 3NF. 2. Discuss the guideline for 1NF, 2NF and 3NF. 3. Write the summary of normal form based on primary keys and corresponding normalization. 4. Discuss bottom-up and top-down design methodology. 5. Define first, second, and third normal forms when only primary keys are considered. How do the general definitions of 2NF and 3NF, which consider all keys of a relation, differ from those that consider only primary keys? Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 8 of 9
6. Decompose the given relation LOTS up to 3NF with its functional dependencies FD1, FD2, FD3 and FD4. Also draw its progressive summary tree. LOTS Candidate Key Property_Id# Country_name Lot# Area Price Tax_rate FD1 FD2 FD3 FD4 7. Consider the relation EMP_PROJ is in 1NF. Decompose the given relation into 2NF and 3NF with its functional dependencies FD1, FD2, and FD3. Text book: Elmasri. R., Navath, S. "Fundamentals of Database Systems, Pearson International Edition, 6th Edition, 2015 P- 9 of 9