logo

Graphical Object-Oriented And Interne Programming docx.

   

Added on  2022-08-13

31 Pages6943 Words23 Views
Running head: GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING
GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING
Name of the Student
Name of the University
Author Note

GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING1
Table of Contents
Part A...............................................................................................................................................2
Part A, Question 1........................................................................................................................2
Part A, Question 2........................................................................................................................3
Part A, Question 3........................................................................................................................3
Part A, Question 4......................................................................................................................10
Part B: Query.................................................................................................................................12
Part C: Normalization....................................................................................................................19
Part C, Question 1......................................................................................................................19
Part C, Question 2......................................................................................................................19
Part C, Question 3......................................................................................................................20
Part D Entity Relationship Diagram..............................................................................................20
Part D, Question 1......................................................................................................................21
Part D, Question 2......................................................................................................................22
Part D, Question 3......................................................................................................................23
Part E: Brief Definitions................................................................................................................24
Part F: Database hacking...............................................................................................................25
Referencing....................................................................................................................................28

GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING2
Part A
Part A, Question 1
i. In terms of the Cardinality representation the downloaded ERD does not show any cardinality
between the tables. Whereas the ERD in subject guide uses (min, max) notation for showing the
cardinality between the tables.
ii. A strong entity has a primary key which is denoted by a Rectangle in ERD. On other hand, the
weak entities only have partial keys which is used to discriminate between tuples. It is denoted
by the double rectangle in ERD.
iii. Yes, the weak entities can be identified by the double rectangle used for the tables in the ER
diagram. Weak entities are the entities which do not have any key attribute or depend on the
other entities.
iv. The relationship between the Country and Religion is created in a way that the Country table
is the Parent table for the ‘country’ attribute in the Religion table. It is possible to enter any
country without even entering any religion record for that country. On other hand, a religion
record cannot be created for a country which has not be entered in the Country table as the
‘country’ in the Religion table is a foreign key referenced to the ‘code’ attribute in the Country
table (Powers 2019). Entering religion without inputting country will invoke the foreign key
constrain on Religion table.
v. In order to convert the Religion table into a strong entity type, key attributes have to be added
or created in the table. Currently there are no key attributes present in the table which can be
identified uniquely. The conversion can be done by adding a ReligionID attribute as primary key

GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING3
or creating the religion name as primary key. In both the cases, the values cannot be repeated in
the religion table. In this scenario, any value can be recorded into the Religion table without
having respective Country. As the religion table will become string entity, to maintain the
relationship with the Country table, the primary keys of both the tables must be added into
another table (Countryhasreligion) as foreign keys and composite primary keys (Schwichtenberg
2018).
Part A, Question 2
i. There are total 43 tables in the diagram.
ii. Total 33 table listed after running SHOW TABLES; command in Part A Question
3.
iii. The attributes are Country, dependent,independence ,wasdependent and government.
iv. The attributes are the Country, dependent,independence and government.
v. The conclusion can be drawn about the database documentation can have more
relations on a conceptual level and it can explain the structure of the database. The
dependencies, set of relations and schema can be very helpful in understanding the
database. However, the physical schema of the database can be little different from
the conceptual schema.
Part A, Question 3
Show Tables
MariaDB [mondial]> show tables;
+-------------------+
| Tables_in_mondial |
+-------------------+

GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING4
| borders |
| city |
| continent |
| country |
| desert |
| economy |
| encompasses |
| ethnicgroup |
| geo_desert |
| geo_estuary |
| geo_island |
| geo_lake |
| geo_mountain |
| geo_river |
| geo_sea |
| geo_source |
| island |
| islandin |
| ismember |
| lake |
| language |
| located |
| locatedon |
| mergeswith |
| mountain |
| mountainonisland |
| organization |
| politics |
| population |
| province |

GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING5
| religion |
| river |
| sea |
+-------------------+
33 rows in set (0.002 sec)
ECONOMY
MariaDB [mondial]> DESCRIBE economy;
+-------------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------+------+-----+---------+-------+
| Country | varchar(4) | NO | PRI | NULL | |
| GDP | float | YES | | NULL | |
| Agriculture | float | YES | | NULL | |
| Service | float | YES | | NULL | |
| Industry | float | YES | | NULL | |
| Inflation | float | YES | | NULL | |
+-------------+------------+------+-----+---------+-------+
6 rows in set (0.039 sec)
MariaDB [mondial]> select count(*) from economy;
+----------+
| count(*) |
+----------+
| 238 |
+----------+
1 row in set (0.001 sec)
MariaDB [mondial]> show index from economy;

GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING6
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------
+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality |
Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------
+------+------------+---------+---------------+
| economy | 0 | PRIMARY | 1 | Country | A | 214 | NULL | NULL |
| BTREE | | |
+---------+------------+----------+--------------+-------------+-----------+-------------+----------+--------
+------+------------+---------+---------------+
1 row in set (0.002 sec)
ISMEMBER
MariaDB [mondial]> describe ismember;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| Country | varchar(4) | NO | PRI | NULL | |
| Organization | varchar(12) | NO | PRI | NULL | |
| Type | varchar(35) | YES | | member | |
+--------------+-------------+------+-----+---------+-------+
3 rows in set (0.046 sec)
MariaDB [mondial]> select count(*) from ismember;
+----------+
| count(*) |
+----------+
| 8008 |
+----------+
1 row in set (0.006 sec)
MariaDB [mondial]> show index from ismember;

GRAPHICAL OBJECT-ORIENTED AND INTERNET PROGRAMMING7
+----------+------------+----------+--------------+--------------+-----------+-------------+----------
+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality |
Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+----------+------------+----------+--------------+--------------+-----------+-------------+----------
+--------+------+------------+---------+---------------+
| ismember | 0 | PRIMARY | 1 | Country | A | 454 | NULL | NULL |
| BTREE | | |
| ismember | 0 | PRIMARY | 2 | Organization | A | 7732 | NULL | NULL
| | BTREE | | |
+----------+------------+----------+--------------+--------------+-----------+-------------+----------
+--------+------+------------+---------+---------------+
2 rows in set (0.002 sec)
LANGUAGE
MariaDB [mondial]> describe language;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| Country | varchar(4) | NO | PRI | NULL | |
| Name | varchar(50) | NO | PRI | NULL | |
| Percentage | float | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
3 rows in set (0.035 sec)
MariaDB [mondial]> select count(*) from language;
+----------+
| count(*) |
+----------+
| 144 |
+----------+

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Sales And Marketing Management Database System Assignment
|28
|1151
|183