DATABASE CONCEPTS
TEAM PROJECT
Liz Thomas, Leon Tang, Latrell Trotter, Haley
Nixon,
There are six entities
VENDOR, DEPARTMENT,
SKILL, PROJECT,
EMPLOYEE, and
LOCATION with one
associative entity EMP
SKILL in this Project, Inc.
system.
ER Diagram
Final ERD
• EMPLOYEE
• 1NF
• 2NF
• 3NF
• Transitive
• Spouse emp# and marriage moved to a
separate table
• EMPLOYEE(EMP_SSN, FIRST_NAME,
LAST_NAME, SALARY, SEX, JOB_TYPE,
DEPT_DUM, DOB,SUPER_SSN)
• WORKS_ON(EMP_SSN, PNO, HOURS)
• DEPARTMENT(DEPT_NUM, DEPT_NAME,
MANAGER_SSN, MANAGER_DOJ)
• DLOCATIONS(DEPT_NUM, DLOCATIONS)
• PROJECT(PROJ_NUM, PROJ_NAME,
DEPT_NUM)
• DEPENDENT(EMP_SSN, FIRST_NAME,
LAST_NAME, GENDER, DOB, RELATIONSHIP)
NORMALIZATION
Since each department may
have a different location,
there may be many
department location entries
for a specific department
number. Therefore, the
department table is not in the
INF form. Similarly an
employee may work for
several projects, so for each
entry of the employee, there
may be different entries for a
specific project number.
Hence the table,
EMPLOYEE, will not be in
DATABASE DICTIONARY
DATABASE DICTIONARY
DATABASE
DICTIONARY
INSERT INTO EMPLOYEE
VALUES (1, 'James Smith', '12312-1234', '101 Washington Dr.', 'Norfolk', 'VA', '60000', 'Male', 'January 1, 1980');
INSERT INTO EMPLOYEE
VALUES (2, 'Mary Johnson', '123122345', '201 Adams Rd.', 'Norfolk', 'VA', '70000', 'Female', 'February 3, 1985');
INSERT INTO EMPLOYEE
VALUES (3, 'John Williams', '123123456', '301 Jefferson Ave.', 'Norfolk', 'VA', '80000', 'Male', 'March 6, 1960');
INSERT INTO EMPLOYEE
VALUES (4, 'Patricia Jones', '123124567', '401 Madison St.', 'Norfolk', 'VA', '60000', 'Female', 'April 9, 1974');
INSERT INTO EMPLOYEE
VALUES (5, 'Robert Brown', '123125678', '501 Monroe, Ct.', 'Norfolk', 'VA', '65000', 'Male', 'May 12, 1989');
INSERT INTO EMPLOYEE
VALUES (6, 'Jennifer Davis', '123126789', '601 Q. Adams Blvd.', 'Norfolk', 'VA', '110000', 'Female', 'June 15, 1970');
INSERT INTO EMPLOYEE
VALUES (7, 'Michael Miller', '123129876', '701 Jackson Ln.', 'Norfolk', 'VA', '100000', 'Male', 'July 18, 1978');
INSERT INTO EMPLOYEE
VALUES (8, 'Linda Wilson', '123128765', '801 Van Buren Trail', 'Norfolk', 'VA', '65000', 'Female', 'August 21, 1987');
INSERT INTO EMPLOYEE
VALUES (9, 'William Moore', '123127654', '901 Harrison Hwy.', 'Norfolk', 'VA', '90000', 'Male', 'September 24, 1990');
INSERT INTO EMPLOYEE
VALUES (10, 'Elizabeth Taylor', '123126543', '111 Tyler Way', 'Norfolk', 'VA', '85000', 'Female', 'October 27, 1992');
INSERT INTO EMPLOYEE
VALUES (11, 'David Anderson', '123125432', '222 Polk Path', 'Norfolk', 'VA', '80000', 'Male', 'November 30, 1983');
INSERT INTO EMPLOYEE
VALUES (12, 'Barbara Thomas', '123124321', '333 Taylor Terrace', 'Norfolk', 'VA', '100000', 'Female', 'December 25,
1964');
TABLE-INSERTION FOR EMPLOYEES
TABLE EMPLOYEES
TABLES- EMPJOB
CREATE TABLE EmployeeJob (
empjob_CEO VARCHAR(15),
empjob_Clerk VARCHAR(20),
empjob_Engineer VARCHAR(15),
empjob_Manager VARCHAR(15),
empjob_President VARCHAR(15),
empjob_Programmer
VARCHAR(15),
empjob_Secretary VARCHAR(15),
empjob_Vicepresident
VARCHAR(15));
TABLES JOB
• SELECT *
• FROM Job;
TABLES-EMP SKILL
• CREATE TABLE EmployeeSkills_
(EmployeeID VARCHAR(10) NOT
NULL, SkillID VARCHAR(12) NOT
NULL, CONSTRAINT
EmployeeSkills_PK PRIMARY KEY
(EmployeeID, SkillID), CONSTRAINT
EmployeeSkills_FK1 FOREIGN KEY
(EmployeeID) REFERENCES
Employee_T(EmployeeID),
CONSTRAINT EmployeeSkills_FK2
FOREIGN KEY (SkillID) REFERENCES
Skill_(SkillID));
• SELECT*
• FROM EMP SKILL;
TABLES- SKILL
• SELECT *
• FROM Skill;
• CREATE TABLE Skill_(SkillID
VARCHAR(12) NOT NULL,
SkillDescription VARCHAR(30) ,
CONSTRAINT Skill_PK PRIMARY KEY
(SkillID));
TABLES
DEPARTMENT
• SELECT *
• FROM DEPARTMENTS;
Information Technology
Public Relations
Custodial
Records
Research and Development
Operations
Finance
Human Relations
Sales and Marketing
Accounting
Integration Management
INSERT INTO DEPARTMENT
VALUES ('Finance', '123-1111', 'James Smith');
INSERT INTO DEPARTMENT
VALUES ('Human Resources', '123-1112', 'Mary Johnson');
INSERT INTO DEPARTMENT
VALUES ('Information Technology', '123-1113', 'John
Williams');
INSERT INTO DEPARTMENT
VALUES ('Service', '123-1114', 'Patricia Jones');
INSERT INTO DEPARTMENT
VALUES ('Sales', '123-1115', 'Robert Brown');
INSERT INTO DEPARTMENT
VALUES ('Accounting', '123-1116', 'Jennifer Davis');
INSERT INTO DEPARTMENT
VALUES ('Marketing', '123-1117', 'Michael Miller');
INSERT INTO DEPARTMENT
VALUES ('Administrative', '123-1118', 'Linda Wilson');
INSERT INTO DEPARTMENT
VALUES ('Planning', '123-1119', 'William Moore');
INSERT INTO DEPARTMENT
VALUES ('Legal', '123-1120', 'Elizabeth Taylor');
INSERT INTO DEPARTMENT
VALUES ('Maintenance', '123-1121', 'David Anderson');
TABLE-INSERTION FOR DEPARTMENT
Insertion for department
work history
INSERT INTO DepartmentWorkhistory
VALUES ('1','1', 'October 31,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('1','11','October 31,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('1','2','October 31,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('2','3','November 5,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('2','5','November 5,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('3','6','November 7,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('3','8','November 7,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('3','9','November 7,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('4','4', 'November 9,2014');
INSERT INTO DepartmentWorkhistory
VALUES ('5','10','November 13,2014');
INSERT INTO DEepartmentWorkhistory
VALUES ('5','7','November 13,2014');
TABLES- DEPARTMENT WORK
HISTORY
CREATE TABLE DepartmentWorkhistory (
hist_number VARCHAR2(20),
hist_dparmentnumber
VARCHAR2(10),
hist_start VARCHAR2(20)
);
TABLE-CREATION FOR DEPARTMENT AND PROJECT
TABLE INSERTION FOR PROJECT
INSERT INTO proj
VALUES ('BATMAN', 1, 'Building 1',
'$350000');
INSERT INTO proj
VALUES ('BIGFOOT', 2, 'Building 2',
'$500000');
INSERT INTO proj
VALUES ('CANARY', 3, 'Building 3',
'$150000');
INSERT INTO proj
VALUES ('CASANOVA', 4, 'Building 1',
'$640000');
INSERT INTO proj
VALUES ('WHISTLER', 5, 'Building 3',
'$300000');
TABLES FOR PROJ
LOCATIONS
CREATE TABLE ProjLocations (
"3334 Princess Anne Rd Virginia Beach VA" VARCHAR(35),
"1320 Greenbrier Pkwy Chesapeake, VA" VARCHAR(40),
"201 S Rosemont RD Virginia Beach, VA" VARCHAR(40),
"1800 Greenbrier Pkwy Chesapeake, VA" VARCHAR(45),
"111 W Tazewell St Norfolk, VA" VARCHAR(35),
"217 Grace St Norfolk, VA" VARCHAR(20),
"565 Cedar Rd Chesapeake, VA" VARCHAR(25),
"4532 Columbus St Virginia Beach,VA" VARCHAR(30)
);
Insertion for MarPart
INSERT INTO MARPART
VALUES ('1','1');
INSERT INTO MARPART
VALUES ('2','6');
INSERT INTO MARPART
VALUES ('3','2');
INSERT INTO MARPART
VALUES ('4','4');
INSERT INTO MARPART
VALUES ('5','3');
INSERT INTO MARPART
VALUES ('6','5');
Tables-Marpart
• SELECT*
• FROM Marpart;
CREATE TABLE MARPART (
mar_marnumber VARCHAR2(20)
mar_employeenumber VARCHAR2(10)
);
TABLES- EMP
DEPENDENT
• SELECT*
• FROM EmpDependent;
CREATE TABLE EmpDependent (
EmpDependentName VARCHAR(20),
EmpDependentgender VARCHAR(1),
EmpDependentDOB VARCHAR(8),
EmpDependentRelationship VARCHAR(15)
);
TABLES FOR DEPENDENTS
(SPOUSES SIGNIFICANT OTHER)
• SELECT *
• FROM dependents;
TABLE-INSERTION FOR DEPENDENT
INSERT INTO DEPENDENTS
VALUES ('Jimmy Smith', 'male', 'December 31, 2010', 'James
Smiths');
INSERT INTO DEPENDENTS
VALUES ('Mars Johnson', 'male', 'November 27,2009', 'Mary
Johnsons');
INSERT INTO DEPENDENTS
VALUES ('Robby Brown', 'male', 'September 8, 2012', 'Robert
Browns');
INSERT INTO DEPENDENTS
VALUES ('Barbie Thomas', 'female', 'March 23, 2003',
'Barbara Thomas');
INSERT INTO DEPENDENTS
VALUES ('Lindsey Wilson', 'female', 'August 12, 2007', 'Linda
Wilsons');
INSERT INTO DEPENDENTS
VALUES ('Michelle Miller', 'female', 'January 29, 2005',
'Michael Millers');
Row Insertion for Dependents
TABLE CREATION FOR
VENDOR AND DEPENDENT
INSERT INTO VENDOR
VALUES ('Office Supply Co', '123 Pencil
Path', '12-JUN-20');
INSERT INTO VENDOR
VALUES ('Snax and Such','32 Chips Ct.', '24-
NOV-20');
INSERT INTO VENDOR
VALUES ('Materials Company', '53 Wood
Way', '01-Dec-20');
INSERT INTO VENDOR
VALUES ('Assurance Insurance', '1 Claim
Ave.', '05-Jan-21');
INSERT INTO VENDOR
VALUES ('U O Them Tax Agency', '4 Money
St.', '29-Feb-21');
INSERT INTO VENDOR
VALUES ('Utilities', '10 Electric Blvd.', '30-Mar-
21');
TABLE-INSERTION VENDOR
TABLES- DEPT VENDOR
• SELECT*
• FROM DeptVendor;
CREATE TABLE
DeptVendor_Name VACHAR(20)
DeptVendor_address VACHAR(30)
DeptVendor_date(25)
DeptVendor_price(25)
);
TABLES FOR VENDOR
• SELECT *
• FROM Vendor;
CREATE TABLE VENDOR (
vend_name VARCHAR2(20),
vend_address VARCHAR2(30),
vend_date VARCHAR2(20),
vend_price VARCHAR2(20),
);
TABLES-MANAGER HIST
• SELECT *
• FROM ManagerHist;
CREATE TABLE ManagerHistory (
mana_number VARCHAR2(20)
mana_departmentnumber
VARCHAR2 (10)
mana_start VARCHAR2(20
);
TABLE-INSERTION FOR MANAGER
HISTORY
TABLE INSERTION FOR
ASSIGNMENT
INSERT INTO ASSIGNMENT
VALUES (1, 1, 40);
INSERT INTO ASSIGNMENT
VALUES (2, 2, 20);
INSERT INTO ASSIGNMENT
VALUES (3, 3, 40);
INSERT INTO ASSIGNMENT
VALUES (4, 4, 80);
INSERT INTO ASSIGNMENT
VALUES (5, 5, 10);
INSERT INTO ASSIGNMENT
VALUES (6, 6, 35);
INSERT INTO ASSIGNMENT
VALUES (7, 7, 75);
INSERT INTO ASSIGNMENT
VALUES (8, 8, 50);
INSERT INTO ASSIGNMENT
VALUES (9, 9, 20);
INSERT INTO ASSIGNMENT
VALUES (10, 10, 5);
TRIGGERS
TRIGGERS
SEQUENCE EXAMPLES
Is a DBMS right for Project Inc?
Can Project Inc afford a DBMS?
Does the benefit outweigh the costs?
Considering the Costs
COST OF THE DATABASE
LIFE CYCLE
MORE BENEFITS
NET PRESENT VALUE
COSTS
LEON’S QUERIES
1. Add 2 columns to the EMPLOYEE table, one for employee start date and one for name of spouse
ALTER TABLE EMPLOYEE ADD(emp_startdate VARCHAR2(20), emp_spouse VARCHAR(20) );
1. Show the wages of employees from the EMPLOYEE table.
SELECT emp_salary FROM EMPLOYEE;
1. Add a new dependent into the DEPENDENTS table for William Moore’s son, Wilheim, who is a male,
born June 20, 2019.
INSERT INTO DEPENDENTS VALUES( ‘Wilheim’, ‘male’, ‘June 20, 2019’, ‘William Moore’s son’};
HALEY’S QUERIES
1. Add a column to PROJ table for the projects start date
ALTER TABLE PROJ ADD (proj_start_date DATE);
1. Add new employee Haley Nixon.
INSERT INTO EMPLOYEE VALUES (13, ‘Haley Nixon’, ‘1517 Monarch Way’,
‘Norfolk’, ‘VA’, ‘55,000’, ‘female’, ‘September 12, 1997’);
1. After Haley’s first year of employment, she received a raise totaling $75,000.
Update her salary earned.
UPDATE EMPLOYEE SET salary = ‘75,000’ WHERE emp_id = ‘13’;
LATRELL’S QUERIES
1. The project manager needs the addresses of all the vendors to properly document
information. Display the addresses only from the vendor table
select vend_address from VENDOR;
2.Add a colum to the MARPART table titled ‘relationship’
ALTER TABLE marpart
ADD mar_relationship VARCHAR(20);
3.The team project is taking longer than expected. Add a new row into the manager history
database. Manager number 7,
INSERT INTO History
VALUES (‘7’,’12’,’December 15, 2014’);
Liz’s Queries
1.Add two columns to the EMPLOYEES
table. One column, named EmpDate,
contains the
date of employment for each employee,
and its default value should be the
system
date. The second column, named
EndDate, contains employees’ date of
Termination.
ALTER TABLE employees
ADD empdate DATE DEFAULT
SYSDATE
2. Display a list of all the data
contained in EmpDependent
table.
Liz’s Queries
3. Display a list of all the data contained in projlocations table.
SELECT *
FROM projlocations
Liz’s Queries
1. Standards can be enforced
The DBMS has central control over the database, the DBA can ensure
that all applications follow certain standards, such as data formats,
document standards, etc.
1. Lower Costs
The DBMS system is expensive, but the maintenance cost after
purchase is very low. It can be maintained by a few programmers, and
it is not expensive for the enterprise
1. Less Data Loss
Due to the many security constraints on the database, the chance of
data loss is minimized.
1. Lower Efficiency
The DBMS is a multi-purpose software that can be used for many
purposes, so the efficiency is reduced.
1. More Vulnerabilities
The DBMS has a centralized function, it has many functions,
but the centralization also increases the vulnerability. The
entire system shuts down due to the failure of a single
component. For organizations that are completely
dependent on the database, this is a very critical
shortcoming of the DBMS
1. Costly Data Conversion
The conversion cost is greater than the sum of the DBMS hardware
and machine costs. Trained staff is needed to convert data to the
new system. This is the main reason why most organizations are still
using the old DBMS due to the high cost of data conversion.
Communication skills are vital to DBAs who
work in teams with computer programmers and
managers. These experts are used in
a wide range of settings in the public and private
sectors, and some DBAs work as specialists to
corporations.
The Bureau of Labor Statistics projects 9.7 percent
employment growth for database administrators between
2019 and 2029. In that period, an estimated 12,800 jobs
should open up.
In conclusion, we learned that teamwork is a
valuable part of developing successful processes,
projects, and procedures to drive the organization
forward. Without good teamwork, the organization
will fall into trouble. People feel underappreciated
and frustrated. However, there are many benefits
when teamwork is put first.
CONCLUSION

Database Concepts Team Project.pptx

  • 1.
    DATABASE CONCEPTS TEAM PROJECT LizThomas, Leon Tang, Latrell Trotter, Haley Nixon,
  • 2.
    There are sixentities VENDOR, DEPARTMENT, SKILL, PROJECT, EMPLOYEE, and LOCATION with one associative entity EMP SKILL in this Project, Inc. system. ER Diagram
  • 4.
  • 7.
    • EMPLOYEE • 1NF •2NF • 3NF • Transitive • Spouse emp# and marriage moved to a separate table
  • 8.
    • EMPLOYEE(EMP_SSN, FIRST_NAME, LAST_NAME,SALARY, SEX, JOB_TYPE, DEPT_DUM, DOB,SUPER_SSN) • WORKS_ON(EMP_SSN, PNO, HOURS) • DEPARTMENT(DEPT_NUM, DEPT_NAME, MANAGER_SSN, MANAGER_DOJ) • DLOCATIONS(DEPT_NUM, DLOCATIONS) • PROJECT(PROJ_NUM, PROJ_NAME, DEPT_NUM) • DEPENDENT(EMP_SSN, FIRST_NAME, LAST_NAME, GENDER, DOB, RELATIONSHIP) NORMALIZATION Since each department may have a different location, there may be many department location entries for a specific department number. Therefore, the department table is not in the INF form. Similarly an employee may work for several projects, so for each entry of the employee, there may be different entries for a specific project number. Hence the table, EMPLOYEE, will not be in
  • 9.
  • 10.
  • 11.
  • 12.
    INSERT INTO EMPLOYEE VALUES(1, 'James Smith', '12312-1234', '101 Washington Dr.', 'Norfolk', 'VA', '60000', 'Male', 'January 1, 1980'); INSERT INTO EMPLOYEE VALUES (2, 'Mary Johnson', '123122345', '201 Adams Rd.', 'Norfolk', 'VA', '70000', 'Female', 'February 3, 1985'); INSERT INTO EMPLOYEE VALUES (3, 'John Williams', '123123456', '301 Jefferson Ave.', 'Norfolk', 'VA', '80000', 'Male', 'March 6, 1960'); INSERT INTO EMPLOYEE VALUES (4, 'Patricia Jones', '123124567', '401 Madison St.', 'Norfolk', 'VA', '60000', 'Female', 'April 9, 1974'); INSERT INTO EMPLOYEE VALUES (5, 'Robert Brown', '123125678', '501 Monroe, Ct.', 'Norfolk', 'VA', '65000', 'Male', 'May 12, 1989'); INSERT INTO EMPLOYEE VALUES (6, 'Jennifer Davis', '123126789', '601 Q. Adams Blvd.', 'Norfolk', 'VA', '110000', 'Female', 'June 15, 1970'); INSERT INTO EMPLOYEE VALUES (7, 'Michael Miller', '123129876', '701 Jackson Ln.', 'Norfolk', 'VA', '100000', 'Male', 'July 18, 1978'); INSERT INTO EMPLOYEE VALUES (8, 'Linda Wilson', '123128765', '801 Van Buren Trail', 'Norfolk', 'VA', '65000', 'Female', 'August 21, 1987'); INSERT INTO EMPLOYEE VALUES (9, 'William Moore', '123127654', '901 Harrison Hwy.', 'Norfolk', 'VA', '90000', 'Male', 'September 24, 1990'); INSERT INTO EMPLOYEE VALUES (10, 'Elizabeth Taylor', '123126543', '111 Tyler Way', 'Norfolk', 'VA', '85000', 'Female', 'October 27, 1992'); INSERT INTO EMPLOYEE VALUES (11, 'David Anderson', '123125432', '222 Polk Path', 'Norfolk', 'VA', '80000', 'Male', 'November 30, 1983'); INSERT INTO EMPLOYEE VALUES (12, 'Barbara Thomas', '123124321', '333 Taylor Terrace', 'Norfolk', 'VA', '100000', 'Female', 'December 25, 1964'); TABLE-INSERTION FOR EMPLOYEES
  • 13.
  • 14.
    TABLES- EMPJOB CREATE TABLEEmployeeJob ( empjob_CEO VARCHAR(15), empjob_Clerk VARCHAR(20), empjob_Engineer VARCHAR(15), empjob_Manager VARCHAR(15), empjob_President VARCHAR(15), empjob_Programmer VARCHAR(15), empjob_Secretary VARCHAR(15), empjob_Vicepresident VARCHAR(15));
  • 15.
    TABLES JOB • SELECT* • FROM Job;
  • 16.
    TABLES-EMP SKILL • CREATETABLE EmployeeSkills_ (EmployeeID VARCHAR(10) NOT NULL, SkillID VARCHAR(12) NOT NULL, CONSTRAINT EmployeeSkills_PK PRIMARY KEY (EmployeeID, SkillID), CONSTRAINT EmployeeSkills_FK1 FOREIGN KEY (EmployeeID) REFERENCES Employee_T(EmployeeID), CONSTRAINT EmployeeSkills_FK2 FOREIGN KEY (SkillID) REFERENCES Skill_(SkillID)); • SELECT* • FROM EMP SKILL;
  • 17.
    TABLES- SKILL • SELECT* • FROM Skill; • CREATE TABLE Skill_(SkillID VARCHAR(12) NOT NULL, SkillDescription VARCHAR(30) , CONSTRAINT Skill_PK PRIMARY KEY (SkillID));
  • 18.
    TABLES DEPARTMENT • SELECT * •FROM DEPARTMENTS; Information Technology Public Relations Custodial Records Research and Development Operations Finance Human Relations Sales and Marketing Accounting Integration Management
  • 19.
    INSERT INTO DEPARTMENT VALUES('Finance', '123-1111', 'James Smith'); INSERT INTO DEPARTMENT VALUES ('Human Resources', '123-1112', 'Mary Johnson'); INSERT INTO DEPARTMENT VALUES ('Information Technology', '123-1113', 'John Williams'); INSERT INTO DEPARTMENT VALUES ('Service', '123-1114', 'Patricia Jones'); INSERT INTO DEPARTMENT VALUES ('Sales', '123-1115', 'Robert Brown'); INSERT INTO DEPARTMENT VALUES ('Accounting', '123-1116', 'Jennifer Davis'); INSERT INTO DEPARTMENT VALUES ('Marketing', '123-1117', 'Michael Miller'); INSERT INTO DEPARTMENT VALUES ('Administrative', '123-1118', 'Linda Wilson'); INSERT INTO DEPARTMENT VALUES ('Planning', '123-1119', 'William Moore'); INSERT INTO DEPARTMENT VALUES ('Legal', '123-1120', 'Elizabeth Taylor'); INSERT INTO DEPARTMENT VALUES ('Maintenance', '123-1121', 'David Anderson'); TABLE-INSERTION FOR DEPARTMENT
  • 20.
    Insertion for department workhistory INSERT INTO DepartmentWorkhistory VALUES ('1','1', 'October 31,2014'); INSERT INTO DepartmentWorkhistory VALUES ('1','11','October 31,2014'); INSERT INTO DepartmentWorkhistory VALUES ('1','2','October 31,2014'); INSERT INTO DepartmentWorkhistory VALUES ('2','3','November 5,2014'); INSERT INTO DepartmentWorkhistory VALUES ('2','5','November 5,2014'); INSERT INTO DepartmentWorkhistory VALUES ('3','6','November 7,2014'); INSERT INTO DepartmentWorkhistory VALUES ('3','8','November 7,2014'); INSERT INTO DepartmentWorkhistory VALUES ('3','9','November 7,2014'); INSERT INTO DepartmentWorkhistory VALUES ('4','4', 'November 9,2014'); INSERT INTO DepartmentWorkhistory VALUES ('5','10','November 13,2014'); INSERT INTO DEepartmentWorkhistory VALUES ('5','7','November 13,2014');
  • 21.
    TABLES- DEPARTMENT WORK HISTORY CREATETABLE DepartmentWorkhistory ( hist_number VARCHAR2(20), hist_dparmentnumber VARCHAR2(10), hist_start VARCHAR2(20) );
  • 22.
  • 23.
    TABLE INSERTION FORPROJECT INSERT INTO proj VALUES ('BATMAN', 1, 'Building 1', '$350000'); INSERT INTO proj VALUES ('BIGFOOT', 2, 'Building 2', '$500000'); INSERT INTO proj VALUES ('CANARY', 3, 'Building 3', '$150000'); INSERT INTO proj VALUES ('CASANOVA', 4, 'Building 1', '$640000'); INSERT INTO proj VALUES ('WHISTLER', 5, 'Building 3', '$300000');
  • 24.
    TABLES FOR PROJ LOCATIONS CREATETABLE ProjLocations ( "3334 Princess Anne Rd Virginia Beach VA" VARCHAR(35), "1320 Greenbrier Pkwy Chesapeake, VA" VARCHAR(40), "201 S Rosemont RD Virginia Beach, VA" VARCHAR(40), "1800 Greenbrier Pkwy Chesapeake, VA" VARCHAR(45), "111 W Tazewell St Norfolk, VA" VARCHAR(35), "217 Grace St Norfolk, VA" VARCHAR(20), "565 Cedar Rd Chesapeake, VA" VARCHAR(25), "4532 Columbus St Virginia Beach,VA" VARCHAR(30) );
  • 25.
    Insertion for MarPart INSERTINTO MARPART VALUES ('1','1'); INSERT INTO MARPART VALUES ('2','6'); INSERT INTO MARPART VALUES ('3','2'); INSERT INTO MARPART VALUES ('4','4'); INSERT INTO MARPART VALUES ('5','3'); INSERT INTO MARPART VALUES ('6','5');
  • 26.
    Tables-Marpart • SELECT* • FROMMarpart; CREATE TABLE MARPART ( mar_marnumber VARCHAR2(20) mar_employeenumber VARCHAR2(10) );
  • 27.
    TABLES- EMP DEPENDENT • SELECT* •FROM EmpDependent; CREATE TABLE EmpDependent ( EmpDependentName VARCHAR(20), EmpDependentgender VARCHAR(1), EmpDependentDOB VARCHAR(8), EmpDependentRelationship VARCHAR(15) );
  • 28.
    TABLES FOR DEPENDENTS (SPOUSESSIGNIFICANT OTHER) • SELECT * • FROM dependents;
  • 29.
    TABLE-INSERTION FOR DEPENDENT INSERTINTO DEPENDENTS VALUES ('Jimmy Smith', 'male', 'December 31, 2010', 'James Smiths'); INSERT INTO DEPENDENTS VALUES ('Mars Johnson', 'male', 'November 27,2009', 'Mary Johnsons'); INSERT INTO DEPENDENTS VALUES ('Robby Brown', 'male', 'September 8, 2012', 'Robert Browns'); INSERT INTO DEPENDENTS VALUES ('Barbie Thomas', 'female', 'March 23, 2003', 'Barbara Thomas'); INSERT INTO DEPENDENTS VALUES ('Lindsey Wilson', 'female', 'August 12, 2007', 'Linda Wilsons'); INSERT INTO DEPENDENTS VALUES ('Michelle Miller', 'female', 'January 29, 2005', 'Michael Millers');
  • 30.
  • 31.
  • 32.
    INSERT INTO VENDOR VALUES('Office Supply Co', '123 Pencil Path', '12-JUN-20'); INSERT INTO VENDOR VALUES ('Snax and Such','32 Chips Ct.', '24- NOV-20'); INSERT INTO VENDOR VALUES ('Materials Company', '53 Wood Way', '01-Dec-20'); INSERT INTO VENDOR VALUES ('Assurance Insurance', '1 Claim Ave.', '05-Jan-21'); INSERT INTO VENDOR VALUES ('U O Them Tax Agency', '4 Money St.', '29-Feb-21'); INSERT INTO VENDOR VALUES ('Utilities', '10 Electric Blvd.', '30-Mar- 21'); TABLE-INSERTION VENDOR
  • 33.
    TABLES- DEPT VENDOR •SELECT* • FROM DeptVendor; CREATE TABLE DeptVendor_Name VACHAR(20) DeptVendor_address VACHAR(30) DeptVendor_date(25) DeptVendor_price(25) );
  • 34.
    TABLES FOR VENDOR •SELECT * • FROM Vendor; CREATE TABLE VENDOR ( vend_name VARCHAR2(20), vend_address VARCHAR2(30), vend_date VARCHAR2(20), vend_price VARCHAR2(20), );
  • 35.
    TABLES-MANAGER HIST • SELECT* • FROM ManagerHist; CREATE TABLE ManagerHistory ( mana_number VARCHAR2(20) mana_departmentnumber VARCHAR2 (10) mana_start VARCHAR2(20 );
  • 36.
  • 37.
    TABLE INSERTION FOR ASSIGNMENT INSERTINTO ASSIGNMENT VALUES (1, 1, 40); INSERT INTO ASSIGNMENT VALUES (2, 2, 20); INSERT INTO ASSIGNMENT VALUES (3, 3, 40); INSERT INTO ASSIGNMENT VALUES (4, 4, 80); INSERT INTO ASSIGNMENT VALUES (5, 5, 10); INSERT INTO ASSIGNMENT VALUES (6, 6, 35); INSERT INTO ASSIGNMENT VALUES (7, 7, 75); INSERT INTO ASSIGNMENT VALUES (8, 8, 50); INSERT INTO ASSIGNMENT VALUES (9, 9, 20); INSERT INTO ASSIGNMENT VALUES (10, 10, 5);
  • 38.
  • 39.
  • 40.
  • 41.
    Is a DBMSright for Project Inc? Can Project Inc afford a DBMS? Does the benefit outweigh the costs?
  • 42.
  • 43.
    COST OF THEDATABASE LIFE CYCLE
  • 45.
  • 46.
  • 48.
  • 49.
    LEON’S QUERIES 1. Add2 columns to the EMPLOYEE table, one for employee start date and one for name of spouse ALTER TABLE EMPLOYEE ADD(emp_startdate VARCHAR2(20), emp_spouse VARCHAR(20) ); 1. Show the wages of employees from the EMPLOYEE table. SELECT emp_salary FROM EMPLOYEE; 1. Add a new dependent into the DEPENDENTS table for William Moore’s son, Wilheim, who is a male, born June 20, 2019. INSERT INTO DEPENDENTS VALUES( ‘Wilheim’, ‘male’, ‘June 20, 2019’, ‘William Moore’s son’};
  • 50.
    HALEY’S QUERIES 1. Adda column to PROJ table for the projects start date ALTER TABLE PROJ ADD (proj_start_date DATE); 1. Add new employee Haley Nixon. INSERT INTO EMPLOYEE VALUES (13, ‘Haley Nixon’, ‘1517 Monarch Way’, ‘Norfolk’, ‘VA’, ‘55,000’, ‘female’, ‘September 12, 1997’); 1. After Haley’s first year of employment, she received a raise totaling $75,000. Update her salary earned. UPDATE EMPLOYEE SET salary = ‘75,000’ WHERE emp_id = ‘13’;
  • 51.
    LATRELL’S QUERIES 1. Theproject manager needs the addresses of all the vendors to properly document information. Display the addresses only from the vendor table select vend_address from VENDOR; 2.Add a colum to the MARPART table titled ‘relationship’ ALTER TABLE marpart ADD mar_relationship VARCHAR(20); 3.The team project is taking longer than expected. Add a new row into the manager history database. Manager number 7, INSERT INTO History VALUES (‘7’,’12’,’December 15, 2014’);
  • 52.
    Liz’s Queries 1.Add twocolumns to the EMPLOYEES table. One column, named EmpDate, contains the date of employment for each employee, and its default value should be the system date. The second column, named EndDate, contains employees’ date of Termination. ALTER TABLE employees ADD empdate DATE DEFAULT SYSDATE
  • 53.
    2. Display alist of all the data contained in EmpDependent table. Liz’s Queries
  • 54.
    3. Display alist of all the data contained in projlocations table. SELECT * FROM projlocations Liz’s Queries
  • 55.
    1. Standards canbe enforced The DBMS has central control over the database, the DBA can ensure that all applications follow certain standards, such as data formats, document standards, etc. 1. Lower Costs The DBMS system is expensive, but the maintenance cost after purchase is very low. It can be maintained by a few programmers, and it is not expensive for the enterprise 1. Less Data Loss Due to the many security constraints on the database, the chance of data loss is minimized.
  • 56.
    1. Lower Efficiency TheDBMS is a multi-purpose software that can be used for many purposes, so the efficiency is reduced. 1. More Vulnerabilities The DBMS has a centralized function, it has many functions, but the centralization also increases the vulnerability. The entire system shuts down due to the failure of a single component. For organizations that are completely dependent on the database, this is a very critical shortcoming of the DBMS 1. Costly Data Conversion The conversion cost is greater than the sum of the DBMS hardware and machine costs. Trained staff is needed to convert data to the new system. This is the main reason why most organizations are still using the old DBMS due to the high cost of data conversion.
  • 57.
    Communication skills arevital to DBAs who work in teams with computer programmers and managers. These experts are used in a wide range of settings in the public and private sectors, and some DBAs work as specialists to corporations. The Bureau of Labor Statistics projects 9.7 percent employment growth for database administrators between 2019 and 2029. In that period, an estimated 12,800 jobs should open up.
  • 58.
    In conclusion, welearned that teamwork is a valuable part of developing successful processes, projects, and procedures to drive the organization forward. Without good teamwork, the organization will fall into trouble. People feel underappreciated and frustrated. However, there are many benefits when teamwork is put first.
  • 59.