0% found this document useful (0 votes)
3 views1 page

Assignment2 Ans

Uploaded by

khanoreshruti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Assignment2 Ans

Uploaded by

khanoreshruti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

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';

You might also like