1.
Create a customer table which comprises of these columns: ‘customer_id’,
‘first_name’, ‘last_name’, ‘email’, ‘address’, ‘city’,’state’,’zip’
2. Insert 5 new records into the table
3. Select only the ‘first_name’ and ‘last_name’ columns from the customer
table
4. Select those records where ‘first_name’ starts with “G” and city is ‘San
Jose’.
5. Select those records where Email has only ‘gmail’.
6. Select those records where the ‘last_name’ doesn't end with “A”.
CREATE TABLE CUSTOMER
(customer_id INT,
first_name VARCHAR(100),
last_name VARCHAR(100),
email VARCHAR(20),
address VARCHAR(100),
city VARCHAR(20),
state VARCHAR(20),
zip INT);
INSERT INTO CUSTOMER(customer_id, first_name, last_name, email, address,
city,state,zip)
VALUES(001,SHRUTI,K,
[email protected],,MUMBAI,MAHARASHTRA,422776);
SELECT first_name, last_name FROM CUSTOMER;
SELECT * FROM CUSTOMERS first_name LIKE 'G%' AND city = 'San jose';
SELECT * FROM CUSTOMERS WHERE gmail LIKE '%gmail%';
SELECT * FROM CUSTOMER WHERE last_name NOT LIKE '%A';