0% found this document useful (0 votes)
32 views8 pages

SQL Queries Using Northwind Database

The lab focused on practicing SQL queries using the Northwind database, including data retrieval, filtering, and table joining. Key tasks included creating a Student table, adding records, displaying data based on GPA, and utilizing SQL operators like DISTINCT and ORDER BY. The lab aimed to enhance understanding of SQL operations with real-world business data.

Uploaded by

bismanawaz09
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)
32 views8 pages

SQL Queries Using Northwind Database

The lab focused on practicing SQL queries using the Northwind database, including data retrieval, filtering, and table joining. Key tasks included creating a Student table, adding records, displaying data based on GPA, and utilizing SQL operators like DISTINCT and ORDER BY. The lab aimed to enhance understanding of SQL operations with real-world business data.

Uploaded by

bismanawaz09
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

SQL Lab Report Northwind Database

Lab Tasks
Introduction:
In this lab, we worked on the Northwind database to practice SQL queries.
We explored data retrieval using SELECT, filtering using WHERE, and joining related tables.
The goal was to understand SQL operations using real-world business data.

Tasks:
• Create a new table Student which have the following schema Student( RegNo: String,
FirstName:String, LastName: String, GPA: Float, Contact: Integer)

• Add at least 5 records of your own class in which one or two students have GPA undefined.

• Display all the data from the table Student

• Display specific columns form the table Student

• Display all the data of students where GPA > 3.5

• Display all the data of students where GPA <= 3.5

Display first and last name of all students as single column using concatenation operator “||”.

Your task is to write SQL statements corresponding to each operator using Northwind schema

• Identify at least one SQL statement in which precedence can affect the result of query.

• Identify how the result of a mathematical expression on null value affect the result of a query.

• Use the distinct operator to eliminate the duplicates in your SQL statement.

• Write at least 3 SQL statements using Northwind schema which use ORDER BY clause

• Limit the result of 3 ORDER BY queries to 10 rows.


Results:
 Create a new table Student which have the following schema Student( RegNo: String,
FirstName:String, LastName: String, GPA: Float, Contact: Integer)
 Add at least 5 records of your own class in which one or two students have GPA
undefined.
 Display all the data from the table Student

 Display specific columns form the table Student

 Display all the data of students where GPA > 3.5


 Display all the data of students where GPA <= 3.5

 Does the above 2 queries covers all the data?


 Display first and last name of all students as single column using concatenation operator
“||”.

NORTHWIND TASKS

 Your task is to write SQL statements corresponding to each operator using Northwind
schema
 Identify at least one SQL statement in which precedence can affect the result of query
 Use the distinct operator to eliminate the duplicates in your SQL statement.

 Write at least 3 SQL statements using Northwind schema which use ORDER BY clause
 Limit the result of 3 ORDER BY queries to 10 rows.

You might also like