Create a company database, Database Management System

Assignment Help:

Company Database:

a-)Here is the ER Model

1172_Create a Company Database 1.png

b-)Here is the Relational Model:

 

681_Create a Company Database 2.png

 
IMPORTANT NOTICE FOR SOLUTION TYPE:

***THIS ASSIGNMENT WILL BE SOLVED BY THE FOLLOWING THIS TYPE AND EXAMPLE!!!

SOLUTION TYPE:

SELECT   Distinct Lname, Fname

FROM       Employee, Department, Dependent

WHERE    SSN=mgrssn and ssn=essn;

SOLUTION TYPE:

SELECT   pnumber,dnum,lname,address,bdate

FROM       project,department,employee

WHERE    dnum=dnumber and mgrssn=ssn and plocation='Stafford';

EXAMPLE:

STEP# 1: CREATE TABLE dependent

( essn  char(9),

dependent_namevarchar(15),

sex            char,

bdate          date,


relationshipvarchar(8),

primary key (essn,dependent_name));

STEP #2:

INSERT INTO dependent VALUES ('333445555','Alice','F','05-APR-86','Daughter');

INSERT INTO dependent VALUES ('333445555','Theodore','M','25-OCT-83','Son');

INSERT INTO dependent VALUES ('333445555','Joy','F','03-MAY-58','Spouse');

INSERT INTO dependent VALUES ('987654321','Abner','M','28-FEB-42','Spouse');

INSERT INTO dependent VALUES ('123456789','Michael','M','01-JAN-78','Son');

INSERT INTO dependent VALUES ('123456789','Alice','F', '31-DEC-88','Daughter');

INSERT INTO dependent VALUES ('123456789','Elizabeth','F','05-MAY-67','Spouse');

STEP #3: ALTER TABLE dependent ADD CONSTRAINT dependent_essn_fk foreign key (essn)  references employee(ssn);


Related Discussions:- Create a company database

What is the use of rename operation, What is the use of rename operation? ...

What is the use of rename operation? Rename operation is used to rename both relations and an attributes. It uses the as clause, taking the form: Old-name as new-name.

Name the metrics for selecting top algorithm, Name the metrics for selectin...

Name the metrics for selecting top algorithm There are a number of metrics for selecting top algorithm: i) Computational complexity: Computational complexity refers to eff

Give an example of operations from the state actions, Give an example of op...

Give an example of operations from the State Actions and Activities. For instance, in bank the activity verify account code and verify password

Views-data control, Views A view is like a window by which data from ta...

Views A view is like a window by which data from tables can be changed or viewed. The table on which a view is based is known as Base table. The view is stored as a SELECT stat

Database backup, Discuss the importance and characteristics of database bac...

Discuss the importance and characteristics of database backup and recovery procedures, then describe the actions that must be detailed in backup and recovery plan

What are stored-procedures, What are stored-procedures? And what are the ad...

What are stored-procedures? And what are the advantages of using them? Stored procedures are database objects that perform a user defined operation. A stored procedure can have

Database Management System, Assume that you are responsible for selecting a...

Assume that you are responsible for selecting a new DBMS product for Sohar Hospital

Define deadlock prevention, Define deadlock prevention. Deadlock preven...

Define deadlock prevention. Deadlock prevention is a set of methods for ensuring that at least one of the four essential conditions like mutual exclusion, hold and wait, no pre

What are metrics for choosing the best algorithm, What are metrics for choo...

What are metrics for choosing the best algorithm? Matrices for choosing the best algorithms are as below: Computational complexity Ease of understand ability and im

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd