You are on page 1of 84

Information Systems Management Lab (BBA 307)

Submitted in partial fulfilment of the requirement of Bachelor of Business Administration


(BBA)

Guru Gobind Singh Indraprastha University, Delhi


Session 2021-24

Under the Guidance of Submitted by


Mrs. CHARU Animesh Gupta
(Assistant Professor) BBA-V Sem
Enrollment No- 0572550172

JIMS ENGINEERING MANAGEMENT TECHNICAL CAMPUS


48/4, Knowledge Park III, Greater Noida-201306 (U.P.)
Lab Manual of Information Systems Management Lab

S.No Particulars Page Signature


no
1. Introduction SQL 1-3
2. Roadway travels E-R Diagrams 4-6
3. Various Data Types 7-8
4. Key Constrains-Normalization 9-10
5 Part A: Implementation of DDL commands of SQL with suitable examples
• Create table
• Alter table 11-13
• Drop Table

6. Implementation of DML commands of SQL with suitable examples


• Insert
• Update 14-16
• Delete

7. Implementation of different types of function with suitable examples


• Number function
• Aggregate Function
• Character Function 17-22
• Conversion Function
• Date Function

8. Implementation of different types of operators in SQL


• Arithmetic Operators
• Logical Operators
23-28
• Comparison Operator
• Special Operator
• Set Operation
9. Consider the following schema for a Library Database:
BOOK (Book_id, Title, Publisher_Name, Pub_Year)
BOOK_AUTHORS (Book_id, Author_Name)
PUBLISHER (Name, Address, Phone)
BOOK_COPIES (Book_id, Branch_id, No-of_Copies)
BOOK_LENDING (Book_id, Branch_id, Card_No, Date_Out, Due_Date)
LIBRARY_BRANCH (Branch_id, Branch_Name, Address)
Write SQL queries to
1. Retrieve details of all books in the library – id, title, name of publisher,
29-44
authors, number of copies in each branch, etc.
2. Get the particulars of borrowers who have borrowed more than 3 books,
but from Jan 2023 to Jun 2023
3. Delete a book in BOOK table. Update the contents of other tables to
reflect this data manipulation operation.
4. Partition the BOOK table based on year of publication. Demonstrate its
working with a simple query.
5. Create a view of all books and its number of copies that are currently
available in the library.
10. Consider the following schema for Order Database:
SALESMAN(Salesman_id, Name, City, Commission)
CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id)
ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id,
Salesman_id)
Write SQL queries to
1. Count the customers with grades above Bangalore’s average.
2. Find the name and numbers of all salesmen who had more than one 45-56
customer.
3. List all the salesman and indicate those who have and don’t have
customers in their cities (Use UNION operation.)
4. Create a view that finds the salesman who has the customer with the
highest order of a day.
5. Demonstrate the DELETE operation by removing salesman with id 1000.
All his orders must also be deleted.
11. Consider the schema for Movie Database:
ACTOR(Act_id, Act_Name, Act_Gender)
DIRECTOR(Dir_id, Dir_Name, Dir_Phone)
MOVIES(Mov_id, Mov_Title, Mov_Year, Mov_Lang, Dir_id)
MOVIE_CAST(Act_id, Mov_id, Role)
RATING(Mov_id, Rev_Stars)
Write SQL queries to
1. List the titles of all movies directed by ‘Hitchcock’.
57-70
2. Find the movie names where one or more actors acted in two or more
movies.
3. List all actors who acted in a movie before 2000 and in a movie after 2015
(use JOIN operation).
4. Find the title of movies and number of stars for each movie that has at
least one rating and find the highest number of stars that movie received.
Sort the result by movie title.
5. Update rating of all movies directed by ‘Steven Spielberg’ to 5.
12. Part B: Mini project
• For any problem selected, write the ER Diagram, apply ER-mapping
rules, normalize the relations, and follow the application
development process.
71-78
• Make sure that the application should have five or more tables, at
least.
• Indicative areas include health care, education, industry, transport,
supply chain, etc.
INTRODUCTION TO SQL

SQL (Structured Query Language) is a programming language which is used to


manage data stored in relational databases like MySQL, MS Access, SQL Server,
Oracle, Sybase, Informix, Postgres etc.

Our SQL tutorial helps you learn SQL (Structured Query Language) in simple and
easy steps so that you can start your database programming quickly. It covers most
of the important concepts related to SQL for a basic to advanced understanding of
SQL and to get a feel of how SQL works.

SQL is a database computer language designed for the retrieval and management
of data in a relational databases like MySQL, MS Access, SQL Server, Oracle,
Sybase, Informix, Postgres etc. SQL stands for Structured Query Language. SQL
was developed in the 1970s by IBM Computer Scientists.

SQL is not a database management system, but it is a query language which is


used to store and retrieve the data from a database or in simple words SQL is a
language that communicates with databases.

1|Page Information Systems Management Lab File


MODELS OF SQL
1. Relational Model:
Description: The relational model is the most widely used model for
database management. It represents data as tables with rows and columns,
where each row is a record and each column is an attribute. Relationships
between tables are established using keys. For example -

2. Insert Tab: Entity-Relationship Model (ER Model):


Description: The ER model is a conceptual model used to represent
entities, attributes, and relationships between entities. It is often used as a
precursor to designing relational databases. For example –

.
2|Page Information Systems Management Lab File
3. Object-Relational Model:
Description: Combines elements of both the relational and object-
oriented models. It allows the use of objects, classes, and inheritance
within the relational database context. For example –

4. Key-Value Model:
Description: In key-value stores, data is stored as key-value pairs. These
databases are optimized for simple retrieval and storage of data without
the need for a complex schema.

3|Page Information Systems Management Lab File


ROADWAY TRAVELS ER DIAGRAM

ER Diagram:

An Entity Relationship Diagram (ER Diagram) pictorially explains the


relationship between entities to be stored in a database. Fundamentally, the ER
Diagram is a structural design of the database. It acts as a framework created with
specialized symbols for the purpose of defining the relationship between the
database entities.
ER diagram is created based on three principal components: entities, attributes,
and relationships.

ER Model:

An Entity-Relationship Model represents the structure of the database with the


help of a diagram. ER Modelling is a systematic process to design a database as it
would require you to analyze all data requirements before implementing your
database.

Symbols Used in ER Diagrams:

• Rectangles: This Entity Relationship Diagram symbol represents entity


types
• Ellipses: This symbol represents attributes
• Diamonds: This symbol represents relationship types
• Lines: It links attributes to entity types and entity types with other
relationship types
• Primary key: Here, it underlines the attributes
• Double Ellipses: Represents multi-valued attributes

4|Page Information Systems Management Lab File


5|Page Information Systems Management Lab File
6|Page Information Systems Management Lab File
VARIOUS DATA TYPES

1. Integer Types:

• INT: Integer type is commonly used for representing whole numbers.


• SMALLINT: Represents a smaller range of integers compared to INT.
• TINYINT: Represents a very small range of integers.

2. Decimal Types:

• DECIMAL or NUMERIC: Fixed-point decimal type, used for exact


numeric representation.
• FLOAT: Floating-point type is used for approximate numeric
representation with floating-point precision.
• REAL: Real number type represents a single-precision floating-point
number.

3. Character String Types:

• CHAR(n): Fixed-length character string where "n" specifies the length.


• VARCHAR(n): Variable-length character string with a maximum length of
"n."
• TEXT: Variable-length character string for large text data.

4. Date and Time Types:

• DATE: Represents a date (year, month, day).


• TIME: Represents a time of day (hour, minute, second, fraction of a second).
• DATETIME or TIMESTAMP: Represents a combination of date and time.
• INTERVAL: Represents a period of time.

5. Boolean Type:

• BOOLEAN or BOOL: Boolean type representing true or false values.

7|Page Information Systems Management Lab File


6. Binary Types:

• BINARY(n): Fixed-length binary data with a length of "n" bytes.

7. User-Defined Types:

• ENUM: User-defined enumeration type, representing a set of named values.


• ARRAY: Array type for storing arrays of values.

8|Page Information Systems Management Lab File


KEY CONSTRAINTS & NORMALIZATION

Primary Key:
• A primary key is a unique identifier for a record in a table.
• It ensures that each row in a table is uniquely identified.
• The primary key can be a single column or a combination of columns.

Foreign Key:
• A foreign key is a column or a set of columns in a table that refers to the
primary key of another table.
• It establishes a link between two tables and enforces referential integrity.

Unique Key:
• A unique key constraint ensures that all values in a column (or a set of
columns) are unique.
• Unlike the primary key, it allows for NULL values.

Composite Key:
• A composite key is a key that consists of multiple columns to uniquely
identify a record.
• It is similar to a primary key but involves more than one column.

Candidate Key:
• A candidate key is a set of one or more columns that can uniquely identify a
record.
• From the candidate keys, one is chosen to be the primary key.

9|Page Information Systems Management Lab File


Normalization is a database design process used to organize tables and
relationships in a relational database in such a way that data redundancy and
dependency are minimized. The goal of normalization is to achieve a database
schema that is free from undesirable characteristics, such as insertion, update, and
deletion anomalies. The process follows a set of rules, often expressed in normal
forms, to structure the data efficiently and maintain data integrity.

First Normal Form (1NF):


• Ensures that each table cell contains a single, atomic (indivisible) value.
• Eliminates repeating groups and ensures that each column contains only one
value.
Second Normal Form (2NF):
• Meets the requirements of 1NF.
• Eliminates partial dependencies, meaning that no column is dependent on
only a portion of the primary key.
Third Normal Form (3NF):
• Meets the requirements of 2NF.
• Eliminates transitive dependencies, ensuring that no non-prime attribute (a
column not part of the primary key) is dependent on another non-prime
attribute.
Boyce-Codd Normal Form (BCNF):
• A more advanced version of 3NF.
• Ensures that every non-trivial functional dependency is a superkey.

10 | P a g e Information Systems Management Lab File


IMPLEMENTATION OF DDL COMMANDS OF SQL

1. Create table
Definition: Create a new table in the database.
Example - Car Dealer:
CREATE TABLE Cars (
CarID INT PRIMARY KEY,
Model VARCHAR(50),
Year INT,
Price DECIMAL(10, 2),
Color VARCHAR(20)
);

11 | P a g e Information Systems Management Lab File


2. Alter Table:
Definition: Modify the structure of an existing table.
ALTER TABLE Cars
ADD COLUMN EngineType VARCHAR(30);

12 | P a g e Information Systems Management Lab File


3. Drop Table:
Definition: Remove a table and its data from the database.

DROP TABLE Cars;

13 | P a g e Information Systems Management Lab File


IMPLEMENTATION OF DML COMMANDS OF SQL

1. Insert
Definition: Add new records (rows) to a table

INSERT INTO Cars (CarID, Model, Year, Price, Color)


VALUES (1, 'Toyota Camry', 2022, 25000.00, 'Blue');

14 | P a g e Information Systems Management Lab File


2. Update:
Definition: Modify existing records in a table.

UPDATE Cars
SET Price = 26000.00
WHERE Model = 'Toyota Camry';

15 | P a g e Information Systems Management Lab File


3. Delete:
Definition: Remove records from a table.

DELETE FROM Cars


WHERE Model = 'Toyota Camry';

16 | P a g e Information Systems Management Lab File


IMPLEMENTATION OF DIFFERENT TYPES OF OPERATORS

CREATE TABLE Student (


StudentID INT PRIMARY KEY,
FirstName VARCHAR(255),
LastName VARCHAR(255),
Age INT,
Marks INT
);

INSERT INTO Student (StudentID, FirstName, LastName, Age, Marks)


VALUES
(1, 'John', 'Doe', 22, 75),
(2, 'Jane', 'Smith', 23, 88),
(3, 'Bob', 'Johnson', 21, 92),
(4, 'Alice', 'Williams', 22, 65);

SELECT * FROM Student;

17 | P a g e Information Systems Management Lab File


1. Number function
SELECT AVG(Marks) AS AvgMarks, COUNT (StudentID) AS TotalStudents,
MAX(Marks) AS MaxMarks, MIN(Marks) AS MinMarks, SUM(Marks) AS
TotalMarks
FROM Student;

SELECT * from student;

18 | P a g e Information Systems Management Lab File


2. Aggregate function
SELECT StudentID, FirstName, Marks, ABS (Marks 80 ) AS Distance From 80,
ROUND (Marks, 1) AS RoundedMarks
FROM Student:
SELECT* from student;

19 | P a g e Information Systems Management Lab File


3. Character function
SELECT StudentID, CONCAT(FirstName,LastName) AS FullName,
UPPER(FirstName) AS UpperFirstName, LOWER (LastName) as
LowerLastName

FROM Student;

SELECT* from student;

20 | P a g e Information Systems Management Lab File


4. Conversion function
SELECT StudentID, Marks, CAST (Marks AS VARCHAR(10)) AS
MarksAsString, CONVERT (VARCHAR(10), Age) AS AgeAsString

FROM Student;
SELECT* from student;

21 | P a g e Information Systems Management Lab File


5. Date function
SELECT StudentID, FirstName, LastName, GETDATE() AS CurrentDate,
YEAR (GETDATE()) AS CurrentYear, MONTH(GETDATE()) AS
CurrentMonth
FROM Student;

SELECT *from student;

22 | P a g e Information Systems Management Lab File


IMPLEMENTATION OF DIFFERENT TYPES OF OPERATORS

CREATE TABLE sample_table (


id INT,
numeric_col INT,
string_col VARCHAR(50),
date_col DATE
);
INSERT INTO sample_table VALUES
(1, 10, 'apple', '2023-01-01'),
(2, 20, 'banana', '2023-02-01'),
(3, 30, 'orange', '2023-03-01');

SELECT * FROM sample_table;

23 | P a g e Information Systems Management Lab File


1. Arithmetic Operators
-- Addition
SELECT id, numeric_col + 5 AS added_value FROM sample_table;

-- Subtraction
SELECT id, numeric_col - 5 AS subtracted_value FROM sample_table;

-- Multiplication
SELECT id, numeric_col * 2 AS multiplied_value FROM sample_table;

-- Division
SELECT id, numeric_col / 2 AS divided_value FROM sample_table;

24 | P a g e Information Systems Management Lab File


2. Logical Operators

-- AND

SELECT * FROM sample_table WHERE numeric_col > 10 AND string_col =


'banana';

-- OR

SELECT * FROM sample_table WHERE numeric_col < 10 OR string_col =


'orange';

-- NOT

SELECT * FROM sample_table WHERE NOT string_col = 'apple';

25 | P a g e Information Systems Management Lab File


3. Set Operators
-- UNION
SELECT id, string_col FROM sample_table WHERE numeric_col > 15
UNION
SELECT id, string_col FROM sample_table WHERE string_col = 'apple';

-- INTERSECT
SELECT id, string_col FROM sample_table WHERE numeric_col > 15
INTERSECT
SELECT id, string_col FROM sample_table WHERE string_col = 'banana';

-- EXCEPT
SELECT id, string_col FROM sample_table WHERE numeric_col > 15
EXCEPT
SELECT id, string_col FROM sample_table WHERE string_col = 'orange';

26 | P a g e Information Systems Management Lab File


4. Special Operators

-- LIKE
SELECT * FROM sample_table WHERE string_col LIKE 'a%';

-- IS NULL
SELECT * FROM sample_table WHERE date_col IS NULL;

27 | P a g e Information Systems Management Lab File


5. Comparison Operators

-- Equal to
SELECT * FROM sample_table WHERE numeric_col = 20;

-- Not equal to
SELECT * FROM sample_table WHERE numeric_col <> 20;

-- Greater than
SELECT * FROM sample_table WHERE numeric_col > 15;

-- Less than
SELECT * FROM sample_table WHERE numeric_col < 25;

-- Greater than or equal to


SELECT * FROM sample_table WHERE numeric_col >= 20;

-- Less than or equal to


SELECT * FROM sample_table WHERE numeric_col <= 20;

28 | P a g e Information Systems Management Lab File


LIBRARY DATABASE

CONSIDER THE FOLLOWING SCHEMA FOR A LIBRARY DATABASE:


(create all tables of each and run the query with the command and result adding
the screenshots of the tables created and also add table description command)
• BOOK (Book_id, Title, Publisher_Name, Pub_Year)
• BOOK_AUTHORS (Book_id, Author_Name)
• PUBLISHER (Name, Address, Phone)
• BOOK_COPIES (Book_id, Branch_id, No-of_Copies)
• BOOK_LENDING (Book_id, Branch_id, Card_No, Date_Out, Due_Date)
• LIBRARY_BRANCH (Branch_id, Branch_Name, Address)
Write SQL queries to
1. Retrieve details of all books in the library – id, title, name of publisher, authors,
number of copies in each branch, etc.
2. Get the particulars of borrowers who have borrowed more than 3 books, but
from Jan 2023 to June 2023
3. Delete a book in BOOK table. Update the contents of other tables to reflect this
data manipulation operation.
4. Partition the BOOK table based on year of publication. Demonstrate its working
with a simple query.
5. Create a view of all books and its number of copies that are currently available
in the library

29 | P a g e Information Systems Management Lab File


30 | P a g e Information Systems Management Lab File
CREATING TABLES
CREATE TABLE PUBLISHER (
NAME VARCHAR(20) PRIMARY KEY,
ADDRESS VARCHAR(20),
PHONE FLOAT
);

CREATE TABLE BOOK (


BOOK_ID INT PRIMARY KEY,
TITLE CHAR(10),
PUBLISHER_NAME VARCHAR(20),
PUBLISHER_YEAR INT,
FOREIGN KEY (PUBLISHER_NAME) REFERENCES PUBLISHER
(NAME) ON DELETE CASCADE
);

CREATE TABLE LIBRARY_BRANCH (


BRANCH_ID INT PRIMARY KEY,
BRANCH_NAME CHAR(10),
ADDRESS VARCHAR(15)
);

CREATE TABLE BOOK_AUTHORS (


BOOK_ID INT,
AUTHOR_NAME CHAR(10),
FOREIGN KEY (BOOK_ID) REFERENCES BOOK (BOOK_ID) ON
DELETE CASCADE
);

31 | P a g e Information Systems Management Lab File


CREATE TABLE BOOK_LENDING (
BOOK_ID INT,
BRANCH_ID INT,
CARD_NO INT,
DATE_OUT DATE,
DUE_DATE DATE,
PRIMARY KEY (BOOK_ID, BRANCH_ID, CARD_NO),
FOREIGN KEY (BOOK_ID) REFERENCES BOOK (BOOK_ID) ON
DELETE CASCADE,
FOREIGN KEY (BRANCH_ID) REFERENCES LIBRARY_BRANCH
(BRANCH_ID) ON DELETE CASCADE
);

CREATE TABLE BOOK_COPIES (


BOOK_ID INT,
BRANCH_ID INT,
NO_OF_COPIES INT,
FOREIGN KEY (BOOK_ID) REFERENCES BOOK (BOOK_ID) ON
DELETE CASCADE,
FOREIGN KEY (BRANCH_ID) REFERENCES LIBRARY_BRANCH
(BRANCH_ID) ON DELETE CASCADE,
PRIMARY KEY (BOOK_ID, BRANCH_ID)
);

32 | P a g e Information Systems Management Lab File


33 | P a g e Information Systems Management Lab File
PUBLISHER

INSERT INTO PUBLISHER VALUES('ANUAMMUBOOKS',


'SRIRAMRKNAGAR', '8797546021');

INSERT INTO PUBLISHER VALUES('BHAVANISTORE',


'KARNATAKABAR', '9900778821');

INSERT INTO PUBLISHER VALUES('RAJBOOKSTALL', 'SATALLITE@12',


'9252459821');

INSERT INTO PUBLISHER VALUES('SNEHABANDHU', 'MANDYA123',


'9380577730');

INSERT INTO PUBLISHER VALUES('SPOO@SHBOOKS',


'NEARBEMLARCH', '8969361282');

INSERT INTO PUBLISHER VALUES('SRI SAI', 'DEVEGOWDANAHUNDI',


'7090454640');

34 | P a g e Information Systems Management Lab File


BOOK

INSERT INTO BOOK VALUES(100, 'OOMD', 'SRI SAI', 1996);

INSERT INTO BOOK VALUES(101, 'CMPTRNTWK', 'SNEHABANDHU',


1992);

INSERT INTO BOOK VALUES(102, 'AUTOMATA', 'RAJBOOKSTALL',


2000);

INSERT INTO BOOK VALUES(103, 'CSHARP', 'SPOO@ASHBOOKS', 2012);

INSERT INTO BOOK VALUES(104, 'MANAGEMENT', 'SRI SAI', 1996);

INSERT INTO BOOK VALUES(105, 'DATABASEMS', 'BHAVANISTORE',


1899);

35 | P a g e Information Systems Management Lab File


LIBRARY BRANCH

INSERT INTO LIBRARY_BRANCH VALUES(1000, 'BRANCH1',


'GROUNDFLOOR');

INSERT INTO LIBRARY_BRANCH VALUES(1001, 'BRANCH2',


'GFROWF');

INSERT INTO LIBRARY_BRANCH VALUES(1002, 'BRANCH1',


'LFTSIDEROW7');

INSERT INTO LIBRARY_BRANCH VALUES(1003, 'BRANCH3',


'RGHTSIDEROW7');

INSERT INTO LIBRARY_BRANCH VALUES(1004, 'BRANCH4',


'OPPOSITEFLOOR');

INSERT INTO LIBRARY_BRANCH VALUES(1005, 'BRANCH5',


'ECEFLOOR');

36 | P a g e Information Systems Management Lab File


BOOK_AUTHORS

INSERT INTO BOOK_AUTHORS VALUES(100, 'NAWATHI');

INSERT INTO BOOK_AUTHORS VALUES(100, 'NAWATHI');

INSERT INTO BOOK_AUTHORS VALUES(101, 'THRIPATI');

INSERT INTO BOOK_AUTHORS VALUES(102, 'PADMAREDDY');

INSERT INTO BOOK_AUTHORS VALUES(103, 'KRISHNA');

37 | P a g e Information Systems Management Lab File


BOOK_COPIES

INSERT INTO BOOK_COPIES VALUES(101, 1000, 3);

INSERT INTO BOOK_COPIES VALUES(100, 1004, 4);

INSERT INTO BOOK_COPIES VALUES(101, 1006, 2);

INSERT INTO BOOK_COPIES VALUES(103, 1003, 5);

INSERT INTO BOOK_COPIES VALUES(104, 1002, 5);

38 | P a g e Information Systems Management Lab File


BOOK_LENDING

INSERT INTO BOOK_LENDING VALUES(100, 1000, 50, '2017-01-03', '2017-


06-26');

INSERT INTO BOOK_LENDING VALUES(101, 1001, 50, '2017-01-26', '2017-


06-26');

INSERT INTO BOOK_LENDING VALUES(102, 1002, 50, '2017-01-15', '2017-


06-26');

INSERT INTO BOOK_LENDING VALUES(103, 1003, 50, '2018-01-26', '2018-


06-03');

INSERT INTO BOOK_LENDING VALUES(104, 1004, 54, '2017-01-03', '2017-


06-03');

39 | P a g e Information Systems Management Lab File


QUERY1

SELECT b.PUBLISHER_NAME, c.BRANCH_ID, b.TITLE,


a.AUTHOR_NAME, c.NO_OF_COPIES

FROM BOOK b

JOIN BOOK_COPIES c ON b.BOOK_ID = c.BOOK_ID

JOIN BOOK_AUTHORS a ON b.BOOK_ID = a.BOOK_ID;

40 | P a g e Information Systems Management Lab File


QUERY2

SELECT CARD_NO

FROM BOOK_LENDING

WHERE DATE_OUT BETWEEN '2017-01-03' AND '2017-06-26'

GROUP BY CARD_NO

HAVING COUNT(*) >= 3;

41 | P a g e Information Systems Management Lab File


QUERY3

DELETE FROM BOOK WHERE BOOK_ID = 100;

SELECT * FROM BOOK;

SELECT * FROM BOOK_COPIES;

42 | P a g e Information Systems Management Lab File


QUERY 4

CREATE VIEW P_YEAR AS

SELECT PUBLISHER_YEAR FROM BOOK GROUP BY


PUBLISHER_YEAR;

SELECT * FROM P_YEAR;

43 | P a g e Information Systems Management Lab File


QUERY5

CREATE VIEW CUR_AVAI AS

SELECT b.BOOK_ID, NO_OF_COPIES, TITLE

FROM BOOK_COPIES b

JOIN LIBRARY_BRANCH l ON b.BRANCH_ID = l.BRANCH_ID

JOIN BOOK c ON b.BOOK_ID = c.BOOK_ID;

go

SELECT * FROM CUR_AVAI;

44 | P a g e Information Systems Management Lab File


ORDER DATABASE

CONSIDER THE FOLLOWING SCHEMA FOR ORDER DATABASE:(create


all tables of each and run the query with the command and result adding the
screenshots of the tables created and also add table description command)
• SALESMAN(Salesman_id, Name, City, Commission)
• CUSTOMER(Customer_id, Cust_Name, City, Grade, Salesman_id)
• ORDERS(Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id)
Write SQL queries to
1. Count the customers with grades above Bangalore’s average.
2. Find the name and numbers of all salesmen who had more than one customer.
3. List all the salesman and indicate those who have and don’t have customers in
their cities (Use UNION operation.)
4. Create a view that finds the salesman who has the customer with the highest
order of a day.
5. Demonstrate the DELETE operation by removing salesman with id 1000. All
his orders must also be deleted.

45 | P a g e Information Systems Management Lab File


46 | P a g e Information Systems Management Lab File
CREATING TABLES
CREATE TABLE SALESMAN (
SALESMAN_ID INT PRIMARY KEY,
NAME CHAR(20),
CITY CHAR(20),
COMMISSION REAL
);

CREATE TABLE CUSTOMER (


CUSTOMER_ID INT PRIMARY KEY,
CUSTOMER_NAME CHAR(20),
CITY CHAR(20),
GRADE INT,
SALESMAN_ID INT,
FOREIGN KEY(SALESMAN_ID) REFERENCES
SALESMAN(SALESMAN_ID) ON DELETE SET NULL
);

CREATE TABLE ORDERS (


ORDER_NO INT PRIMARY KEY,
PURCHASE_AMOUNT REAL,
ORDER_DATE DATE,
CUSTOMER_ID INT,
FOREIGN KEY(CUSTOMER_ID) REFERENCES
CUSTOMER(CUSTOMER_ID),
SALESMAN_ID INT,
FOREIGN KEY(SALESMAN_ID) REFERENCES
SALESMAN(SALESMAN_ID) ON DELETE CASCADE
);

47 | P a g e Information Systems Management Lab File


48 | P a g e Information Systems Management Lab File
SALESMAN

INSERT INTO SALESMAN VALUES(1000, 'BHUVANESH K',


'BANGALORE', 12000);

INSERT INTO SALESMAN VALUES(1001, 'PRAGATHI', 'BANGALORE',


15000);

INSERT INTO SALESMAN VALUES(1002, 'VASUDEVAPRASAD',


'MANGALORE', 10000);

INSERT INTO SALESMAN VALUES(1003, 'GURUPRASADKONDI',


'MYSORE@123', 19000);

INSERT INTO SALESMAN VALUES(1004, 'SRISAI SALERS', 'MANDYA',


25000);

INSERT INTO SALESMAN VALUES(1005, 'BOOKTRIBUTERS',


'HANUMANTHNAGAR', 16200);

INSERT INTO SALESMAN VALUES(1006, 'SHOWROOMGALAXY',


'BIDAR',14900);

49 | P a g e Information Systems Management Lab File


CUSTOMER

INSERT INTO CUSTOMER VALUES(100, 'SPOORTHIASHWIN', 'BIDAR',


10, 1000);

INSERT INTO CUSTOMER VALUES(101, 'AMRUTHANUKASHYAP',


'MANGALORE', 8, 1000);

INSERT INTO CUSTOMER VALUES(102, 'RAJESHWARI', 'MANGALORE',


5, 1002);

INSERT INTO CUSTOMER VALUES(103, 'NISHAKGOWDA',


'MANGALORE', 9, 1001);

INSERT INTO CUSTOMER VALUES(104, 'SATHWIK', 'MANDYA', 10,


1004);

INSERT INTO CUSTOMER VALUES(105, 'GURUDEVANAYAK', 'BIDAR',


7, 1002);

INSERT INTO CUSTOMER VALUES(106, 'VASUMURTHI',


'MYSORE@123',9,1003);

50 | P a g e Information Systems Management Lab File


ORDERS

INSERT INTO ORDERS VALUES(10, 23000, '2019-09-17', 100, 1000);

INSERT INTO ORDERS VALUES(11, 26455, '2019-06-03', 102, 1001);

INSERT INTO ORDERS VALUES(12, 30002, '2019-01-03', 103, 1002);

INSERT INTO ORDERS VALUES(13, 17003, '2019-07-17', 105, 1003);

INSERT INTO ORDERS VALUES(14, 45255, '2019-05-13', 106, 1004);

INSERT INTO ORDERS VALUES(15, 32000, '2019-07-23', 101, 1000);

INSERT INTO ORDERS VALUES(16, 27000, '2019-05-23', 104, 1002);

INSERT INTO ORDERS VALUES(17, 26255, '2019-09-17', 104, 1000);

51 | P a g e Information Systems Management Lab File


QUERY1

SELECT COUNT(CUSTOMER_ID),GRADE

FROM CUSTOMER WHERE GRADE>=(SELECT AVG(GRADE) FROM


CUSTOMER WHERE CITY=”BANGLORE”)

GROUP BY GRADE;

52 | P a g e Information Systems Management Lab File


QUERY2

SELECT SALESMAN_ID, NAME

FROM SALESMAN

WHERE SALESMAN_ID IN (

SELECT SALESMAN_ID

FROM CUSTOMER

GROUP BY SALESMAN_ID

HAVING COUNT(CUSTOMER_ID) > 1

);

53 | P a g e Information Systems Management Lab File


QUERY3

SELECT s.SALESMAN_ID, s.NAME

FROM CUSTOMER c

JOIN SALESMAN s ON s.SALESMAN_ID = c.SALESMAN_ID AND s.CITY


= c.CITY

UNION

SELECT s.SALESMAN_ID, s.NAME

FROM CUSTOMER c

JOIN SALESMAN s ON s.SALESMAN_ID = c.SALESMAN_ID AND s.CITY


!=c.CITY;

54 | P a g e Information Systems Management Lab File


QUERY 4

CREATE VIEW SAL_MAX AS

SELECT s.SALESMAN_ID, s.NAME, c.ORDER_DATE

FROM SALESMAN s

JOIN ORDERS c ON c.SALESMAN_ID = s.SALESMAN_ID

WHEREc.PURCHASE_AMOUNT = (SELECT MAX(o.PURCHASE_AMOUNT)


FROM ORDERS o WHERE o.ORDER_DATE = c.ORDER_DATE);

SELECT * FROM SAL_MAX;

55 | P a g e Information Systems Management Lab File


QUERY5

DELETE FROM SALESMAN WHERE SALESMAN_ID=1000;

56 | P a g e Information Systems Management Lab File


MOVIE DATABASE

11) CONSIDER THE FOLLOWING SCHEMA For MOVIE DATABASE:


(create all tables of each and run the query with the command and result adding
the screenshots of the tables created and also add table description command)
• ACTOR(Act_id, Act_Name, Act_Gender)
• DIRECTOR(Dir_id, Dir_Name, Dir_Phone)
• MOVIES(Mov_id, Mov_Title, Mov_Year, Mov_Lang, Dir_id)
• MOVIE_CAST(Act_id, Mov_id, Role)
• RATING(Mov_id, Rev_Stars)
Write SQL queries to
1. List the titles of all movies directed by ‘Hitchcock’.
2. Find the movie names where one or more actors acted in two or more movies.
3. List all actors who acted in a movie before 2000 and in a movie after 2015 (use
JOIN operation).
4. Find the title of movies and number of stars for each movie that has at least one
rating and find the highest number of stars that movie received. Sort the result by
movie title.
5. Update rating of all movies directed by ‘Steven Spielberg’ to 5.

57 | P a g e Information Systems Management Lab File


58 | P a g e Information Systems Management Lab File
CREATING TABLES
CREATE TABLE ACTOR (
ACT_ID INT PRIMARY KEY,
ACT_NAME CHAR(20),
GENDER CHAR(6)
);

CREATE TABLE DIRECTOR (


DIR_ID INT PRIMARY KEY,
DIR_NAME CHAR(20),
DIR_PHONE REAL
);

CREATE TABLE MOVIES (


MOV_ID INT PRIMARY KEY,
MOV_TITLE VARCHAR(20), -- Corrected data type from VARCAHR to
VARCHAR
MOV_YEAR REAL,
MOV_LANG CHAR(10),
DIR_ID INT,
FOREIGN KEY (DIR_ID) REFERENCES DIRECTOR(DIR_ID)
);

59 | P a g e Information Systems Management Lab File


CREATE TABLE MOVIE_CAST (
ACT_ID INT,
MOV_ID INT,
ROLE CHAR(15),
PRIMARY KEY (ACT_ID, MOV_ID),
FOREIGN KEY (ACT_ID) REFERENCES ACTOR(ACT_ID),
FOREIGN KEY (MOV_ID) REFERENCES MOVIES(MOV_ID)
);

CREATE TABLE RATING (


MOV_ID INT,
REV_STARS INT,
FOREIGN KEY (MOV_ID) REFERENCES MOVIES(MOV_ID)
);

60 | P a g e Information Systems Management Lab File


ACTOR

INSERT INTO ACTOR VALUES(100, 'PUNITHRAJKUMAR', 'MALE');

INSERT INTO ACTOR VALUES(101, 'RAKSHITHAPREM', 'FEMALE');

INSERT INTO ACTOR VALUES(102, 'CHIKKANNA', 'MALE');

INSERT INTO ACTOR VALUES(103, 'SHARAN', 'MALE');

INSERT INTO ACTOR VALUES(104, 'SADHUKOKILA', 'MALE');

INSERT INTO ACTOR VALUES(105, 'MANJULA', 'FEMALE');

61 | P a g e Information Systems Management Lab File


DIRECTOR

INSERT INTO DIRECTOR VALUES(10, 'HITCHCOCK', 9933221144);

INSERT INTO DIRECTOR VALUES(11, 'STEVEN SPIELBERG',


9876541234);

INSERT INTO DIRECTOR VALUES(12, 'PAVANVODEYAR', 9632587410);

INSERT INTO DIRECTOR VALUES(13, 'YOGRAJBHAT', 7412589630);

INSERT INTO DIRECTOR VALUES(14, 'S NARAYAN', 8521479630);

INSERT INTO DIRECTOR VALUES(15, 'UPENDRA', 9631478520);

62 | P a g e Information Systems Management Lab File


MOVIES

INSERT INTO MOVIES VALUES(50, 'RAJAKUMARA', 2016, 'KANNADA',


12);

INSERT INTO MOVIES VALUES(51, '50SHADESOFGREY', 2018,


'ENGLISH', 10);

INSERT INTO MOVIES VALUES(52, 'KANJURING', 1999, 'ENGLISH', 11);

INSERT INTO MOVIES VALUES(53, 'HEARTATTACK', 1999, 'TELUGU',


10);

INSERT INTO MOVIES VALUES(54, 'ILUVU', 2019, 'KANNADA', 15);

INSERT INTO MOVIES VALUES(55, 'HALUJENU', 1998, 'KANNADA', 14);

63 | P a g e Information Systems Management Lab File


MOVIE_CAST

INSERT INTO MOVIE_CAST VALUES(101, 52, 'HEROIN');

INSERT INTO MOVIE_CAST VALUES(102, 50, 'COMEDIAN');

INSERT INTO MOVIE_CAST VALUES(102, 51, 'SIDEACTOR');

INSERT INTO MOVIE_CAST VALUES(102, 54, 'COMEDIAN');

INSERT INTO MOVIE_CAST VALUES(103, 50, 'GUESTROLE');

INSERT INTO MOVIE_CAST VALUES(103, 53, 'HERO');

INSERT INTO MOVIE_CAST VALUES(104, 50, 'COMEDIAN');

INSERT INTO MOVIE_CAST VALUES(104, 55, 'COMEDIAN');

64 | P a g e Information Systems Management Lab File


RATING

INSERT INTO RATING VALUES(50, 5);

INSERT INTO RATING VALUES(50, 5);

INSERT INTO RATING VALUES(51, 5);

INSERT INTO RATING VALUES(55, 5);

INSERT INTO RATING VALUES(52, 4);

INSERT INTO RATING VALUES(53, 5);

INSERT INTO RATING VALUES(54, 3);

INSERT INTO RATING VALUES(50, 4);

INSERT INTO RATING VALUES(50, 2);

65 | P a g e Information Systems Management Lab File


QUERY1

SELECT MOV_TITLE

FROM DIRECTOR d

JOIN MOVIES m ON d.DIR_ID = m.DIR_ID

WHERE d.DIR_NAME = 'HITCHCOCK';

66 | P a g e Information Systems Management Lab File


QUERY2

SELECT m.MOV_TITLE

FROM MOVIES m

JOIN MOVIE_CAST v ON m.MOV_ID = v.MOV_ID

WHERE v.ACT_ID IN (SELECT ACT_ID FROM MOVIE_CAST GROUP BY


ACT_ID HAVING COUNT(*) > 1)

GROUP BY m.MOV_TITLE

HAVING COUNT(*) > 1;

67 | P a g e Information Systems Management Lab File


QUERY3

SELECT a.ACT_ID

FROM ACTOR a

JOIN MOVIE_CAST c ON a.ACT_ID = c.ACT_ID

JOIN MOVIES m ON m.MOV_ID = c.MOV_ID

WHERE m.MOV_YEAR < 2000

AND a.ACT_ID IN (

SELECT b.ACT_ID

FROM ACTOR b

JOIN MOVIE_CAST d ON b.ACT_ID = d.ACT_ID

JOIN MOVIES n ON n.MOV_ID = d.MOV_ID

WHERE n.MOV_YEAR > 2015

);

68 | P a g e Information Systems Management Lab File


QUERY 4

SELECT m.MOV_TITLE, MAX(r.REV_STARS) AS MaxRating

FROM MOVIES m

JOIN RATING r ON m.MOV_ID = r.MOV_ID

GROUP BY m.MOV_TITLE

HAVING MAX(r.REV_STARS) > 0

ORDER BY m.MOV_TITLE;

69 | P a g e Information Systems Management Lab File


QUERY5

UPDATE RATING

SET REV_STARS = 5

FROM RATING r

JOIN MOVIES m ON r.MOV_ID = m.MOV_ID

JOIN DIRECTOR d ON m.DIR_ID = d.DIR_ID

WHERE d.DIR_NAME = 'STEVEN SPIELBERG';

70 | P a g e Information Systems Management Lab File


MINI PROJECT

• For any problem selected, write the ER Diagram, apply ER-mapping rules,
normalize the relations, and follow the application development process.
• Make sure that the application should have five or more tables, at least.
• Indicative areas include health care, education, industry, transport, supply
chain, etc

SOLUTION

Problem Selected: XYZ hospital is a multi specialty hospital that includes a number
of departments, rooms, doctors, nurses, compounders, and other staff working in
the hospital. Patients having different kinds of ailments come to the hospital and
get checkup done from the concerned doctors. If required they are admitted in the
hospital and discharged after treatment.
design and develop a database for the hospital to maintain the records of various
departments, rooms, and doctors in the hospital. It also maintains records of the
regular patients, patients admitted in the hospital, the check up of patients done
by the doctors, the patients that have been operated, and patients discharged from
the hospital.

Description: In hospital, there are many departments like Orthopedic, Pathology,


Emergency, Dental, Gynecology, Anesthetics, I.C.U., Blood Bank, Operation
Theater, Laboratory, M.R.I., Neurology, Cardiology, Cancer Department, Corpse,
etc. There is an OPD where patients come and get a card (that is, entry card of the
patient) for check up from the concerned doctor. After making entry in the card,
they go to the concerned doctor’s room and the doctor checks up their ailments.
According to the ailments, the doctor either prescribes medicine or admits the
patient in the concerned department. The patient may choose either private or
general room according to his/her need. But before getting admission in the
hospital, the patient has to fulfill certain formalities of the hospital like room
charges, etc. After the treatment is completed, the doctor discharges the patient.
71 | P a g e Information Systems Management Lab File
Before discharging from the hospital, the patient again has to complete certain
formalities of the hospital like balance charges, test charges, operation charges (if
any), blood charges, doctors’ charges, etc. Next we talk about the doctors of the
hospital. There are two types of the doctors in the hospital, namely, regular doctors
and call on doctors. Regular doctors are those doctors who come to the hospital
daily. Calls on doctors are those doctors who are called by the hospital if the
concerned doctor is not available.

Table Description: Following are the tables along with constraints used in Hospital
Management database.

1. DEPARTMENT: This table consists of details about the various departments in


the hospital. The information stored in this table includes department name,
department location, and facilities available in that department.
Constraint: Department name will be unique for each department.
2. ALL_DOCTORS: This table stores information about all the doctors working for
the hospital and the departments they are associated with. Each doctor is given an
identity number starting with DR or DC prefixes only.
Constraint: Identity number is unique for each doctor and the corresponding
department should exist in DEPARTMENT table.
3. DOC_REG: This table stores details of regular doctors working in the hospital.
Doctors are referred to by their doctor number. This table also stores personal
details of doctors like name, qualification, address, phone number, salary, date of
joining, etc.
Constraint: Doctor’s number entered should contain DR only as a prefix and must
exist in ALL_DOCTORS table.
4. DOC_ON_CALL: This table stores details of doctors called by hospital when
additional doctors are required. Doctors are referred to by their doctor number.
Other personal details like name, qualification, fees per call, payment due, address,
phone number, etc., are also stored.
Constraint: Doctor’s number entered should contain DC only as a prefix and must
exist in ALL_DOCTORS table.

72 | P a g e Information Systems Management Lab File


5. PAT_ENTRY: The record in this table is created when any patient arrives in the
hospital for a check up. When patient arrives, a patient number is generated which
acts as a primary key. Other details like name, age, sex, address, city, phone
number, entry date, name of the doctor referred to, diagnosis, and department
name are also stored. After storing the necessary details patient is sent to the
doctor for check up.
Constraint: Patient number should begin with prefix PT. Sex should be M or F only.
Doctor’s name and department referred must exist.
6. PAT_CHKUP: This table stores the details about the patients who get treatment
from the doctor referred to. Details like patient number from patient entry table,
doctor number, date of check up, diagnosis, and treatment are stored. One more
field status is used to indicate whether patient is admitted, referred for operation
or is a regular patient to the hospital. If patient is admitted, further details are
stored in PAT_ADMIT table. If patient is referred for operation, the further details
are stored in PAT_OPR table and if patient is a regular patient to the hospital, the
further details are stored in PAT_REG table.
Constraint: Patient number should exist in PAT_ENTRY table and it should be
unique.
7. PAT_ADMIT: When patient is admitted, his/her related details are stored in this
table. Information stored includes patient number, advance payment, mode of
payment, room number, department, date of admission, initial condition,
diagnosis, treatment, number of the doctor under whom treatment is done,
attendant name, etc.
Constraint: Patient number should exist in PAT_ENTRY table. Department, doctor
number, room number must be valid.
8. PAT_DIS: An entry is made in this table whenever a patient gets discharged from
the hospital. Each entry includes details like patient number, treatment given,
treatment advice, payment made, mode of payment, date of discharge, etc.
Constraint: Patient number should exist in PAT_ENTRY table.
9. PAT_REG: Details of regular patients are stored in this table. Information stored
includes date of visit, diagnosis, treatment, medicine recommended, status of
treatment, etc.
Constraint: Patient number should exist in patient entry table. There can be
73 | P a g e Information Systems Management Lab File
multiple entries of one patient as patient might be visiting hospital repeatedly for
check up and there will be entry for patient’s each visit.

10. PAT_OPR: If patient is operated in the hospital, his/her details are stored in this
table. Information stored includes patient number, date of admission, date of
operation, number of the doctor who conducted the operation, number of the
operation theater in which operation was carried out, type of operation, patient’s
condition before and after operation, treatment advice, etc.
Constraint: Patient number should exist in PAT_ENTRY table. Department, doctor
number should exist or should be valid.
11. ROOM_DETAILS: It contains details of all rooms in the hospital. The details
stored in this table include room number, room type (general or private), status
(whether occupied or not), if occupied, then patient number, patient name,
charges per day, etc.
Constraint: Room number should be unique. Room type can only be G or P and
status can only be Y or N

74 | P a g e Information Systems Management Lab File


75 | P a g e Information Systems Management Lab File
The relational database schema for Hospital Management database is as follows:
1. DEPARTMENT (D_NAME, D_LOCATION, FACILITIES)
2. ALL_DOCTORS (DOC_NO, DEPARTMENT)
3. DOC_REG(DOC_NO, D_NAME, QUALIFICATION, SALARY, EN_TIME, EX_TIME,
ADDRESS, PH_NO, DOJ)
4. DOC_ON_CALL (DOC_NO, D_NAME, QUALIFICATION, FS_PR_CL, PYMT_DU,
ADDRESS, PH_NO)
5. PAT_ENTRY (PAT_NO, PAT_NAME, CHKUP_DT, PT_AGE, SEX, RFRG_CSTNT,
DIAGNOSIS, RFD, ADDRESS, CITY, PH_NO, DEPARTMENT)
6. PAT_CHKUP (PAT_NO, DOC_NO, DIAGNOSIS, STATUS, TREATMENT)
7. PAT_ADMIT (PAT_NO, ADV_PYMT, MODE_PYMT, ROOM_NO, DEPTNAME,
ADMTD_ON, COND_ON, INVSTGTN_DN, TRMT_SDT, ATTDNT_NM)
8. PAT_DIS (PAT_NO, TR_ADVS, TR_GVN, MEDICINES, PYMT_GV, DIS_ON)
9. PAT_REG (PAT_NO, DATE_VIS, CONDITION, TREATMENT, MEDICINES, DOC_NO,
PAYMT)
10. PAT_OPR (PAT_NO, DATE_OPR, IN_COND, AFOP_COND, TY_OPERATION,
MEDICINES, DOC_NO, OPTH_NO, OTHER_SUG)
11. ROOM_DETAILS (ROOM_NO, TYPE, STATUS, RM_DL_CRG, OTHER_CRG)
Normalization of Relations in the Hospital Management Database
Following the provided schema, here's the normalization process for each relation:
1. DEPARTMENT:
• This relation is already in 1st Normal Form (1NF) because there are no
repeating groups.
2. ALL_DOCTORS:
• This relation is redundant and unnecessary. It can be merged with DOC_REG
to create a single table with all doctor information.
3. DOC_REG:
• This relation is in 1NF but could be further normalized.

• The attribute "D_NAME" can be removed and replaced with a foreign key
referencing the "D_NAME" attribute in the DEPARTMENT table. This
eliminates redundancy and ensures data integrity.
• The remaining attributes are all dependent on the primary key "DOC_NO" and
are in 2nd Normal Form (2NF).
76 | P a g e Information Systems Management Lab File
4. DOC_ON_CALL:
• Similar to ALL_DOCTORS, this relation is redundant and can be merged with
DOC_REG.
• Additional attributes like "FS_PR_CL" and "PYMT_DU" can be added to
DOC_REG to accommodate on-call specific information.
5. PAT_ENTRY:
• This relation needs further normalization:

• The attribute "RFD" should be removed as it's likely dependent on the


"PAT_NO" and can be stored in PAT_REG.
• The attribute "DEPARTMENT" can be replaced with a foreign key referencing
"D_NAME" in the DEPARTMENT table, improving data integrity.
• The remaining attributes are all dependent on the primary key "PAT_NO" and
are in 2NF.
6. PAT_CHKUP:
• This relation is in 1NF and 2NF.

7. PAT_ADMIT:
• This relation is in 1NF but can be further normalized:

• The attribute "DEPTNAME" can be replaced with a foreign key referencing


"D_NAME" in the DEPARTMENT table.
• The remaining attributes are dependent on the primary key "PAT_NO" and are
in 2NF.
8. PAT_DIS:
• This relation is in 1NF and 2NF.

9. PAT_REG:
• This relation needs further normalization:

• The attribute "CONDITION" might be redundant if already captured in


PAT_CHKUP or PAT_OPR.
• The attribute "MEDICINES" might be better suited in a separate table linked
to patient visits.
• The remaining attributes are dependent on the primary key "PAT_NO" and are
in 2NF.

77 | P a g e Information Systems Management Lab File


10. PAT_OPR:
• This relation is in 1NF and 2NF.

11. ROOM_DETAILS:
• This relation is in 1NF and 2NF.

Normalized Tables:
1. DEPARTMENT: (D_NAME, D_LOCATION, FACILITIES)
2. DOC_REG: (DOC_NO, D_NAME, QUALIFICATION, SALARY, EN_TI
ME, EX_TIME, ADDRESS, PH_NO, DOJ, FS_PR_CL, PYMT_DU)
3. PAT_ENTRY: (PAT_NO, PAT_NAME, CHKUP_DT, PT_AGE, SEX, DIA
GNOSIS, ADDRESS, CITY, PH_NO)
4. PAT_CHKUP: (PAT_NO, DOC_NO, DIAGNOSIS, STATUS, TREATME
NT)
5. PAT_ADMIT: (PAT_NO, ADV_PYMT, MODE_PYMT, ROOM_NO, AD
MTD_ON, COND_ON, INVSTGTN_DN, TRMT_SDT, ATTDNT_NM)
6. PAT_DIS: (PAT_NO, TR_ADVS, TR_GVN, PYMT_GV, DIS_ON)
7. PAT_MEDICINES: (PAT_NO, DATE_VIS, MEDICINES) (New table)
8. PAT_OPR: (PAT_NO, DATE_OPR, IN_COND, AFOP_COND, TY_OPER
ATION, DOC_NO, OPTH_NO, OTHER_SUG)
9. ROOM_DETAILS: (ROOM_NO, TYPE, STATUS, RM_DL_CRG, OTHER
_CRG)

78 | P a g e Information Systems Management Lab File


79 | P a g e Information Systems Management Lab File
IT Application in Business Lab File

You might also like