Question: Design different SQL queries ( 11 covering the different features of SQL ). Run these queries on the selected DBMS and present the results. Your

Design different SQL queries ( 11 covering the different features of SQL). Run these queries on the selected DBMS and present the results. Your queries should involve most of the relations you designed and include complex queries.

tables' schemas were created

CREATE TABLE Departments (

DeptID INT PRIMARY KEY,

DeptName VARCHAR(255) NOT NULL );

--------------

CREATE TABLE Employees (

EmployeeID INT AUTO_INCREMENT PRIMARY KEY,

FirstName VARCHAR(255) NOT NULL,

LastName VARCHAR(255) NOT NULL,

BirthDate DATE NOT NULL,

PositionID INT,

Salary DECIMAL(10, 2),

DepartmentID INT,

HostelID INT,

Email VARCHAR(255),

PhoneNumber VARCHAR(255),

Foreign KEY (PositionID) REFERENCES Positions(PositionID),

Foreign KEY (DepartmentID) REFERENCES Departments(DeptID),

Foreign KEY (HostelID) REFERENCES Hostels(HostelID) );

--------------

CREATE TABLE Positions (

PositionID INT AUTO_INCREMENT PRIMARY KEY,

PositionName VARCHAR(255) NOT NULL,

PositionDescription VARCHAR(255)

);

-----------------------

CREATE TABLE Hostels (

HostelID INT AUTO_INCREMENT PRIMARY KEY,

HostelName VARCHAR(255) NOT NULL,

Location VARCHAR(255) );

-----------------

CREATE TABLE Qualifications (

QualificationID INT AUTO_INCREMENT PRIMARY KEY,

QualificationName VARCHAR(255) NOT NULL,

QualificationDescription VARCHAR(255));

--------------------

CREATE TABLE Employee_Qualifications (

EmployeeID INT,

QualificationID INT,

PRIMARY KEY (EmployeeID, QualificationID),

Foreign KEY (EmployeeID) REFERENCES Employees(EmployeeID),

Foreign KEY (QualificationID) REFERENCES Qualifications(QualificationID) );

*****************************

INSERT INTO Departments VALUES

(1, 'Department of Medicine'),

(2, 'Department of Nursing'),

(3, 'Department of Neurology'),

(4, 'Department of Renal Unit'),

(5, 'Department of Physiotherapy'),

(6, 'Department of Orthopedics'),

(7, 'Department of Elderly services'),

(8, 'Department of Gastroenterology'),

(9, 'Department of General Surgery'),

(10, 'Department of Hematology'),

(11, 'Department of Physiotherapy');

*****************************

INSERT INTO Positions VALUES

(1, 'Doctor', 'Manages medical care for patients'),

(2, 'Nurse', 'Provides direct patient care and nursing services'),

(3, 'Anesthesiologist', 'Manages anesthesia for patients during surgery'),

(4, 'Surgeon', 'Performs surgical procedures on patients'),

(5, 'Pharmacist', 'Dispenses medications to patients and provides medication information'),

(6, 'Physical Therapist', 'Assists patients in recovering and improving their physical abilities'),

(7, 'Dentist', 'Provides oral healthcare and performs dental procedures'),

(8, 'Radiologist', 'Interprets medical imaging to diagnose and treat diseases'),

(9, 'Psychiatrist', 'Diagnoses and treats mental health disorders'),

(10, 'Occupational Therapist', 'Assists patients in regaining functional skills for daily living'),

(11, 'Speech-Language Pathologist', 'Assesses and treats communication and swallowing disorders'),

(12, 'Social Worker', 'Provides support and resources for individuals and families in need'),

(13, 'Medical Laboratory Technician', 'Performs laboratory tests to assist in diagnosing diseases'),

(14, 'Paramedic', 'Provides emergency medical care during critical situations'),

(15, 'Registered Dietitian', 'Provides nutrition counseling and plans personalized diets'),

(16, 'Respiratory Therapist', 'Assists patients with respiratory disorders in managing their breathing'),

(17, 'Optometrist', 'Provides eye care and performs eye exams');

*****************************

INSERT INTO Employees VALUES

(1, 'John', 'Doe', '1980-01-01', 1, 80000.00, 1, 1, 'john.doe@email.com', '123-456-7890'),

(2, 'Jane', 'Doe', '1975-01-01', 2, 70000.00, 2, 2, 'jane.doe@email.com', '987-654-3210'),

(3, 'Alice', 'Smith', '1985-01-01', 3, 90000.00, 3, 3, 'alice.smith@email.com', '098-765-4321');

*****************************

INSERT INTO Qualifications VALUES

(1, 'Bachelor of Science in Nursing', 'Basic course for nursing professionals'),

(2, 'Master of Science in Anesthesiology', 'Advanced course for anesthesiologists'),

(3, 'Bachelor of Science in Radiography', 'Basic course for radiology professionals'),

(4, 'Master of Science in Epidemiology', 'Advanced course for epidemiologists'),

(5, 'Doctor of Dental Medicine', 'Advanced course for dentists'),

(6, 'Bachelor of Science in Physiotherapy', 'Basic course for physiotherapy professionals'),

(7, 'Master of Science in Nutrition and Dietetics', 'Advanced course for nutrition and dietetics professionals'),

(8, 'Bachelor of Science in Medical Laboratory Science', 'Basic course for laboratory professionals'),

(9, 'Master of Science in Occupational Therapy', 'Advanced course for occupational therapists'),

(10, 'Bachelor of Science in Speech and Language Therapy', 'Basic course for speech and language therapists');

*****************************

INSERT INTO Hostels VALUES

(1, 'Hostel 1', 'Hamad Town '),

(2, 'Hostel 2', 'Manama'),

(3, 'Hostel 3', 'Isa Town'),

(4, 'Hostel 4', 'Riffa'),

(5, 'Hostel 5', 'Muharraq'),

(6, 'Hostel 6', 'Aali'),

(7, 'Hostel 7', 'Sitra'),

(8, 'Hostel 8', 'Jedhafs'),

(9, 'Hostel 9', 'AlMalikiyah'),

(10,'Hostel 10', 'Arad');

*****************************

INSERT INTO Employee_Qualifications VALUES

(1, 1),

(2, 2),

(3, 2);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!