-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathData_Manipulation_Queries.sql
22 lines (16 loc) · 1.07 KB
/
Data_Manipulation_Queries.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- ****************************************************************************
-- SOME SIMPLE CURD STATMENT TO MANIPULATE THE Customers TABLE.
-- display all data from the Customers table
SELECT customerID, Fname, Lname, customerEmail, customerAddress, customerPhone FROM Customers
-- display a single customer's first name and last name by id
SELECT Fname, Lname, FROM Customers WHERE customerID = :ENTER_CUSTOMER_ID
-- display data with different title
SELECT customerID, Fname, Lname AS Customer_ID, First_Name, Last_name FROM Customers
-- add a new customer
INSERT INTO Customers (customerID, Fname, Lname, customerEmail, customerAddress, customerPhone)
VALUES (:inputCustomerID, :inputFname, :inputLname, :inputCustomerEmail, :inputCustomerAddress, :inputCustomerPhone)
-- update a customer's phone number based on customerID
UPDATE Customers SET customerPhone = :inputCustomerPhone WHERE customerID = :ENTER_CUSTOMER_ID
-- Delete all customer
DELETE FROM Customers WHERE customerID = :ENTER_CUSTOMER_ID
-- ****************************************************************************