Database Management

Read Complete Research Material

DATABASE MANAGEMENT

Corporate Data and Database Management



Corporate Data and Database Management



Question A



.

Each Use Case is documented by a description of the scenario. The description can be written in textual form or in a step-by-step format. Each Use Case can also be defined by other properties, such as the pre- and postconditions of the scenario - conditions that exist before the scenario begins, and conditions that exist after the scenario completes. Activity Diagrams provide a graphical tool to model the process of a Use Case (Kareliotis, 2007).

To eliminate redundant modeling of a chunk of behavior that appears in multiple Use Cases, the chunk of behavior can be modeled in a separate Use Case that is related to the other Use Cases by the Uses relationship. The Uses relationship can be thought of as a Use Case equivalent of aggregation.

SQL Query

mysql>SHOW COLUMNS FROM address;

+---------------+-------------+------+-----+---------+-------+---------------------------------+

| Field | Type | Null | Key | Default | Extra | Privileges

|

+---------------+-------------+------+-----+---------+-------+---------------------------------+

| contact_id | smallint(6) | | PRI | 0 | | select,insert,update,references |

| StreetAddress | char(50) | YES | | NULL | | select,insert,update,references |

| City | char(20) | YES | | NULL | | select,insert,update,references |

| State | char(20) | YES | | NULL | | select,insert,update,references |

| Zip | char(10) | YES | | NULL | | select,insert,update,references |

| Country | char(20) | YES | | NULL | | select,insert,update,references |

+---------------+-------------+------+-----+---------+-------+------------------ ---------------+

6 rows in set (0.00 sec)

Inserting data, one row at a time:

mysql> INSERT INTO names (FirstName, LastName, BirthDate) VALUES ('Yamila','Diaz ','1974-10-13');

Query OK, 1 row affected (0.00 sec)

Inserting multiple rows at a time:

mysql> INSERT INTO names (FirstName, LastName, BirthDate) VALUES ('Nikki','Taylor','1972-03-04'),('Tia','Carrera','1975-09-18');

Query OK, 2 rows affected (0.00 sec)

Records: 2 Duplicates: 0 Warnings: 0

mysql> SELECT * from NAMES;

+------------+-----------+----------+------------+

| contact_id | FirstName | LastName | BirthDate |

+------------+-----------+----------+------------+

| 3 | Tia | Carrera | 1975-09-18 |

| 2 | Nikki | Taylor | 1972-03-04 |

| 1 | Yamila | Diaz | 1974-10-13 |

+------------+-----------+----------+------------+

3 rows in set (0.06 sec)

mysql> DESCRIBE names;

+------------+-------------+------+-----+---------+----------------+---------------------------------+

| Field | Type | Null | Key | Default | Extra | Privileges

|

+------------+-------------+------+-----+---------+----------------+---------------------------------+

| contact_id | smallint(6) | | PRI | NULL | auto_increment | select,insert,update,references |

| FirstName | char(20) | YES | | NULL | | select,insert,update,references |

| LastName | char(20) | YES | | NULL | | select,insert,update,references |

| BirthDate | date | YES | | NULL | | select,insert,update,references |

+------------+-------------+------+-----+---------+----------------+---------------------------------+

4 rows in set (0.00 sec)

mysql> INSERT INTO address(contact_id, StreetAddress, City, State, Zip, Country) VALUES ('1', '300 Yamila Ave.', 'Los Angeles', 'CA', '300012', 'USA'),('2','4000 Nikki St.','Boca Raton','FL','500034','USA'),('3','404 Tia Blvd.','New York','NY','10011','USA');

Query OK, 3 rows affected (0.05 sec)

Records: 3 Duplicates: 0 Warnings: 0

mysql> SELECT * FROM address;

+------------+-----------------+-------------+-------+--------+---------+

| contact_id | StreetAddress | City | State | Zip | Country |

+------------+-----------------+-------------+-------+--------+---------+

| 1 | 300 Yamila Ave. | Los Angeles | CA | 300012 | USA |

| 2 | 4000 Nikki St. | Boca Raton | FL | 500034 | USA |

| 3 | 404 Tia Blvd. | New York | NY | 10011 | USA |

+------------+-----------------+-------------+-------+--------+---------+

3 rows in set ...
Related Ads