Skip to content

Instantly share code, notes, and snippets.

View MonaliKSuthar's full-sized avatar

MonaliKSuthar

View GitHub Profile
@MonaliKSuthar
MonaliKSuthar / sqlJOIN.sql
Last active October 23, 2017 04:31
SQL COMMANDS - JOIN TABLES
-- Student name: Monali Kamleshbhai Suthar
-- Date: 13/10/2017
-- Statement of authourship: I, Monali Kamleshbhai Suthar, 000740485, certify that this material is my original work.No other person's work has been used without due acknowledgement
-- and I have not made my work available to anyone else.
-- Group : 1 Basic Queries --
PRINT 'GROUP 1 SELECT B'
SELECT COUNT(PatientID) FROM Patients WHERE Gender='M' AND PatientWeight < (SELECT AVG(PatientWeight) FROM Patients WHERE Gender='F');
PRINT 'GROUP 1 SELECT C'
SELECT FirstName,LastName,PatientHeight FROM Patients WHERE PatientHeight = (SELECT MAX(PatientHeight) FROM Patients WHERE Gender='F');