AdventureWorks Database: Find all products that have NULL in the weight column
SQL Query - AdventureWorks: Exercise-186 with Solution
186. From the following table write a query in SQL to find all products that have NULL in the weight column. Return name and weight.
Sample table: Production.Product
Sample Solution:
SELECT Name, Weight
FROM Production.Product
WHERE Weight IS NULL;
Sample Output:
name |weight| -------------------------------+------+ Adjustable Race | | Bearing Ball | | BB Ball Bearing | | Headset Ball Bearings | | Blade | | LL Crankarm | | ML Crankarm | | HL Crankarm | | Chainring Bolts | | Chainring Nut | | Chainring | | Crown Race | | Chain Stays | | Decal 1 | | Decal 2 | | ...
SQL AdventureWorks Editor:
Practice Online
Contribute your code and comments through Disqus.
Previous: Null special offers will return MaxQty as zero.
Next: Find the data from the first column that has a non-null value.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
SQL: Tips of the Day
ROW_NUMBER() in MySQL
SELECT t0.col3 FROM table AS t0 LEFT JOIN table AS t1 ON t0.col1=t1.col1 AND t0.col2=t1.col2 AND t1.col3>t0.col3 WHERE t1.col1 IS NULL;
Ref : https://bit.ly/3VX3Jzv
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises