SQL Exercise & Worksheet: Connecting You To The Next Level in Life
SQL Exercise & Worksheet: Connecting You To The Next Level in Life
CLASS 3
www.macappstudiobridge.com
Queries used in the Demo
Query 2 - Select a user record with a particular user name and password:
SELECT * FROM `usertable` WHERE `username`='[email protected]' AND
`password`='123456'
1 Enter the query to list the all data in the SELECT * FROM customer
customer details table ? details
2 Enter the query to delete the customer details DROP TABLE customer details
table ?
3 Enter the query to Select the records where SELECT * FROM customer
the CustomerID column has the value 12. ? details WHERE
CustomerID=12
4 Enter the query to Insert a new record in INSERT INTO customer details
the customer details table ? (name, email, mobile, city)
VALUES ( 'Bairistow',
_______ customer details (name, email, mobile, 'bairstow@user,com',
city) ______ ( 'Bairistow', 'bairstow@user,com', '9876543219', 'Chennai')
'9876543219', 'Chennai')
5 Enter the query to Set the value of UPDATE customer details SET
the City columns to 'Oslo', but only the ones city='Oslo' WHERE
where the name column has the value name="Bairistow"
"Bairistow". ?
6 Enter the query to delete all data in the customer DELETE FROM customer
details table ? details
8 Enter the query to delete 'city' column from ALTER TABLE customer
customer details table ? details DROP COLUMN city
Tables:
3. Create a table for storing only food information in a food ordering app
Database:
Create a set of tables for each database in the following requirement:
1. Create a database with a set of tables for online grocery store management
To learn more :
SQL Tutorial Links : https://www.w3schools.com/sql/default.asp
SQL Exercise Links : https://www.w3schools.com/sql/exercise.asp?
filename=exercise_select1
WITH FROM
www.macappstudiobridge.com