Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
* Where is used to limit the rows
1). list all customers with a NULL value in the "Address" field:
2). Updates the third customer (CustomerID = 3) with a new contact person and a new city
UPDATE Customers
SET ContactName='Sponge Bob Squarepants', City='Ocean'
WHERE CustomerId=3;
3). Add a new customer to the Customers table (INSERT INTO ...).
Delete the new customer you added (DELETE FROM ... WHERE ...)
INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES ('Bibi','Bat','9934 Holmes Street','Alberta','4006','Canada');
DELETE FROM Customers WHERE CustomerName='Bibi';
4). List the first 5 employees in the Employees table (TOP)
SELECT TOP 5 * FROM Employees;
5). Selects the first 20% of the records from the Products table
SELECT TOP 20 PERCENT * FROM Products;
6). In a single query, list the smallest and largest price from Products table (MIN() Max() . Use aliasing to call it 'Smallest Price' and 'Largest Price' respectively.
SELECT MIN(Price) AS SmallestPrice , MAX(Price) AS LargestPrice
FROM Products;
7). Find the total quantity from OrderDetails table (SUM)
SELECT SUM(Quantity)
FROM OrderDetails;
8). Find the average quantity from OrderDetails table (AVG)
SELECT AVG(Quantity)
FROM OrderDetails;
9). Find all Employees whose last name end with letter 'g' (LIKE)
SELECT * FROM Employees
WHERE LastName LIKE '%g';
10). Find all Employees whose first name's second character is 'a' and first name ends with letter 't' (LIKE)
SELECT * FROM Employees
WHERE FirstName LIKE '_a%' AND FirstName LIKE '%t';
11). Selects all Categories with category names starting with "b", "p", or "s" (LIKE '[]%'
SELECT * FROM Categories
WHERE CategoryName LIKE '[bsp]%';
12). Selects all Categories with category names starting with "c" to "g" LIKE '[-]%'
SELECT * FROM Categories
WHERE CategoryName LIKE '[c-g]%';
13). IN operator allows you to specify multiple values in a WHERE clause. The IN operator is a shorthand for multiple OR conditions.Selects all suppliers that are located in "London", "Tokyo" and "Paris":
SELECT * FROM Suppliers
WHERE City IN ('London', 'Tokyo', 'Paris');
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team