GEOPOLITICAL
GEOPOLITICAL
DATABASE
Project
INT306
1. Declaration
2. Acknowledgement
3. Introduction
4. ER-Diagram
5. Normalization
6. Command uses in this project
7. Table Creation
8. PL\SQL Queries
9. Conclusion
Declaration
I hereby declare that the Project work entitled
“ GEOPOLITICAL DATABASE ” submitted to
School of Computer Science, Lovely Professional
University, Phagwara, Punjab is prepared by me.
All the coding and Implementation of the coding
performed are the results of my personal efforts.
ABHISHEK KUMAR
12115093
K21QT
RK21QTA36
Acknowledgement
ABHISHEK KUMAR
12115093
K21QT
RK21QTA36
INTRODUCTION
ENTITY: -
ATTRIBUTE: -
Relationship:-
MULTIVALUED ATTRIBUTES:-
ER DIAGRAM:-
*Normalization: -
• Normalization is a method to remove anomalies and bring
the database to a consistent state.
• First Normal Form - As per First Normal Form, no two Rows of
data must contain repeating group of information.
• Second Normal Form - No non-prime attribute is dependent on the
proper subset of any candidate key of the table.
• Third Normal Form - Transitive functional dependency of non-
prime attribute on any super key should be removed.
• In other words 3NF can be explained like ts: A table is in 3NF if it
is in 2NF and for each functional dependency X-> Y at least one of
the following conditions hold: X is a super key of table and Y is a
prime attribute of table
● Boyce-Codd Normal Form - It is an advance version of 3NF
that's why it is also referred as 3.5NF. BCNF is stricter than 3NF. A
table complies with BCNF if it is in 3NF and for every functional
dependency X->Y, X should be the super key of the table.
Functional dependencies: -
Functional dependency (FD) is a set c constraints between two
attributes in a relation. Functional dependency says that if two tuples
have same values for attributes A1, A2,..., An, then those two tuples
must have same values for attributes B1, B2, ..., Bn.
Various commands used in the project are:-
SELECT: This statement is used to select data from a
database. The data returned is stored in a result table,
called the result set.
Insertion in table
Insert into GeopoliticalDB1 VALUES('994','Asia','Azerbaijan','Baku');
Insert into GeopoliticalDB1 VALUES('374','Asia','Armenia','Yerevan');
Insert into GeopoliticalDB1 VALUES('93','Asia','Afghanistan','Kabul');
Insert into GeopoliticalDB1 VALUES('973','Asia','Bahrain','Manama');
Insert into GeopoliticalDB1 VALUES('880','Asia','Bangladesh','Dhaka');
Insert into GeopoliticalDB1 VALUES('975','Asia','Bhutan','Thimphu');
Insert into GeopoliticalDB1 VALUES('673','Asia','Brunei','Bandar Seri Begawan');
Insert into GeopoliticalDB1 VALUES('855','Asia','Cambodia','Phnom Penh');
Insert into GeopoliticalDB1 VALUES('86','Asia','China','Beijing');
Insert into GeopoliticalDB1 VALUES('995','Asia','Georgia','Tbilisi');
Insert into GeopoliticalDB1 VALUES('852','Asia','Hong Kong','City of Victoria');
Insert into GeopoliticalDB1 VALUES('91','Asia','India','New Delhi');
Insert into GeopoliticalDB1 VALUES('62','Asia','Indonesia','Jakarta');
Insert into GeopoliticalDB1 VALUES('98','Asia','Iran','Tehran');
Insert into GeopoliticalDB1 VALUES('964','Asia','Iraq','Baghdad');
Insert into GeopoliticalDB1 VALUES('972','Asia','Israel','Jerusalem');
Insert into GeopoliticalDB1 VALUES('81','Asia','Japan','Tokyo');
Insert into GeopoliticalDB1 VALUES('962','Asia','Jordan','Amman');
Insert into GeopoliticalDB1 VALUES('7','Asia','Kazakhstan','Astana');
Insert into GeopoliticalDB1 VALUES('965','Asia','Kuwait','Kuwait City');
Insert into GeopoliticalDB1 VALUES('996','Asia','Kyrgyzstan','Bishkek');
Insert into GeopoliticalDB1 VALUES('856','Asia','Laos','Vientiane');
Insert into GeopoliticalDB1 VALUES('961','Asia','Lebanon','Beirut');
Insert into GeopoliticalDB1 VALUES('853','Asia','Macau','');
Insert into GeopoliticalDB1 VALUES('60','Asia','Malaysia','Kuala Lumpur');
Insert into GeopoliticalDB1 VALUES('960','Asia','Maldives','Male');
Insert into GeopoliticalDB1 VALUES('976','Asia','Mongolia','Ulan Bator');
Insert into GeopoliticalDB1 VALUES('95','Asia','Myanmar','Nay Pyi Taw');
Insert into GeopoliticalDB1 VALUES('977','Asia','Nepal','Kathmandu');
Insert into GeopoliticalDB1 VALUES('850','Asia','North Korea','Pyongyang');
Insert into GeopoliticalDB1 VALUES('968','Asia','Oman','Muscat');
Insert into GeopoliticalDB1 VALUES('92','Asia','Pakistan','Islamabad');
Insert into GeopoliticalDB1 VALUES('970','Asia','Palestine','Ramallah');
Insert into GeopoliticalDB1 VALUES('63','Asia','Philippines','Manila');
Insert into GeopoliticalDB1 VALUES('974','Asia','Qatar','Doha');
Insert into GeopoliticalDB1 VALUES('966','Asia','Saudi Arabia','Riyadh');
Insert into GeopoliticalDB1 VALUES('65','Asia','Singapore','Singapore');
Insert into GeopoliticalDB1 VALUES('82','Asia','South Korea','Seoul');
Insert into GeopoliticalDB1 VALUES('94','Asia','Sri Lanka','Colombo');
Insert into GeopoliticalDB1 VALUES('963','Asia','Syria','Damascus');
Insert into GeopoliticalDB1 VALUES('886','Asia','Taiwan','Taipei');
Insert into GeopoliticalDB1 VALUES('992','Asia','Tajikistan','Dushanbe');
Insert into GeopoliticalDB1 VALUES('66','Asia','Thailand','Bangkok');
Insert into GeopoliticalDB1 VALUES('670','Asia','East Timor','Dili');
Insert into GeopoliticalDB1 VALUES('90','Asia','Turkey','Ankara');
Insert into GeopoliticalDB1 VALUES('993','Asia','Turkmenistan','Ashgabat');
Insert into GeopoliticalDB1 VALUES('971','Asia','United Arab Emirates','Abu Dhabi');
Insert into GeopoliticalDB1 VALUES('998','Asia','Uzbekistan','Tashkent');
Insert into GeopoliticalDB1 VALUES('84','Asia','Vietnam','Hanoi');
Insert into GeopoliticalDB1 VALUES('967','Asia','Yemen','Sanaa');
PL/SQL Queries
Selec*from GeopoliticalD1;
Declare
x
varchar(
20);
y
varchar(
20);
begin
x := :Enter_Countery_n
ame; select Capital
INTO y
From
GeopoliticalDB1
Where Country
= x;
dbms_output.put_line('Capital of '|| x|| ' :
'|| y); Exception
When no_data_found then
dbms_output.put_line('Country name does not
exist!');
When others then
dbms_output.put_line('Something went
wrong);
end;
Finding country based on Country_code. Using
Exception and user Input.
declare
x
varchar(
20); y
varchar(
20);
begin
x := :Enter_Countery_c
ode; select
Country_code INTO y
From GeopoliticalDB
Where Country = x;
dbms_output.put_line('Country code of '|| x|| ' :
'|| y); Exception
When no_data_found then
dbms_output.put_line('Country name does not
exist!');
When others then
dbms_output.put_line('Something went
wrong);
end;
Conclusion