Imran
Imran
ID : 20234103367
Intake: 52
Section: 10
DBMS
(LAB => 1)
1.
CREATE DATABASE Imran367;
2.
CREATE TABLE Customer(
CustomerID int(5),
CustomerName varchar(15),
PurchaseIteam varchar(15),
Address varchar(10),
PostalCode int(10),
PhoneNumber int(15)
);
3.
INSERT INTO customer
VALUES
(3,'Sanjila Islam','Kurti','UttarKhan',1106,0171748367),
2.
Delete PostalCode column.
=>
ALTER TABLE customer
DROP COLUMN PostalCode
=>
UPDATE customer
set PurchaseIteam='shirt'
WHERE CustomerID=3;
SELECT CustomerGrade
FROM customer
WHERE CustomerGrade='gold'
WHERE Grade='Gold';
2. Find out the information of customer who purchase “Wallet”
SELECT * FROM customer
WHERE PurchaseIteam='Wallet';
SELECT PhoneNumber
FROM customer
SELECT CustomerID,Address,Grade
FROM customer
5. Find out the grade of customer who purchage “bed sheet” and whose grade
is “silver”.
6.Find out the name of customer whose postal code is “1106” or whose id is “6”.
SE SELECT CustomerName FROM customer
WHERE PostalCode=1106 || CustomerID=6;
7. Find out the information of customer whose name start with “M”.
SELECT * FROM customer
WHERE CustomerName LIKE 'M%';
8. Find out the information of customer whose name end with “M”.
SELECT * FROM customer
WHERE CustomerName LIKE '%M';
9. Find out the information of customer whose name contain “M” in second position.
SELECT * FROM customer
WHERE CustomerName LIKE '_M%'