Assign 2 Problem Statements

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Problem Statements

Assignment 1
Title: ER Modeling and Normalization:

Problem Statement: Decide a case study related to real time application in group
of 2-3 students and formulate a problem statement for application to be
developed. Propose a Conceptual Design using ER features using tools like ERD
plus, ER Win etc. (Identifying entities, relationships between entities, attributes,
keys, cardinalities, generalization, specialization etc.) Convert the ER diagram
into relational tables and normalize Relational data model

Assignment 2A
Title: Design and Develop SQL DDL statements which demonstrate the use
of SQL objects such as Table, View, Index, Sequence, Synonym, different
constraints.

Problem Statement: Create the University Database having following


specifications:
1. Department table( dept_no, dept_name, building_name )
Apply Unique constraint on name field.
2. Instructor table( ins_id, ins_name, dept_no, salary, mob_no )
Apply NOT NULL constraint on name field.
3. Course table( course_id of int data type, title, dept_no, credits )
4. Teaches table( teacher_id, course_id, semester, year )
Qu eries :
1) Add the primary key in department table.

2) Add the foreign key in instructor table.

3) Modify the table department by adding a column budget.

4) Create unique index on mobile number of instructor table.

5) Create a view of instructor relation except the salary field.

6) Insert record into instructor table using newly created viewname.

7) Update the department number of particular instructor using update view.

8) Delete record of particular instructor from instructor table using newly created viewname.

9) Delete the last view.


10) Remove the Budget from department table.

11) Increase the size of the title field of course relation.

12) Delete the index from the instructor table.

13) Rename the course table to another table name.

14) Create a view by showing a instructor name and title of course they teaches.

15) Delete the primary key from the department table.

16) create a sequence (or use the AUTO_INCREMENT attribute) on course_id starting with
51

17) Create database and show all databases

18)Create table and show all table

19) Delete all records with truncate command.


20) delete teaches table

Assignment 2B
Title:Write at least 10 SQLqueries on the suitable database application
using SQL DML statements
Create a medical database having following table.
1. Patient table (pat_id,pat_name,date_adm,age,city);
2. Doctor table(doc_id,doc_name,qualification,exp,dept,city,salary);
3. Treats table(doc_id,pat_id,disease); foriegn key doc_id,pat_id;
doc_id on delete cascade
pat_id on delete set null

Query:--
1. Insert atleast 5 records in each table;
2. Display all the patient's name between the age group 18-50;
3. Display the list of doctors who are MD;
4. Display the list of doctors whose exp is 20+ years;
5. Display patients suffering from Cancer;
6. Display the patient name and the doctor name who r in cancer;
7. Display the patient name, whose name starts with letter A, End with A,
having the exacts 5 letters;
8. Remove all the records of patients with Pat_id =p10;
9. Remove all the records of doctor Suhas;
10. change the qualification of doctor shubham from mbbs to md;
11. give five percent salary raise to the dentist 5% and 10% to cardiologists,
in single query;
12. Display dept wise total salary of the doctors;
13. Find the dept , which has the highest avg salary;
find the avg salary of docs in dentist dept;
15. Find the dept where avg salary of the doctor is more than 50,000;
16. find how many docs works in hospital;
17. Find out how many doctors actually treated a patient;
18. list the cities in which either doctors or patient lives;
19. list the cites where both lives; List dname pname and their cities name if
they live in same city.
20. Find the doctors who have not treated any patient;
21. a) Display name of doctors and patients as a single column (union)
b) Let duplicate name appear many time (union all)
22. whats the total money collected so far from treatment of patients
23 Find average salary of each department.
24. Display patient name which does not have email id.

You might also like