Make A Draft of Your Project: Writing Code and Diagrams Wherever Necessary Using OOSP Concepts, This Work Will Be
Make A Draft of Your Project: Writing Code and Diagrams Wherever Necessary Using OOSP Concepts, This Work Will Be
Make A Draft of Your Project: Writing Code and Diagrams Wherever Necessary Using OOSP Concepts, This Work Will Be
Hope you enjoyed the Happy Holi and long semester break –Good, now get back to work…
NOTE <Codes, UML and ER Diagram should be neatly written and drawn on Paper with name and
enrollment no at top, Project Title and strictly no Software/Editor usage--and to be done individually in
lab not group-wise>. This has to be shown to lab teacher only at evaluation date.
Question 1. Analyze the current project. Now Make a Draft of your Project on similar 6 points
writing code and Diagrams wherever necessary using OOSP Concepts, this work will be
incremented by ongoing lectures and labs[Normalization and Connectivity Topics to be
attended with Ongoing Lectures done in class i.e. will be covered in lecture this week but has to
be completed by evaluation date]. The topics here to be referred are given. But these 6 Points
should be clearly mapped with your Project Domain. Draft -1 will consist of Q1, 2 and
Q3part B> You can refer DBMS Validation and Verification Questions given in T2 Question
Paper or old DBMS Labs.
TDD APPROACH: Write your Verification and Validation Codes on those formats using Joins,
Nested Queries, Advances Select, User and System Defined EXCEPTIONS.
OOSP Concepts: TDD Approach: Validation of variables in methods, Casting for formats
ex: bdate format, name is string, staff id in integer, parking can be filled in 2 types, non
vegItems present in menu or not etc.
4. Single application with persistent data: multiple classes, multiple functions, simple class
relation, multiple data table.
Class: Cafeteria, Customer
Function:
Cafeteria: Parking, Staff_Record, Menu
Customer: Customer_Record
Attributes:
Cafeteria:: Parking:p_type
Cafeteria:: Menu:bill
Cafeteria:: staff_record: staff_id, staff_name,staff_job
Customer:: Customer_Record: cutomer_name, cutomer_bdate
OOSP Concepts: OO Concepts: Objects, Classes, Inner classes, Methods, Constructors, Static
member functions , Wrapper Classes, Packages and Interfaces and Garbage collection +
Introduction to RDBMS, create table, simple create,insert, select.= [1,2,3,4]
DBMS Tables for the same,Create Data, INSERT Data AND select //simple sql
TDD Approach=Simple Select + Simple Exception Handling
5. Single application with persistent data: multiple classes, multiple functions, complex class
relation (inheritance), multiple data table.
Class: Cafeteria, Customer
Function:
Cafeteria: Parking, Staff_Record, Menu
Customer: Customer_Record
Attributes:
Cafeteria:: Parking:p_type
Cafeteria:: Menu:bill
Cafeteria:: staff_record: staff_id, staff_name,staff_job
Customer:: Customer_Record: cutomer_name, cutomer_bdate
6. Single application with persistent data: multiple classes, multiple functions, complex class
relation (polymorphism), multiple data table.
OOSP Concepts: Polymorphism+ System Analysis and Design Methodologies, UML (Object
diagram, Class diagram-(Part of Q2 so attend in Q2 Only)+Connecting with simple access
table+DBMS Tables for the same i.e. INSERT Data, Create Data //Advanced sql-JOINS-part
2 +ER i.e. Entity Relationship Diagram (Part of Q3 so attend in Q3 Only)+
TDD Approach=Adv. Select + User Defined /System Defined Exception Handling
Question 2. Most of your project UML’S have errors so rectify and make a Draft of all
UML’S for your Project Use Cases as Lab Assignment
1. Use Case
2. Activity
3. Sequence
4. Class and Object Diagram
5. Collaboration
6. Component. ( To be submitted with the final report)
7. Deployment.( To be submitted with the final report)
Q3 A>Consider the following information about a university database:
• Professors have an SSN, a name, an age, a rank, and a research specialty.
• Projects have a project number, a sponsor name (e.g., NSF), a starting date, an
ending date, and a budget.
• Graduate students have an SSN, a name, an age, and a degree program (e.g., M.S.
or Ph.D.).
• Each project is managed by one professor (known as the project’s principal
investigator).
• Each project is worked on by one or more professors (known as the project’s
co-investigators).
• Professors can manage and/or work on multiple projects.
• Each project is worked on by one or more graduate students (known as the
project’s research assistants).
• When graduate students work on a project, a professor must supervise their work
on the project. Graduate students can work on multiple projects, in which case
they will have a (potentially different) supervisor for each one.
• Departments have a department number, a department name, and a main office.
• Departments have a professor (known as the chairman) who runs the department.
• Professors work in one or more departments, and for each department that they
work in, a time percentage is associated with their job.
• Graduate students have one major department in which they are working on their
degree.
• Each graduate student has another, more senior graduate student (known as a
student advisor) who advises him or her on what courses to take.
Design and draw an ER diagram that captures the information about the university.
Use only the basic ER model here; that is, entities, relationships, and attributes. Be
sure to indicate any key and participation constraints.
Question 1>Create the following tables for a COMPANY DATABASE, Normalize the data till
BCNF AND ASNWER FOLLOWING QUESTIONS.
EMPLOYEE(EmployeeId,Lname,Fname,PoisitionId,Supervisor,Hiredate
,Salary,Commission,Deptid,Qualid,DOB) (DOB>25)
DEPENDENT(EmployeeId,Dependentid,DepDOB,Relation)
POSITION(Positionid,PosDesc)
DEPT(Deptid,DeptName,Location,Employeeid)
QUALIFICATION(Qualid,Qualdesc)
EMPLEVEL(Levelno,Lowsalary,Highsalary)
1. Display all employee names (last name and first name separated by a
comma and a space) with proper case.
2. Display all employees with their commission value. Display 0 commission
for employees who do not get any commission.
3. Count the total number of employees in 1 department pertaining to 1 LOCATION.
4. Count the distinct Department names in LOCATION.
5. Display all Employees date of joining and their total yr of exp in company.
6. Find the average, highest, and lowest age for Employees.
7. Display the total number of dependents for each employee for employees
who have at least two dependents.
8. Display only the year value from each employee’s hire date.
9. Find average employee commission. (a) Ignore nulls. (b) Do not ignore
nulls.
10. Find sum of Maximum count by term by DEPARTMENT EXCELLING SALES AMOUNT
1 LAKH. (GROUP BY two columns)
11. Count number of EMPLOYEE members by each department.
13.Display average employee salary by department, but do no include
departments with average salary less than $75,000.
14.Find number of years employees have been working for. Display integer
part of value only.
15. Find Employees recruited in the month of May.
16. Display employee’s last name and first name, followed by
salary+commission if commission is not null, else display salary only.
17. Display employee’s full name followed by a message based on salary. If
salary is above $100,000, display “HIGH”. If salary is between $50,000 and
$100,000, display “MEDIUM”. If salary is below $50,000, display “LOW”.
Question 4> For all the two cases given below attend (i) and (ii)
Case 1:
Case 2:
Question 5> Find the relational tables, their primary and foreign keys corresponding to
the following E-R diagrams. Write the corresponding SQL DDL for each relation.
Question 6> Consider the following relation
patients (pnum, pname, age)
doctors (dnum, dname, rank, phone)
visits (pnum, dnum, date, diagnosis)
(Set Operation)
i. Find all the patients who saw doctor 801 but not 802 (i.e. dnum=801, dnum ≠ 802)
(Join)
i. Who are the surgeons who visited the patient 101 (i.e. pnum = 101)?
ii. Is there any non-surgeon doctors who performed a surgeon (a doctor performed a
surgeon if the visit
record shows diagnosis=”operation” for him)?
(Division)
i Who has seen all the surgeons in the past two months?
4. Compute the closure of the following set F of functional dependencies for relation
schema R = (A, B, C, D, E).
A BC
CD E
BD
EA
List all the candidate keys of relation R.
Question 8:
Q1. Decompose the given below relation R up to BCNF relations.
fd1
fd2
fd3
fd4
fd1
fd2
fd3
fd4
fd5