banner



How To See Customers Who Are Registered But Didnot Order Anything By Using Tables In Sql

SQL Subquery Exercises: Display all the customers with orders issued on date 17th August, 2012

SQL SUBQUERY: Exercise-10 with Solution

10. From the post-obit tables, write a SQL query to detect the customers whose orders issued on 17th August, 2012. Return ord_no, purch_amt, ord_date, customer_id, salesman_id and cust_name.

Sample tabular array: Orders

Sample table: Customer

Sample Solution:

            SELECT b.*, a.cust_name FROM orders b, client a WHERE a.customer_id=b.customer_id AND b.ord_date='2012-08-17';                      

Output of the Query:

ord_no	purch_amt	ord_date	customer_id	salesman_id	cust_name 70004	110.50		2012-08-17	3009		5003		Geoff Cameron 70011	75.29		2012-08-17	3003		5007		Jozy Altidor          

Caption:

SQL Subqueries: Display all the customers with orders issued on  date 17th August, 2012.

Exercise Online


Inventory database model

Query Visualization:

Elapsing:

Query visualization of Display all the customers with orders issued on date 17th August, 2012 - Duration

Rows:

Query visualization of Display all the customers with orders issued on date 17th August, 2012 - Rows

Price:

Query visualization of Display all the customers with orders issued on date 17th August, 2012 - Cost

Contribute your code and comments through Disqus.

Previous: From the following tables, write a SQL query to observe those salespeople who earned the maximum commission. Return ord_no, purch_amt, ord_date, and salesman_id.
Next: From the post-obit tables, write a SQL query to find the salespeople who had more than than ane customer. Return salesman_id and name.

What is the difficulty level of this do?

Test your Programming skills with w3resource'southward quiz.



SQL: Tips of the 24-hour interval

Select SQL Server database size:

Query:

SELECT        database_name = DB_NAME(database_id)     , log_size_mb = Cast(SUM(CASE WHEN type_desc = 'LOG' THEN size Finish) * 8. / 1024 AS DECIMAL(8,2))     , row_size_mb = Cast(SUM(CASE WHEN type_desc = 'ROWS' And then size End) * 8. / 1024 AS DECIMAL(viii,2))     , total_size_mb = CAST(SUM(size) * 8. / 1024 As DECIMAL(8,2)) FROM sys.master_files WITH(NOWAIT) WHERE database_id = DB_ID() -- for current db  GROUP Past database_id          

Output:

-- my query name           log_size_mb  row_size_mb   total_size_mb -------------- ------------ ------------- ------------- xxxxxxxxxxx    512.00       302.81        814.81  -- sp_spaceused database_name    database_size      unallocated space ---------------- ------------------ ------------------ xxxxxxxxxxx      814.81 MB          13.04 MB          

Ref: https://chip.ly/384PN2c


  • New Content published on w3resource:
  • HTML-CSS Practical: Exercises, Exercise, Solution
  • Java Regular Expression: Exercises, Exercise, Solution
  • Scala Programming Exercises, Practice, Solution
  • Python Itertools exercises
  • Python Numpy exercises
  • Python GeoPy Package exercises
  • Python Pandas exercises
  • Python nltk exercises
  • Python BeautifulSoup exercises
  • Form Template
  • Composer - PHP Bundle Managing director
  • PHPUnit - PHP Testing
  • Laravel - PHP Framework
  • Athwart - JavaScript Framework
  • Vue - JavaScript Framework
  • Jest - JavaScript Testing Framework


How To See Customers Who Are Registered But Didnot Order Anything By Using Tables In Sql,

Source: https://www.w3resource.com/sql-exercises/subqueries/sql-subqueries-inventory-exercise-10.php

Posted by: davisthomene.blogspot.com

0 Response to "How To See Customers Who Are Registered But Didnot Order Anything By Using Tables In Sql"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel