Week3v2 (2)
Week3v2 (2)
Lab Manual 3
Learning Objectives:
Understand the structure and use of basic SELECT queries.
Retrieving and Restricting data using the SQL SELECT
statement.
Apply SQL clauses to filter, sort, group, and manipulate
data for efficient analysis.
Identify the impact of operator precedence and null value
handling in SQL queries.
Note: You cannot use any SQL clause other than SELECT, FROM,
WHERE, ORDER BY. FROM clause can include one table only. All tasks
will be performed on northwind schema.
In its simplest form, a SELECT statement must include the follow in:
• A SELECT clause, which specifies the columns to be - in this
case, the Company Name field.
• A FROM clause, which identifies the table containing the
columns that are listed in the SELECT statement.
Basic Syntax:
SELECT column1, column2, ...
FROM table_name;
WHERE Clause:
The WHERE clause filters rows based on specified conditions.
SELECT column1, column2
FROM table_name
WHERE condition;
***
Q2
***
Create Table
CREATE TABLE Employees (
EmployeeId INT PRIMARY KEY,
FullName VARCHAR(50),
Department VARCHAR(50),
Practice Task:
1. List the names of products which priced within range 25 to 98
(ProductName).
2. Which employees are fluent in French?(FullName)
3. List employees who have completed a degree in psychology(
FirstName, LastName).
4. List the customers who are used to live in London
(CustomerName,Country).
5. List all orders where the EmployeeID is assigned (OrderID,
EmployeeID, ShipperID).
6. Retrieve suppliers with a SupplierID between 5 and 15
(SupplierName, SupplierID).
7. Retrieve products where the product contains the word
"bottles"(ProductName).
8. Retrieve products where the ProductName starts with the letter "C"(
ProductName ,Price ).
9. List the products which are shipped in boxes. (ProductName)
10. List the cities of Germany from customer table.(City)
Submission Requirements:
Submit the following files:
P2Task.txt
HackerRank Tasks:
1. Japanese Cities' Attributes
2. Employee Salaries
3. Select All
4. Japanese Cities' Attributes
5. Employee Names
6. Select By ID
7. Weather Observation Station 1
8. Weather Observation Station 3
9. Weather Observation Station 4
10. Weather Observation Station 5