Hands On Exercises For BASIC SQL
Hands On Exercises For BASIC SQL
Steps:
1) Search 'northwind mysql' in google
2) first result with github link: two files northwind.sql and northwind-data.sql
3) open those links in separate tab
4) copy first northwind.sql in SQLYOG, paste and Execute All Queries
5) if no errors, copy northwind-data.sql and paste in SQLyog and Execute all Queries
6) refresh list of databases, northwind should be displayed there
7) use this database for backup and restore :)
4. Display all employees’ firstname, lastname, jobtitle and notes to see the remarks
stored for these employees.
5. Update all products in the products table which has the reorder level of below 10 to
8.
Write your SQL command here:
UPDATE products
SET reorder_level=8
WHERE reorder_level<10;
How many records are affected? 3
Paste your screenshot of the output here:
Denmark Denolan
6. Count the products which belong to the Canned Fruits and Vegetables. Label the
resulting column as Total_Items.
Write your SQL command here:
SELECT COUNT(category) AS Total_Items
FROM products
WHERE category='Canned Fruit & Vegetables';
Paste your screenshot of the output here:
7. Which Item has the highest price in terms of standard cost? Display product name
and standard cost.
Write your SQL command here:
SELECT MAX(standard_cost) AS HighestCost
FROM products;
Write your output here:
Highest price (in terms of standard cost)=60.7500
Product name: Northwind Traders Marmalade
Paste your screenshot of the output here after successfully inserting the records
Denmark Denolan