VARCHAR(25) NOT NULL,
C_Email VARCHAR(30) NOT NULL,
C_Address VARCHAR(20) NOT NULL,
C_City VARCHAR(15) NOT NULL,
C_State VARCHAR(15) NOT NULL,
C_ZIP VARCHAR(10) NOT NULL);
-- 2. Insert 5 new records into the table
INSERT INTO Customer (C_Id, First_Name, Last_Name, C_Email, C_Address, C_City,
C_State, C_ZIP)
VALUES
(001, 'Bankim', 'Chaterjee', '
[email protected]', 'Dumdum',
'Kolkata', 'West Bengal', 700028),
(002, 'Jose', 'Batista', '
[email protected]', 'Retiro', 'Madrid',
'Madrid', 055430),
(003, 'Gilly', 'Adams', '
[email protected]', 'Japantown', 'San Jose',
'California', 140596),
(004, 'Bhagat', 'Singh', '
[email protected]', 'N.M.Town', 'Jalandhar',
'Punjab', 144001),
(005, 'Krishna', 'Duvvada','
[email protected]', 'Vajrapukotturu',
'Srikakulam', 'Andhra Pradesh', 532222);
-- 3. Select only the ‘first_name’ and ‘last_name’ columns from the customer
table
SELECT First_Name, Last_Name
FROM Customer;
-- 4. Select those records where ‘first_name’ starts with “G” and city is ‘San
Jose’.
SELECT *
FROM Customer
WHERE First_Name LIKE 'G%'
AND
C_City= 'San Jose';
-- 5. Select those records where Email has only ‘gmail’.
SELECT *
FROM Customer
WHERE C_Email LIKE '%gmail%';
-- 6. Select those records where the ‘last_name’ doesn't end with “A”.
SELECT *
FROM Customer
WHERE Last_Name NOT LIKE '%a';