Professional Documents
Culture Documents
Rishikesh
Rishikesh
AIM ::
TO CREATE A DATABASE ON RESTAURANT MANAGEMENT
SYSTEM
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.
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.
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);
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;
4) MIN
Select min(amount) as smallest_amount from payment;
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’);