12
1 1. GENERAL INFORMATION Academic Year: 2016 Semester(s):II Title Code Duration (hrs) Database Management Systems 13MCA25 Lectures 48 Hrs Seminars 4 Hrs Total: 52 Hrs 2. PRE REQUIREMENT STATEMENT General knowledge of programming and database concept. 3. COURSE RELEVANCE Database management systems are now indispensable tool for managing information, and a course on the principles and practice of database systems is now an integral part of computer science. This course covers the fundamentals of modern database management systems, in particular relational database systems. 4. LEARNING OUTCOMES Overview of database concepts, E-R model, Relational model, To create databases and tables. To Insert the records, update, delete and modify records. Querying the data, Normalization concepts etc.. 5. FACULTY DETAILS PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city) Bangalore 560 100 Department of MCA COURSE INFORMATION SHEET

PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

Embed Size (px)

Citation preview

Page 1: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

1

1. GENERAL INFORMATION Academic Year: 2016 Semester(s):II

Title Code Duration (hrs)

Database Management

Systems

13MCA25

Lectures 48 Hrs

Seminars 4 Hrs

Total: 52 Hrs

2. PRE REQUIREMENT STATEMENT

General knowledge of programming and database concept.

3. COURSE RELEVANCE Database management systems are now indispensable tool for managing information, and a

course on the principles and practice of database systems is now an integral part of computer

science. This course covers the fundamentals of modern database management systems, in

particular relational database systems.

4. LEARNING OUTCOMES

Overview of database concepts, E-R model, Relational model, To create databases and tables. To

Insert the records, update, delete and modify records. Querying the data, Normalization concepts etc..

5. FACULTY DETAILS

PESIT- Bangalore South Campus Hosur Road (1km Before Electronic city)

Bangalore – 560 100

Department of MCA

COURSE INFORMATION SHEET

Page 2: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

2

Details

Name Manjula.C.M.Prasad

Department MCA

Room Number 508

Phone No. 080-66186629

E-mail address [email protected]

Contact Hours Office Hours

6. VENUE AND HOURS/WEEK All lectures will normally be held in Room 603 , VI Floor.

Lecture Hours/week: 4Hrs

7.Module Map

Class

#

Chapter

Title/Referenc

e Literature

Topics to be covered

% of portions covered

Reference Chapter

Cumilative

1

Chapter- 1

Introduction

T1: Page#:3-

52

Introduction; An example

13

13

2 Characteristics of Database approach

3 Actors on the screen; Workers behind the

scene

4

Advantages of using DBMS approach; A

brief history of database applications; when

not to use a DBMS

5 Data models, schemas and instances; Three-

schema architecture and data independence

6 Database languages and interfaces; The

database system environment

7

Centralized and client-server architectures;

Classification of Database Management

systems

8

Chapter-

4 SQL

T1 Page#:243-330

SQL Data Definition and Data Types

9 Specifying basic constraints in SQL

10 Schema change statements in SQL

11 More complex SQL Queries

12 More complex SQL Queries

13 Insert, Delete and Update statements in

SQL

Page 3: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

3

14 Specifying constraints as Assertion and

Trigger

23

36

15 Views (virtual tables) in SQL

16 Additional features of SQL

17 Database programming issues and

techniques

18 Embedded SQL, Dynamic SQL

19

Chapter-

2

Entity Relationshi

p Model T1:Page#:57-90

Using High-Level Conceptual Data Models for Database Design, An Example Of database

Application

13

49

20 Entity types, Entity sets, Attributes and Keys

21 Relationships types, Relationship sets, Roles

and Structural Constraints

22 Weak Entity Types, Refining the ER Design

23 ER Diagrams

24 ER Diagrams

25 Naming Conventions and Design Issues;

Relationship types of degree higher than two

26

Chapter-3

Relational

Model and

Relational

Algebra

T1:Page#:145-

200

225-233

Relational Model Concepts

23

62

27 Relational Model Constraints and

Relational Database Schemas;

28 Update Operations, Transactions and

dealing with constraint violations;

30 Update Operations, Transactions and dealing with constraint violations;

31 Unary Relational Operations: SELECT

and PROJECT

32 Unary Relational Operations: SELECT and PROJECT

33 Relational Algebra Operations from Set Theory

34 Relational Algebra Operations from Set Theory

35 Binary Relational Operations: JOIN

36 DIVISION; Additional Relational Operations

37 Examples of Queries in Relational Algebra

38 Examples of Queries in Relational Algebra

39

Chapter-5

Database

Design

T1:Page#:337-40

Informal Design Guidelines for Relation

Schemas

15

77

40 Functional Dependencies

41 Functional Dependencies

42 Normal Forms Based on Primary Keys

43 Normal Forms Based on Primary Keys

44 General Definition of 2nd & 3rd Normal forms 9

45 General Definition of 2nd & 3rd Normal forms

46 Boyce-Codd Normal Form

47

Introduction, Language fundamentals

Page 4: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

4

48

Chapter-6

PL/SQL

Conditional and sequential control

11

100

49 Iterative processing and loops

50 Exception handlers, triggers

51 Functions and Procedures

52 Creating and planning PL/SQL

Page 5: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

5

8.LITERATURE:

Book

Type

Code

Title & Author Publication Info

Edition Publisher Year

Text Book

T1 Fundamentals of Database

Systems- Elmasri and Navathe 5th Pearson

Education

2007

T2

Database Management Systems-

Raghu Ramakrishna & Johannes

Gehrke

3rd

Tata McGraw-Hill

2003

Reference

Book

R1 Database System Concepts-Henry F

Korth, Silberscatz & Sudharshan

6th Tata

McGraw-Hill

2010

R2

A Introduction to Database systems

– C.J.Date, A Kannan, S.

Swamynatham

8th

Pearson

Education

2006

9. ASSIGNMENT(S)

Assignment 1 : SQL queries

Assignment 2 : E-R diagram and Relational Algebra queries

Assignment 3 : Mini project.

10. ASSESSMENT

A. WRITTEN EXAMINATION

Paper Structure

No. Of Questions

8 Main Questions No. of questions to be answered 5

Exams date June 2016 (Tentative)

Paper Duration 3 Hrs

Total Marks 100 Pass Marks 40

B. CONTINUOUS ASSESSMENT

Weighting (%)

Assignment(s): 10 Marks (20%)

Seminar(s): 10 Marks (20%)

Test(s): 30 Marks (60%)

Total Marks: 50 Marks

Question Bank

Page 6: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

6

Chapter 1: Introduction

Objective: This chapter introduces databases, their typical users, and DBMS concepts,

terminology and architecture. 1. Define the following terms:

2. a) Database b) DBMS c) Program-Data independent d) DBA e) End

User f) Data Base Schema g) Data Abstraction h) DDL i) external Schema j) conceptual Schema k) DML

3. What is DBMS? Explain database system with a schematic diagram. 4. What is DBMS? Compare DBMS with file processing system.

5. Explain the basic concepts of DBMS and in what way it is advantageous over

conventional file processing.

6. Describe the approach used for handling data in early based system. Discuss the disadvantages of this approach.

7. What is data independence? Explain the different levels of data independence.

8. What is a Data model? Explain different data models. 9. Explain the 3 levels of data abstraction.

10. Discuss the main characteristics of database approach. 11. With a neat figure of a data base system, explain the different important parts.

12. What are the responsibilities of DBA and the database designer? 13. What are the different types of data base end users? 14. Discuss some type of database utilities and their functions.

15. What is the difference between logical data independence and physical data

independence? Which is easier to accomplish? Why? 16. Explain client-server architecture for DBMS.

17. Describe the classification of database management system. 18. Explain centralized architecture for DBMS.

19. Describe database system utilities.

Chapter 2: Entity-Relational Model

Objective: In this chapter, the concepts of the Entity-Relationship (ER) model

and ER diagram are presented and used to illustrate conceptual database design. Discuss the high level database design process.

20. Define the following term:

a) Entity b) Attribute c) Key Attribute d) Attribute Value e) Stored

attributes f) Derived attribute g) Super Key h) Candidate Key i) Partial Key j) Foreign key k) Primary key l) Weak entity m) Cardinality ratio

n) Participation constraint o) Generalization p) Composite key q) Recursive relationship

21. Explain the difference between attribute and value set.

22. What is entity type, entity set? Explain the difference between entity, entity type and entity set.

23. Explain the mapping cardinalities and Existence dependencies in the Entity-

Relationship design.

24. Construct an E-R diagram for a car insurance company with a set of customers,

where each customer owns number of cars. Associated with each car there are number of recorded accidents. For the above E-R diagram develop a relational

model.

25. Write the E-R diagram for the automation of various activities of MCA department

of your college. The requirement is to maintain the Teachers, Student information,

attendance and class marks etc. Design database tasks. 26. Draw an E-R diagram to model the following description:

A company operates many departments. Each department has one or more employees and each employee works for one department. A manager controls each

Page 7: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

7

department. Many projects are carried out in a department with a team of

employees assigned to it. It is required to maintain information about the departments of every employee.

27. Explain strong and weak entity sets with an example. 28. Explain the different types of attributes which occur in ER model.

29. An instructor teaches number of courses. The course uses many text books. Draw

an ER diagram to represent this. Reduce the ER diagrams into set of relations. 30. What is relationship type? Explain the difference between a relationship instance

and a relationship type?

31. What is a participation role? When is it necessary to use role names in description

or relationship type? 32. Explain different cardinalities applied in ER model with an example each.

33. Notown records has decided to store information about musicians who perform on its albums in a database. Design an E-R diagram on considering the following

specifications. Specify properly cardinality constraints and keys. i) Each musician that records at Notown has an SSN, name, an address

and phone number. Phone number can be more than one.

ii) Each instrument used in songs recorded at Notown has a name and a musical key.

iii) Each album recorded on the Notown has a title, a copyright date, a

format and an album identifier iv) Each song recorded at Notown has a title and an author.

v) Each musician may play several instruments, and a given instrument

may be played by several musicians. vi) Each album has number of songs on it, but no song may appear on

more than one album.

vii) Each song is performed by one or more musicians and a musician may perform a number of songs.

viii) Each album has an excellent musician who acts as its producer. A

musician can produce several albums. Chapter 3: Relational Model and Relational Algebra

Objective: This chapter describes the basic relational model, its integrity

constraints and update operations, and the operations of the Relational Algebra.

34. Discuss various update operations on relations and the type integrity constraints

that must be checked for each update operation.

35. Define the basic relational algebra operators. Show how natural join, intersection

and division can be implemented using basic operators. 36. What are integrity constraints? List different types of integrity constraints and

explain any two of them.

37. Describe how the database system will ensure that the modifications to the

database will not violate referential integrity constraints. 38. Explain the following terms with suitable examples:

a) select b) project c) join d) union e) Cartesian product

f) set difference g) natural join h) rename 39. Explain the following extended relational algebra operations:

a. Inner joins b. Outer join c. Aggregate functions

40. For each of the following queries, give an expression in the relational algebra.

Employee (Fname, Lname,SSN, Bdate, Addr, Salary, Superssn, Dno) Department (Dname, Dno, Mgrssn, Mgrstart) Dependent (ESSn, Dependent name, Bdate, Relationship)

Retrieve the names and address of all employees who work for research

department.

List the names of managers who have at least one dependent.

Page 8: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

8

41. Consider the following relational database. For each of the following queries,

give an expression in the relational algebra.

Employee (employee_name, street, salary, city)

Works (employee_name, company name, salary) Company (company name, city) Manager (employee_name, manager name)

Find the names, street address and cities of residence of all employees who

workfor First Bank Corporation and earn more than Rs. 10,000 per month.

Find the names of all employees in this database who live in the same city as the company for which they work.

42. Consider the scheme Employee(Id#, name, designation, salary) perform the

following functions using relational algebra: a. sum of salary b. count distinction designations c. maximum salary

d. delete records of employee having salary less than 1000 e. insert a record Chapter 4: SQL-The Relational Database Standard

Objective: It gives a detailed overview of the SQL language, covering the SQL2 standard.

43. Explain the following:

a) Nested Query b) Correlated nested Query

44. Write short notes on: a) Embedded SQL b) Dynamic SQL

c) Database stored procedure d) SQL/PSM

45. Data is stored in the XYZ database which has the following tables:

Employees: (Emp-no, name, street, city, zip, telephone-no, date-hired, type,

basic-pay)

Customer: (Cust-no, name, street, city, zip, telephone-no, type)

Orders: (Order-no, cust-no, emp-no, received, shipped) Order-specs: (Order-no, item-no, quantity)

Inventory: (Item-no, item-name, quantity on hand, price, re-order-level)

Based on these tables, write the queries for the following: i) Obtain the details about all the customers.

ii) Obtain max, min, average and sum of basic pay of employees. iii) List all the item names and quantity on hand.

iv) Delete an item in inventory for which quantity on hand = 0.

46. Assuming the following entities and attributes, write SQL statements

Employee (Name, SSN, Salary, DNO) Dept (Dname, Dnum)

Project (Pname, Pnumber, Dnumber)

i) Retrieve all the attributes of employees working for „Research”

department ii) Using nested query, retrieve the name of each employee who works on

all the projects controlled by dept. number 3.

iii) For each project on which more than two employees work, retrieve the project number, project name and the number of employees who works

on the project. 47. Write short notes on the following:

i) Data retrieval in SQL ii) SQL iii) Views in SQL

48. Define view with an example. How is it defined in SQL? What are the constraints on

update operations of view. 49. Consider the following scheme for the COMPANY database. The primary keys are

underlined. Employee (SSN, Fname, Lname, Bdate, Address, Salary, Dno)

Department (Dnumber, Dname, Dlocation) Perform

the following functions:

Page 9: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

9

Insert a record. i) Delete an employee with SSN equal to 10.

ii) Update the deptno. Of the employee tuple having salary greater than

10,000. iii) Retrieve the name and the address of all employees who work with „XYZ

department. iv) Find all the employees whose birth date is less than “AA-BB-CC”

50. Consider the following database schema:

Hotel (Hotelno, name city) Room (Roomno, Hotelno, type, price)

Booking (Hotelno, Guestno, datafrom, dateto, Roomno) Guest

(Guestno, Guestname, address) Represent the following using SQL

i) List the details of all the guests staying at Grosvenor hotel whose name

begins with the letter C ii) Increase the price of all double rooms by 5%

iii) Insert a new guest into the database assuming the values for required

fields suitably. iv) Delete the details of all the guests who have booked single room at

Grosvenor hotel.

v) Create a view containing hotel name and names of the guests staying at

the hotel.

51. Consider the following database:

Sailors (sid, name rating, age) Boats (bid, bname, colour) Reserves (sid, bid, date)

Answer the following using SQL

i) Find the names of the sailors reserved for the boat number 500 ii) Find the names of the sailors reserved green boat iii) Find the sailor having highest rating

iv) Delete all the sailors with rating less than 10 v) Update the rating of sailor with sid = 500 to 900

52. Consider the following database:

PERSON (driver-id, name, address) CAR

(Regno, model, year) ACCIDENT (report number, date, location)

OWNS (driver-id, Regno)

PARTICIPATED (driver-id, Regno, report number, damageamt)

Answer the following using SQL queries

i) Update the damage amount for the car with a specific Regno in the

accident with report number 12 to 25000 ii) Find the total number of people who owned cars that were involved in

accident in 2002 iii) Find the number of accidents in which cars belonging to a specific model

were involved. 53. Consider the following database:

Master(Product-number, name, quantity-in-stock, price, re-order level) Customer

(Customer-number, name, address, product-number, quantity-bought) Answer the following using SQL

i) Get the names and the quantities in stock of all the products

ii) whose quantity bought is more than 100 units iii) List all the products with quantities and prices purchased by iv) particular customer

v) List all the customers who have purchased a particular part

vi) List of parts whose stock is less than or equal to the reorder level

Page 10: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

10

54. Explain with example, the following SQL commands: i) CREATE – both view and table ii) ALTER – both add and modify

iii) SELECT – Group-by, having apart from FROM and WHERE.

55. What are views? Illustrate the problems encountered in modifying the database

through views. 56. Consider the following schema

Suppliers (Sid, Sname, Saddress, Sphone, Sphone) Parts (Pid, Pname, Pcolor, Price, ) Supplies (Sid, Pid, Qty)

The key fields are underlined. Write the following queries in relational algebra i) Find the names of suppliers who supply part 214.

ii) Find the names and addresses of suppliers who supply part “NUTS”.

iii) Find the names and phone numbers of suppliers who supply some blue

part. iv) Find the names of suppliers who supply every red part. v) Find the names of suppliers who supply every part.

Chapter 5: Database Design

Objective: This chapter encompasses different types of dependencies and

normal forms for relations. 57. What is normalization? Discuss the various normal forms with example. 58. What are the objectives of normalization?

59. Why nulls are considered bad in a relation?

60. Define functional dependency. Briefly explain the six rules for functional

dependency.

61. Explain normalization in Relational database design. Define I, II, III and B-C

normal forms. 62. Write short notes on:

a) First Normal Form b) Second Normal Form c) Third Normal Form

Chapter 6: PL/SQL

63. Explain about conditional and sequential control?

64. Discuss in detail about triggers, functions and procedures with examples

65. Write a program to implement PL/SQL.

Page 11: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

11

Page 12: PESIT- Bangalore South Campus Hosur Road (1km …pesitsouth.pes.edu/pdf/mca/RS/13MCA25-DATABASE_MANAGEMENT… · course on the principles and practice of database systems is now an

12

Perseverance Excellence Service