5 Sem Syllabus
5 Sem Syllabus
5 Sem Syllabus
Teaching Hrs /
Examination
Week
Sl. Subject Teaching
Title of the Subject Marks
No. Code Dept. Duration
Theory Practical Theory /
(Hrs) IA Total
Practical
1. Consider the Insurance database given below. The primary keys are underlined and the data types are
specified:
PERSON (driver – id #: String, name: string, address: string)
CAR (regno: string, model: string, year: int)
ACCIDENT (report-number: int, accd-date: date, location: string)
OWNS (driver-id #:string, Regno:string)
PARTICIPATED (driver-id: string, Regno:string, report-number:int, damage amount:int)
(i) Create the above tables by properly specifying the primary keys and the foreign keys.
(ii) Enter at least five tuples for each relation.
(iii) Demonstrate how you
a. Update the damage amount to 25000 for the car with a specific Regno in the ACCIDENT table with
report number 12.
b. Add a new accident to the database.
(iv) Find the total number of people who owned cars that were involved in accidents in 2008.
(v) Find the number of accidents in which cars belonging to a specific model were involved.
(vi) Generate suitable reports.
(vii) Create suitable front end for querying and displaying the results.
2. Consider the following relations for an order processing database application in a company:
CUSTOMER (cust #: int , cname: string, city: string)
ORDER (order #: int, odate: date, cust #: int, ord-Amt: int)
ORDER – ITEM (order #: int, item #: int, qty: int)
ITEM (item # : int, unit price: int)
SHIPMENT (order #: int, warehouse#: int, ship-date: date)
WAREHOUSE (warehouse #: int, city: string)
(i) Create the above tables by properly specifying the primary keys and the foreign keys.
(ii) Enter at least five tuples for each relation.
(iii) Produce a listing: CUSTNAME, #oforders, AVG_ORDER_AMT, where the middle column is the
total numbers of orders by the customer and the last column is the average order amount for that
customer.
(iv) List the order# for orders that were shipped from all the warehouses that the company has in a
specific city.
(v) Demonstrate the deletion of an item from the ITEM table and demonstrate a method of
handling the rows in the ORDER_ITEM table that contain this particular item.
(vi) Generate suitable reports.
(vii) Create suitable front end for querying and displaying the results.
3. Consider the following database of student enrollment in courses & books adopted for each course:
STUDENT (regno: string, name: string, major: string, bdate:date)
COURSE (course #:int, cname:string, dept:string)
ENROLL ( regno:string, course#:int, sem:int, marks:int)
BOOK _ ADOPTION (course# :int, sem:int, book-ISBN:int)
TEXT (book-ISBN:int, book-title:string, publisher:string, author:string)
(i) Create the above tables by properly specifying the primary keys and the foreign keys.
(ii) Enter at least five tuples for each relation.
(iii) Demonstrate how you add a new text book to the database and make this book be adopted by
some department.
(iv) Produce a list of text books (include Course #, Book-ISBN, Book-title) in the alphabetical order
for courses offered by the ‘CS’ department that use more than two books.
(v) List any department that has all its adopted books published by a specific publisher.
(vi) Generate suitable reports.
(vii) Create suitable front end for querying and displaying the results.
4. The following tables are maintained by a book dealer:
AUTHOR (author-id:int, name:string, city:string, country:string)
PUBLISHER (publisher-id:int, name:string, city:string, country:string)
CATALOG (book-id:int, title:string, author-id:int, publisher-id:int, category-id:int, year:int, price:int)
CATEGORY (category-id:int, description:string)
ORDER-DETAILS (order-no:int, book-id:int, quantity:int)
(i) Create the above tables by properly specifying the primary keys and the foreign keys.
(ii) Enter at least five tuples for each relation.
(iii) Give the details of the authors who have 2 or more books in the catalog and the price of the
books is greater than the average price of the books in the catalog and the year of publication is after
2000.
(iv) Find the author of the book which has maximum sales.
(v) Demonstrate how you increase the price of books published by a specific publisher by 10%.
(vi) Generate suitable reports.
(vii) Create suitable front end for querying and displaying the results.
5. Consider the following database for a banking enterprise:
BRANCH(branch-name:string, branch-city:string, assets:real)
ACCOUNT(accno:int, branch-name:string, balance:real)
DEPOSITOR(customer-name:string, accno:int)
CUSTOMER(customer-name:string, customer-street:string, customer-city:string)
LOAN(loan-number:int, branch-name:string, amount:real)
BORROWER(customer-name:string, loan-number:int)
(i) Create the above tables by properly specifying the primary keys and the foreign keys
(ii) Enter at least five tuples for each relation
(iii) Find all the customers who have at least two accounts at the Main branch.
(iv) Find all the customers who have an account at all the branches located in a specific city.
(v) Demonstrate how you delete tuples in ACCOUNT relation at every branch located in a specific city.
(vi) Generate suitable reports.
(vii) Create suitable front end for querying and displaying the results.
Instructions:
1. The exercises are to be solved in an RDBMS environment like Oracle or DB2.
2. Suitable tuples have to be entered so that queries are executed correctly.
3. Front end may be created using either VB or VAJ or any other similar tool.
4. The student need not create the front end in the examination. The results of the queries may be
displayed directly.
5. Relevant queries other than the ones listed along with the exercises may also be asked in the
examination.
6. Questions must be asked based on lots.
1. Implement Recursive Binary search and Linear search and determine the time required to search an
element. Repeat the experiment for different values of n, the number of elements in the list to be searched and
plot a graph of the time taken versus n.
2. Sort a given set of elements using the Heapsort method and determine the time required to sort the
elements. Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot
a graph of the time taken versus n.
3. Sort a given set of elements using Merge sort method and determine the time required to sort the elements.
Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of
the time taken versus n.
4. Sort a given set of elements using Selection sort and determine the time required to sort elements. Repeat
the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of the
time taken versus n.
5. Implement 0/1 Knapsack problem using dynamic programming.
6. From a given vertex in a weighted connected graph, find shortest paths to other vertices using Dijkstra's
algorithm.
7. Sort a given set of elements using Quick sort method and determine the time required sort the elements.
Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of
the time taken versus n.
8. Find Minimum Cost Spanning Tree of a given undirected graph using Kruskal's algorithm.
9. a. Print all the nodes reachable from a given starting node in a digraph using BFS method.
b. Check whether a given graph is connected or not using DFS method.
10. Find a subset of a given set S = {sl,s2,.....,sn} of n positive integers whose sum is equal to a given positive
integer d. For example, if S= {1, 2, 5, 6, 8} and d = 9 there are two solutions{1,2,6}and{1,8}.A suitable message is to
be displayed if the given problem instance doesn't have a solution.
11. a. Implement Horspool algorithm for String Matching.
b. Find the Binomial Co-efficient using Dynamic Programming.
12. Find Minimum Cost Spanning Tree of a given undirected graph using Prim’s algorithm.
13. a. Implement Floyd’s algorithm for the All-Pairs- Shortest-Paths problem.
b. Compute the transitive closure of a given directed graph using Warshall's algorithm.