Module 9 - Advanced SQL Query
Module 9 - Advanced SQL Query
1
Database and Database Users
Overview
Expression
Course Module
SELECT ProductName, Price * 2 AS ‘New Price’
FROM Products;
SELECT GETDATE();
SELECT *
FROM Products
WHERE Stocks < 5;
2. Aggregate Functions
2.2 Grouping
Limitations of GROUP BY
Columns or expressions can be in the SELECT clause only if they are in the GROUP BY clause.
Inner Join
Records that have matching records from two (2) tables
Outer Join
▪ It is needed when minimum cardinality is optional on a table.
▪ Left Join – include all qualified records from the left table in the join condition even
if they do not have matching records in the right table.
▪ Right Join - include all qualified records from the right table in the join condition
even if they do not have matching records in the left table.
▪ Full Join – include all qualified records from both tables in the join condition.
Course Module
OUTER JOIN Example
Fundamentals of Database Systems
5
Database and Database Users
3. Alias
Course Module
References and Supplementary Materials
Books and Journals
1. Ramez Elmasri and Shamkant B. Navathe; 2016; Fundamentals of Database Systems;
USA; Pearson
2. Dr. Kashif Qureshi; 2018; Advanced concepts of information technology; educreation
publishing; India.
Online Supplementary Reading Materials
1. RelationalDBDesing;; March 31, 2020
2. Advantages of Database Management System;
https://www.tutorialspoint.com/Advantages-of-Database-Management-System;
March 31, 2020
3. DesigningandManagingData;
https://www.academia.edu/36712448/Entity_Relationship_Diagram_ERD_Basics_CIS
_3730_Designing_and_Managing_Data; April 01, 2020
4. DesigningandManagingData; http://jackzheng.net/teaching/archive/cis3730-2010-
fall/; April 03,2020
Online Instructional Videos
1. Introduction to Database; https://www.youtube.com/watch?v=8e-
wgQnsFxE&list=PLJ5C_6qdAvBHKccG0ZyOxcf_2YO6r4Q4l; March 21, 2020
2. Three levels of Architecture/DBMS;
https://www.youtube.com/watch?v=j6xh8wKfjkY; April 01,2020
3. Relational Data Model; https://www.youtube.com/watch?v=TsSf1Z3g0Kk; Arpil 06,
2020.
4. Basic Concept of Database Normalization;
https://www.youtube.com/watch?v=xoTyrdT9SZI; April 08, 2020
5. SQL Basics; https://www.youtube.com/watch?v=zbMHLJ0dY4w; April 10, 2020
6. Joins|SQL|; https://www.youtube.com/watch?v=efpFCd8iFAQ; April 11, 2020