Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need only Professional people on Database, In this project, you will be asked to enhance the COMPANY schema that was given to you in
I need only Professional people on Database, In this project, you will be asked to enhance the COMPANY schema that was given to you in class by adding a new table called COMPANYVEHICLE and linking it to the EMPLOYEE table. Using the enhanced schema, you will then be asked to write some SQL queries, views, triggers, and stored procedures. To complete this project, please follow these steps:
Use the CREATE TABLE command to create the COMPANYVEHICLE table. This table will contain the following attributes underlined attributes denotes primary key: points
Attribute Data Type
LicenseNumber
VARCHAR
Model VARCHAR
Make VARCHAR
Year CHAR
Assignee CHAR: foreign key corresponding to the Ssn primary key in EMPLOYEE Insert here the CREATE TABLE command you used to create the above table.
Use INSERT INTO command to fill the table as shown below: points
LicenseNumber Model Make Year Assignee
TEXAS ABC Mustang Ford
TEXAS RSK XJS Jaguar
TEXAS TQR Sonata Hyundai
TEXAS OPU Camry Toyota null
TEXAS FGT Cavalier Chevrolet null
TEXAS YHF Elantra Hyundai null
TEXAS TQY Avalon Toyota null
Insert here INSERT INTO commands you used to populate the table.
Use the enhanced COMPANY database to write and test the following SQL queries: x points Find the license number, model and make of all available vehicles those that are not assigned to any employees Hint: use the condition Assignee IS NULL in the where clause.Insert here the query as expressed in SQL and the output of the query. Find the first name and last name of the employees who have been assigned vehicles.Insert here the query as expressed in SQL and the output of the query. Find the first name and last name of the employees who have not been assigned vehicles.Insert here the query as expressed in SQL and the output of the query. Find the license number, model, make, and year of all unavailable vehicles. Hint: use the condition Assignee IS NOT NULL in the where clause.Insert here the query as expressed in SQL and the output of the query Create a view called V that, for each employee who was assigned a vehicle, will show the employee first name, middle initial, last name, the model, make, and year of the vehicle assigned to himher point Insert here the CREATE VIEW command you used to create the above view and show the output of this view. Create another view V that will show the social security number of each employee, number of projects heshe works on and the total number of hours he spent on all the projects ordered by the social security number in ascending order. That is the view should show the following information: point
Social Security Number # of Projects Total Hours
Insert here the CREATE VIEW command you used to create the above view and show the output of this view. Mr Ahmad V Jabbar has quit the company. Use the DELETE command to delete his records from the WORKSON and EMPLOYEE tables. point Insert here the DELETE command you used to delete the records. Mr James E Borg has changed his address and received a salary increase. Use the UPDATE command to change his address to Thunder Rd Houston TX and increase his salary by point Insert here the UPDATE command you used to update the address and salary. Use the ALTER TABLE command to add a CHECK constraint to the EMPLOYEE table called salarycheck to restrict the salary so that it is in the range to Test the constraint by updating the salary of Mr James E Borg to using the UPDATE command. point
Insert here the ALTER TABLE command you used to create the above CHECK constraint. Also, the UPDATE command you used to test this constraint and a screen shot showing the error message that will be displayed. Write a rowlevel trigger that will increase the salary of every employee that is switched to department by Test it by switching the employee Joyce English from department her current department to department points Insert here the CREATE OR REPLACE TRIGGER command you used to create the above trigger.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started