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

MINI INTERNSHIP PROJECT

TOPIC : Restaurant Management System


22DBCAG131 Rishi P
22DBCAG132 Rishikesh Krishna
22DBCAG133 Rithick Sharma K
22DBCAG134 Rohit Singh Yadav

AIM ::
TO CREATE A DATABASE ON RESTAURANT MANAGEMENT
SYSTEM

DESIGN AND CONSTRUCT DATA MODEL WITH THEIR PARENT


AND FORIEGN KEY :
ENTITIES, ATTRIBUTES AND RELATIONSHIPS

1) ENTITIES

WHAT IS AN ENTITY?
Database entity is a thing, person, place, unit, object or any item about which the data should be captured and
stored in the form of properties, workflow and tables.
Example : customer, car.
ENTITIES USED HERE IN THE PROJECT :
INSURER, POLICY, PAYMENT, DISABILITY AND OFFERS.

2) ATTRIBUTES

WHAT IS AN ATTRIBUTE?
Attributes are the properties which describe an entity.
Example : customer_id, car_regno.

ATTRIBUTE USED HERE IN THE PROJECT :


INS_NAME, INS_ID, DISABILITY_ID, DISABILITY_TYPE, POL_ID,
EXP_DATE,DISCOUNT, PAYDATE AND AMOUNT.

3) RELATIONSHIPS

WHAT IS RELATIONSHIP?
A relationship, in the context of databases, is a situation that exists between two
relational database tables when one table has a foreign key that references the primary
key of the other table.
Example : enrolled in, owns car.

RELATIONSHIPS USED HERE IN THE PROJECT :


TYPE OF POLICY ENROLLED, TYPE OF DISABILITY, OFFERS OFFERED

ER DIAGRAM FOR THE DATABASE


OF DISABILITY INSURANCE :
CREATING TABLE:
create table table_name(column1,column2,....., column n,
primary key);

1) create table disability(disability_type varchar(20),disability_id varchar(20)


primary key);
2) create table insurer(ins_id varchar(10) primary key,ins_name
varchar(20),disability_id varchar(20) references disability(disability_id));

3) create table policy(pol_id varchar(5), exp_date date, disability_id


references disability(disability_id) ;

4) create table payment(paydate date,amount number(10),ins_id varchar(20)


references insurer(ins_id),diability_id references disability(disability_id));
5) create table offers(discount number(10),disability_id varchar(20)
references disability(disability_id),phone number(10));

INSERTING VALUES INTO TABLES


Insert into table_name values(column 1,column 2,..column n);

1) insert into disability values(disability_type,disability_id);

2) insert into insurer values( ins_id varchar(20) primary key, ins_name varchar(20),
disability_id references disability(disability_id));
3) insert into offers values( discount, disability_id, phone);

4) insert into payment values( paydate amount, ins_id, disability_id);

5) insert into policy values(pol_id, exp_date, disability_id);


CLAUSES :
1) WHERE clause :
Select * from payment where paydate=’10-NOV-2021’;

2) ORDER BY clause :
select * from offers order by disability_id;
3) GROUP BY clause :
Select count(pol_id) from policy group by exp_date;

AGGREGATE FUNCTIONS :
1) SUM
select sum(amount) as TOTAL from payment;

2) AVG select avg(amount) from payment ;


3) MAX
Select max(amount) as largest_amount from payment;

4) MIN
Select min(amount) as smallest_amount from payment;

UPDATE AND ALTER

1) Update
update disability set disability_type='physical disability' where
disability_id='DIS001';
2) ALTER
Alter table disability add blood varchar(5);

NESTED queries
Select disability_type from disability where disability_id IN(select disability_id
from offers where discount=’%5’);

You might also like