ADBMS-Assignment
ADBMS-Assignment
a) Construct an ER diagram for a hospital along with a set of patients and a set of
medical doctors Associate with every patient a log of the several tests and
examinations conducted.
b) This Hospital Management System Database Design has an ER Diagram for Hospital
Management System project. This material includes database schema.
c) Necessary SQL command for different reports of tests, bill, doctor’s prescription and
admission information.
3) Compute the closure of the following set F of functional dependencies for relation
schema r (A, B, C, D, E).
A→BC
CD→E
B→D
E→A
o DDL changes the structure of the table like creating a table, deleting a table, altering a
table, etc.
o All the command of DDL are auto-committed that means it permanently save all the
changes in the database.
o CREATE
o ALTER
o DROP
o TRUNCATE
a. CREATE It is used to create a new table in the database.
b. DROP: It is used to delete both the structure and record stored in the table.
c. ALTER: It is used to alter the structure of the database. This change could be either
to modify the characteristics of an existing attribute or probably to add a new
attribute.
d. TRUNCATE: It is used to delete all the rows from the table and free the space
containing the table.
As for your free-time, find the time periods for all sections taken by a student and free time is
whats left. The following will give the time blocks where a student is BUSY.
SELECT T.*
FROM section S
INNER JOIN time_blocks T on S.time_id = T.id
INNER JOIN student_to_section STS on STS.section_id = S.id
WHERE STS.student_id = ###
5)
Write down relational algebra to express the following queries:
(i) Find the names of all employees who do not work in Sonali Bank.
SELECT *
FROM Sonali_Bank
WHERE EMPLOY_ID NOT IN;
(iii) Find the names of all employee whose manager name is Md. Salam Mia.
(ii) Find out the total amount of salary of Sonali Bank of Gazipur City.
SELECT SUM(salary) AS "Total Salary"
FROM employees
WHERE salary > 80000;
(iii) Sort the name of all employee of AB Bank of Uttara.
SELECT first_name, last_name, employees _name
FROM employees
WHERE employees _name IN (30, 100)
ORDER BY employees _name ASC;