0% found this document useful (0 votes)
4 views15 pages

DBMS.MINI.PROJECT.M

The document is a mini project report on a Company Database Management System submitted by Mohammed Owais as part of a Bachelor of Engineering program in Artificial Intelligence and Data Science. It outlines the structure and functionality of a database management system (DBMS), including the creation of tables, data insertion, and SQL queries. The report includes detailed examples of SQL commands and the organization of various database tables such as Employee, Department, and Project.

Uploaded by

felaho9758
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views15 pages

DBMS.MINI.PROJECT.M

The document is a mini project report on a Company Database Management System submitted by Mohammed Owais as part of a Bachelor of Engineering program in Artificial Intelligence and Data Science. It outlines the structure and functionality of a database management system (DBMS), including the creation of tables, data insertion, and SQL queries. The report includes detailed examples of SQL commands and the organization of various database tables such as Employee, Department, and Project.

Uploaded by

felaho9758
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

“Jnana Sangama”, Belagavi, Karnataka– 590 018

A mini project Report


on

“COMPANY DATABASE MANAGEMENT SYSTEM”


BACHELOR OF ENGINEERING
IN
ARTIFICIAL INTELLIGENCE AND DATA SCIENCE

Submitted by
NAME :MOHAMMED OWAIS USN:4CI22AD021

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND DATA SCIENCE


Kodava Education Society®
COORG INSTITUTE OF TECHNOLOGY
(Accredited by NAAC ‘A’ grade, approved by the AICTE, New Delhi & Affiliated to VTU, Belagavi)
Ponnampet-571216

2023-24
ABSTRACT

Database management system is a system is a computer software program that is


designed as the means of managing all databases that are currently installed on a
system hard drive or network. Different types of database management systems
exist, with some of them designed for the oversight and proper control of databases
that are configured for specific purposes. Here are some examples of the various
incarnations of DBMS technology that are currently in use, and some of the basic
elements that are part of DBMS software applications.

A database management system (DBMS) is a software package with computer


programs that control the creation, maintenance, and use of a database. It allows
organizations to conveniently develop databases for various applications by
database administrators (DBAs) and other specialists. Information retrieval
emerged as independent research area from traditional database management
system more than a decade ago. This was driven by the increasing functional
requirements that modern full text search engines have to meet. Current database
management systems (DBMS) are not capable of supporting such flexibility.
However, with the increase of data to be indexed and retrieved and the increasing
heavy workloads, modern search engines suffer from Scalability, reliability,
distribution and performance problems. We present a new and simple way for
integration and compare the performance of our system to the current
implementations based on storing the full text index directly on the file system.

i
TABLE OF CONTENTS

ABSTRACT i

LIST OF TABLES iii

CHAPTER NO CHAPTER NAME PAGE NO

CHAPTER 1 CREATION OF TABLES 1-2

CHAPTER 2 INSERTION OF DATA 3-6

CHAPTER 3 LIST OF THE TABLES 7-9

CHAPTER 4 SQL QUERIES 10-12

REFERENCES NAVATHE TEXT BOOK

ii
LIST OF FIGURES

Table No. Description Page No.

3.1 EMPLOYEE TABLE 7

3.2 DEPARTMENT TABLE 7

3.3 DEPARTMENT LOCATION TABLE 8

3.4 DEPENDENT TABLE 8

3.5 PROJECT TABLE 9

3.6 WORKS ON TABLE 9

4.1 QUERY-1 10

4.2 QUERY-2 10

4.3 QUERY-3 11

4.4 QUERY-4 11

4.5 QUERY-5 12

iii
CHAPTER-1
CREATION OF TABLES

CREATE TABLE EMPL (


Name VARCHAR(50),
SSN NUMBER(5) PRIMARY KEY,
Salary DECIMAL(10, 2),
SuperSSN NUMBER(9),
Dno NUMBER(2)
);

CREATE TABLE DEPTL(


Dnum INT PRIMARY KEY,
Dname VARCHAR(50),
MgrSSN NUMBER(9),
Dno NUMBER(2),
FOREIGN KEY (MgrSSN) REFERENCES EMP23(SSN)
);

CREATE TABLE DEPT_LOC (


Dnum INT,
Dlocation VARCHAR(50),
PRIMARY KEY (Dnum, Dlocation),
FOREIGN KEY (Dnum) REFERENCES DEPT23(Dnum)
;

CREATE TABLE DEPENDENT (


ESSN NUMBER(9),
Dep_name VARCHAR(50),
Gender CHAR(1),
PRIMARY KEY (ESSN, Dep_name),
FOREIGN KEY (ESSN) REFERENCES EMP23(SSN)
);

1
CREATE TABLE PROJECT (
Pname VARCHAR(50),
Pnumber INT PRIMARY KEY,
Plocation VARCHAR(50),
Dnum INT,
FOREIGN KEY (Dnum) REFERENCES DEPT23(Dnum)
);

CREATE TABLE WORKS_ON (


ESSN NUMBER(9),
Pno INT,
Hours DECIMAL(4, 1),
PRIMARY KEY (ESSN, Pno),
FOREIGN KEY (ESSN) REFERENCES EMP23(SSN),
FOREIGN KEY (Pno) REFERENCES PROJECT23(Pnumber)
);

2
CHAPTER :1 '65432', 1),

1. INSERTION
('zubeir', OF2),DATA
'45678', 9000, '45678',
EMP: (‘sohil', '56789', 7800, '56789', 3),
INSERT INTO EMP (Name, SSN, Salary,
'67890',SuperSSN, Dno)4),VALUES
 EMP: ('suman', 6000, '67890',
('owais', '44567', 6500, '65432', 1), '78901', 5500, '78901', 5),
('shetal',
INSERT
('zubeir',
INTO EMP '45678', 9000, '45678', 2),'89012', 8500, '89012', 1),
('parlie',
(‘sohil', '56789', 7800, '56789', 3),
('deeksha', '90123', 9000, '45678', 2),
(Name,SSN,Sa
('suman', '67890', 6000, '67890', 4), '61234', 5500, '56789', 3),
('khabib',
lary,
SuperSSN,
('shetal', '78901', 5500, '78901',
('tina',5),
'12345', 6000, '67890', 4),
Dno)
('parlie', '89012', 8500, '89012', 1),'23456', 7200, '78901', 5);
('Aditi',
VALUES
('deeksha', '90123', 9000, '45678', 2),
('owais',
('khabib', '61234', 5500, '56789', 3),
'44567', 6500,
('tina', '12345', 6000, '67890', 4),

('Aditi', '23456', 7200, '78901', 5);

DEPT:

INSERT INTO DEPT (Dnum, Dname, MgrSSN, Dno) VALUES


(1, 'Research', '44567', 1),
(2, 'Development', '45678', 2),
(3, 'Sales', '56789', 3),
(4, 'HR', '67890', 4),
(5, 'Marketing', '78901', 5),
(6, 'Finance', '90123', 1),
(7, 'IT', '61234', 2),
(8, 'Support', '12345', 3),
(9, 'Operations', '23456', 4),
(10, 'Logistics', '34567', 5);

3
DEPT_LOC:

INSERT INTO DEPT_LOC (Dnum, Dlocation) VALUES


(1, 'New delhi'),
(2, 'Lucknow'),
(3, 'Chandigarh'),
(4, 'Hunsur'),
(5, 'Spain'),
(6, 'Bihar'),
(7, 'Sudan'),
(8, 'Denmark'),
(9, 'Mysore'),
(10, 'America');

DEPENDENT:

INSERT INTO DEPENDENT (ESSN, Dep_name, Gender) VALUES


('44567', 'Research', 'M'),
('45678', 'Development', 'M'),
('56789', 'Sales', 'M'),
('67890', 'HR', 'F'),
('78901', 'Marketing', 'F'),
('89012', 'Finance', 'M'),
('90123', 'IT', 'F'),
('61234', 'Support', 'M'),
('12345', 'Operations', 'F'),
('23456', 'Logistics', 'F');

PROJECT:

INSERT INTO PROJECT (Pname, Pnumber, Plocation, Dnum) VALUES


('ProjectX', 1, 'New delhi', 1),
('ProjectY', 2, 'Lucknow', 2),
('ProjectZ', 3, 'Chandigarh', 3),
('ProjectC', 4, 'Hunsur', 4),

4
('ProjectP', 5, 'Spain', 5),
('ProjectA', 6, 'Bihar', 6),
('ProjectD', 7, 'Sudan', 7),
('ProjectT', 8, 'Denmark', 8),
('ProjectO', 9, 'Mysore', 9),
('ProjectL', 10, 'America', 10);

 WORKS_ON:

INSERT INTO WORKS_ON (ESSN, Pno, Hours) VALUES


('44567', 1, 20),
('45678', 2, 25),
('56789', 3, 30),
('67890', 4, 35),
('78901', 5, 40),
('90123', 6, 45),
('61234', 7, 50),
('12345', 8, 55),
('23456', 9, 60),
('34567', 10, 65);

6
CHAPTER 3

LIST OF THE TABLES

 SELECT * FROM EMPL

Table-3.1EmployeeTable

SELECT * FROM DEPTL

Table-3.2DepartmentTable

7
 SELECT * FROM DEPT_LOC

Table-3.3 Department location Table

SELECT * FROM DEPENDENT

Table-3.4 Dependent Table

8
SELECT * FROM PROJECT

Table-3.5Project Table

SELECT * FROM WORKS_ON

Table-3.6Works_On Table

9
CHAPTER 4

SQL QUERIES

1) SELECT E1.Name
SELECT E1.Name, E1.SSN
FROM EMP23 E1
FROM EMPL E1, EMPL E2
JOIN EMP23 E2
ONWHERE
E1.Dno =E2.Name
E2.Dno = 'owais'
AND E1.Dno
WHERE E2.Name= ='Ravi'
E2.Dno;AND E1.Name != 'Ravi';

OUTPUT:

Query-4.1

2) SELECT
SELECTCOUNT(*)
D.Dname, D.Dnum

FROM
FROM EMPL E
DEPT23
JOIN DEPTL
WHERE D ON
mgrSSN E.Dno = D.Dnum
=(SELECT SSN FROM EMP23 WHERE Name = 'John B Smith');
WHERE E.Name = 'zubeir';

OUTPUT:

Query-4.2

3) SELECT E1.Name

FROM EMP23 E1

10
JOIN DEPT23 D ON E1.SSN = D.MgrSSN
3. SELECT E.Name
WHERE
FROM D.Dno
EMPL E IN (SELECT Dnum FROM DEPT_LOC23 WHERE Dlocation =
JOIN DEPTL
'Houston') D ON E.SSN = D.MgrSSN
JOIN DEPT_LOC DL ON D.Dnum = DL.Dnum
WHERE
AND NOT DL.Dlocation
EXISTS ( = 'Hunsur'
AND E.SSN NOT IN (
SELECT ESSN SELECT 1
FROM DEPENDENT
FROM DEPENDENT23 E2
WHERE Gender = 'Female'
); WHERE E1.SSN = E1.SSN AND E2.Gender = 'F'
OUTPUT: );

Query-4.3

4) SELECT Name
SELECT E.Name
FROM EMPL E
FROM EMP23
WHERE E.Dno = 5
AND
WHERE Dno => 55000
E.Salary AND Salary > 5000 AND SSN IN (
AND E.SSN IN (
SELECTESSN
SELECT ESSN
FROM DEPENDENT
FROM
WHEREDEPENDENT23
Gender = 'Female'
);WHERE Gender = 'F'

OUTPUT:);

Query-4.4

5) SELECT *

FROM DEPTL

11
WHERE Dname = 'Research';

OUTPUT:

Query-4.5

12

You might also like