0% found this document useful (0 votes)
33 views2 pages

Correct SQL Code

Uploaded by

amidmans1980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

Correct SQL Code

Uploaded by

amidmans1980
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1a. create a database with name NANA_AMA_PAYROLL_DB. 1b.

inside the
database, create a table with name Employees_Master_Table. b1. create the ff
columns under the above mentioned table: employee_ID, First_Name, Surname,
Birth_Date, Gender, Department, Contact_No, Email, Date_Employed, and
Occupation. Note: Employee_ID should be the Primary Key and should be auto
generated with the format 1001 and incremented by 1. b2. insert 15 employees
details into the Employee_Master_Table. C. create another table called
Employee_Salary_Table with the ff columns: Transaction_ID, Transaction_Date,
Hours_Worked, Pay_Rate, and Employee_ID. Note: Tranction_ID should be auto
generated with format 101 incremented by 1. Employee_ID in
Employee_Salary_Table should be a foreign key referencing employee_id in
Employee_Master_Table. C1. insert transactions for all 15 employees. C2. Hours
Worked should be checked, it should not be more than 200hrs. c3. Rate of pay
should also be checked and should not be more than 300cedis. D. create the ff as
scalar function usind Basic_salary = Hours_Worked * Pay_rate. d1. allowances =
15% of basic_salary. d2. gross_salary = basic_salary + allowances. d3.
Tax_deduction = 6.5% of basic_salary. d4. Net_pay = gross_salary -
tax_deductions.

Ctrl + Shift + E: Open the "Connect to Server" dialog box.

Ctrl + N: Open a new query window.

INSERT INTO Client_Master_Table (Client_Name, Client_Contact_No, Email, Date_of_Birth, Location,


Nationality, Gender)

VALUES

('Amid_Mansaray', '0204124567', '[email protected]', '1990-05-15', 'Pigfarm', 'Sierra Leonean',


'Male'),

('Aminata_Koroma', '0509876543', '[email protected]', '1992-08-27', 'New_Town', 'Sierra


Leonean', 'Female'),

('Michael_Johnson', '+231571985020', '[email protected]', '1992-08-27', 'Monrovia', 'Liberian',


'Male'),

('Gifty_Boateng', '0243456789', '[email protected]', '2005-11-18', 'Adenta', 'Ghanaian', 'Female'),

('Mohammad_Tawfeeq', '0509256709', '[email protected]', '1989-06-21', 'Madina', 'Ghanaian',


'Male'),

('Princess_Nana', '0202124918', '[email protected]', '1996-01-13', 'Mamobi', 'Ghanaian',


'Female'),

('Chenedu_Obina', '+23488509876543', '[email protected]', '1994-11-30', 'Lagos', 'Nigerian', 'Male'),

('Alusine_Barrie', '+22406541512', '[email protected]', '1988-02-02', 'Cornacry', 'Guinean', 'Male'),


('Zainab_Turay', '+23273956729', '[email protected]', '1997-12-10', 'Freetown', 'Sierra
Leonean', 'Female'),

('Alpha_Sillah', '+22451259702', '[email protected]', '1986-08-17', 'Cornacry', 'Guinean', 'Male'),

('Emmanuel_Nelson', '0248224819', '[email protected]', '1999-10-02', 'Lapaz', 'Ghanaian',


'Male'),

('Prince_Wiiliams', '0201086643', '[email protected]', '1992-12-28', 'Monrovia', 'Liberian',


'Male'),

('Gloria_Afari', '0508841629', '[email protected]', '2004-07-08', 'Adenta', 'Ghanaian',


'Female'),

('Abdulai_Tarawally', '+23273858702', '[email protected]', '1995-03-11', 'Freetown', 'Sierra


Leonean', 'Male'),

('Alusine_Koroma', '+2241259702', '[email protected]', '1990-08-15', 'Cornacry', 'Guinean',


'Male'),

('Tawa_Abdulai', '0248224819', '[email protected]', '2000-10-07', 'Adablaka', 'Ghanaian', 'Female'),

('Aruna_Mansour', '+232761086643', '[email protected]', '1995-11-22', 'Freetown', 'Sierra


Leonean', 'Male'),

('Abubakarr_Sanusi', '+23458841629', '[email protected]', '2001-02-18', 'River_State',


'Nigerian', 'Male'),

('Prince_Ndololo', '0506858702', '[email protected]', '2000-09-10', 'Pigfarm', 'Ghanaian', 'Male'),

('Joyce_Mahama', '0241259702', '[email protected]', '1999-02-17', 'Kassoa', 'Ghanaian', 'Female');

You might also like