Skip to main content

Basic SQL Queries example

 Basics SQL Query

From the below table - table name - Product


Product_ID Product_Name Product_Price Product_Category Expiry
1 Cumin Powder 100 Kitechen - Spices 2023-07-18
2 Turmeric Powder 75 Kitechen - Spices 2023-08-15
3 Coriander Powder 55 Kitechen - Spices 2023-09-01
4 Bathing Soap 35 Personal - Care 2023-10-15
5 Hair Conditionar 100 Personal - Care 2023-12-30
6 Face Wash 65 Personal - Care 2023-11-19
7 Tooth Paste 75 Personal - Care 2023-10-18

Queries using top and order by clause

  • List the top 3 products based on price higher to lower.
  • List bottom 2 products based on price higher to lower.
  • List the product details that expires before all other product.
  • List the product details that expires at last.
  • List top 5 product with their names sorted on alphabetical order.

Queries using where clause

  • List the product details which belongs to Kitchen - Spices category
  • List the products which are expiring after 2023-08-01.
  • List the products whose price is below 70.
  • List the product which costs between 60-80.
  • List the product which are either Kitchen - Spices or Price is greater than 60.

Queries on wildcard search

  • List the products whose name start with "C" and ends with "R".
  • List the product whose name contains "Pow"

More Questions will be added soon, please write in the comment box if this is helpful or you are not able to solve any query.

Comments

Popular posts from this blog

DataZen Syllabus

INTRODUCTION TO DATAZEN PRODUCT ELEMENTS ARCHITECTURE DATAZEN ENTERPRISE SERVER INTRODUCTION SERVER ARCHITECTURE INSTALLATION SECURITY CONTROL PANEL WEB VIEWER SERVER ADMINISTRATION CREATING AND PUBLISHING DASHBOARDS CONNECTING TO DATASOURCES DESIGNER CONFIGURING NAVIGATOR CONFIGURING VISUALIZATION  PUBLISHING DASHBOARD WORKING WITH MAP  WORKING WITH DRILL THROUGH DASHBOARDS

MS BI Syllabus

Microsoft Business Intelligence Course Syllabus SSRS – SQL Server Reporting Services  Getting Started 1. Understanding Reporting (Authoring,Management,Delivery) 2. Installing Reporting (Native Mode, SharePoint Integration mode) 3. Building your first report  Authoring Reports 1. Developing Basic Reports (RDL,wizard,designer,datasource,dataset,formatting) 2. Working with expressions (expression to calculate value, Agg functions, exp for objects) 3. Organizing Data (Data Regions, Table, Matrix, Chart, List) 4. Advance Report (Parameter, drill down, drill through, links, 5. Report Model (Data Source, Data Source View, Model , Report Builder 3.0)  Managing Report ( Report Manager) 1. Managing Content (deploying report, folders, linked reports, datasources, value etc) 2. Managing Security (Item Level , Site navigation, localhost – sql) 3. Managing Server Config (Config Manager, Report Manager, Report Server DB)  Delivering Report 1. Accessing Report (Viewing...

PowerBI Interview Questions and Answers

Power BI Interview Questions – General Questions 1). What is self-service business intelligence? Ans: Self-Service Business Intelligence (SSBI) is an approach to data analytics that enables business users to filter, segment, and, analyse their data, without the in-depth technical knowledge in statistical analysis, business intelligence (BI). SSBI has made it easier for end users to access their data and create various visuals to get better business insights. Anybody who has basic understanding of the data can create reports to build intuitive and shareable dashboards. 2). What are the parts of Microsoft self-service business intelligence solution? Ans: Microsoft has two parts for Self-Service BI  Excel BI Toolkit – It allows users to create interactive report by importing data from different sources and model data according to report requirement.  Power BI – It is the online solution that enables you to share the interactive reports and queries that you have created using ...