Dbms Practical File Sem 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

DATABASE MANAGEMENT SYSTEM

PRACTICAL FILE

Submitted for partial fulfillment for the award of the


Degree of

BACHELOR OF COMPUTER APPLICATION

Submitted by: Submitted to:


SHANTANU KUMAR PROF. REKHA
Enrollment No:
ASB/BCA/19/045

ASIAN SCHOOL OF BUSINESS


Sector-125, Noida
(Affiliated to Choudhary Charan Singh University)
Meerut
(2019-2022)
Q1. Design an Entity relationship diagram for a typical library management System:
Q2. Design an ERD for hotel management system:
Q3. ERD for bank management system
Q4. HOSPITAL MANAGEMENT

Entities:

Patient - The entity has following ayttributes(Patient id, name, Date of Birth, Age, Address)
Doctor - This entity has following attributes (Degree , Doc Id, Name, specialization)

Report – This entity has following attributes (Report id , prescription , result)

Cardinalities :-

Between doctor and patient – m to m

Between patient and report - 1 to 1

Between doctor and report - m to m

Between doctor to patient (assist)- m to m


Q5. University Management ERD
ENTITIES:-

STUDENT – The entity student has these attributes(Name, Age , address, SID)
CLASS – The entity class has these attributes(CID, Number, Major)
GRADE – The entity grade has these attributes (Mjor, GNo , Marks)
MAJOR – The entity major has no attributes
DEPERTMENT – The department student has these attributes( Dname, DID)
FACULTY – The entity faculty has these attributes( FID, F name, Address)

CARDINALITIES:-
Between Student and Class – 1 to 1
Between Student and Department -1 to 1
Between Class to Faculty – m to 1
Between Department to Faculty - 1 to m
Between Student and Grade – 1 to 1
Between Class and Grade - m to 1
Structured Query Language

SQL stands for the structured query language used to store, retrieve and manipulate data stored in databases.
It includes command of DDL(data definition language), DCL(Data control language), TCL(Transmission
control language), and DML(Data manipulation language). 

Some of the commands included are:


CREATE
DROP
ALTER (ADD, MODIFY, DROP)
RENAME
INSERT
UPDATE
DELETE
GRANT
REVOKE
COMMIT
ROLLBACK
SAVEPOINT
SELECT

CREATE TABLE Persons ( 


    PersonID int, 
    CustomerName varchar(255), 
    ContactName varchar(255), 
    Address varchar(255), 
    City varchar(255) 
)
Table Inserted
INSERT INTO Persons (PersonID, CustomerName, ContactName, Address, City) /* Don't put a comma at
the end */
VALUES (34, 'Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger')
One Row Inserted
INSERT INTO Persons (PersonID, CustomerName, ContactName, Address, City) /* Don't put a comma at
the end */
VALUES (35, 'Alfred', 'Tom', 'Times Square', 'New York City')
One Row Inserted

Update Persons set Address = 'Staten Island' where City = 'New York City'
One Row Updated

Delete from Persons where PersonID = 35


One Row Deleted

ALTER table Persons Add State varchar2(40)


Table Altered

ALTER table Persons Modify State varchar(30)


Table Altered

ALTER table Persons Drop column State 


Table Altered

You might also like