Miel DB Lab Report 368
Miel DB Lab Report 368
Lab 1
--------------------------------
Input :
USE miel368;
(CustomerName Varchar(100),
CustomerID int ,
Purchase_Item Varchar(100),
Address Varchar(100),
PostalCode int ,
Phone_Number int
);
Output:
Input:
INSERT INTO Customer (
CustomerName,
CustomerID,
Purchase_Item,
Address,
PostalCode,
Phone_Number
VALUES
Output:
Lab 2
--------------------------------
Input :
USE miel368;
Output:
USE miel368;
ALTER TABLE Customer
USE miel368;
UPDATE Customer
USE miel368;
USE miel368;
Lab 3
--------------------------------
The Table :
CustomerName VARCHAR(100),
Purchase_Iteam VARCHAR(50),
Address VARCHAR(100),
PostalCode INT,
Phone_Number VARCHAR(15),
Grade VARCHAR(20)
);
VALUES
(4, 'Sharifa Begum', 'Bed Sheet', 'Sector 7', 1108, '0191745388', 'Silver'),
(6, 'Monowara Akter', 'Ear Ring', 'Mirpur 12', 1217, '0151845366', 'Gold');
1. Find out the “Gold” customer.
USE miel368;
5. Find out the grade of customer who purchage “bed sheet” and whose grade is “silver”.
USE miel368;
SELECT Grade
FROM Customer
WHERE Purchase_Iteam = 'Bed Sheet' AND Grade = 'Silver';
6. Find out the name of customer whose postal code is “1106” or whose id is “6”.
USE miel368;
SELECT CustomerName
FROM Customer
WHERE PostalCode = 1106 OR CustomerID = 6;
7. Find out the information of customer whose name start with “M”.
USE miel368;
SELECT *
FROM Customer
WHERE CustomerName LIKE 'M%';
8. Find out the information of customer whose name end with “M”.
USE miel368;
SELECT *
FROM Customer
WHERE CustomerName LIKE '%M';
9. Find out the information of customer whose name contain “M” in second position.
USE miel368;
SELECT *
FROM Customer
WHERE CustomerName LIKE '_M%';
10. Find out the information of customer whose name is “Sanjila Islam”.
USE miel368;
SELECT *
FROM Customer
WHERE CustomerName = 'Sanjila Islam';
Lab 4
--------------------------------
USE Student1;
Student_ID int,
Name Varchar(100),
Age int ,
Major Varchar(100)
);
Then
USE Student1;
Course_ID int,
Creadits int,
Instructor_ID int
);
Then
USE Student1;
Enrolment_ID int,
Student_ID int,
Course_ID int,
);
1. To Fetch The name and age of students who are majoring in cs.
USE Student1;
Student_ID ,
Name ,
Age ,
Major
) VALUE
(368,'Sifat',21,'Computer Science'),
(378,'Easin',70,'Operating System'),
(372,'Anas',23,'Networking'),
(388,'Ador',21,'Computer Science');
Then
Output:
2. To Retrieve Name of all Students who are enrolled in either Database System or ai ,
4. input:
USE Student1;
SELECT * FROM Students WHERE Name LIKE '__j%' and Name LIKE'%n';
Output : Null
5.Input :
USE Student1;
Outpur:
Lab 5
--------------------------------
Name : Sifat
USE Sifat;
(Customer_Name Varchar(100),
Customer_Id int,
Address Varchar(100),
Price int
);
Insert Data :
USE Sifat;
(Customer_Name,
Customer_Id ,
Address ,
Price )
VALUES
('Miel',68,'Mirpur',250),
('Mahedi',96,'uttorA',1000),
('Sadia',70,'Lalkhuthi',5),
('Anas',34,'H Block',48),
('Easin',35,'C Block',45);
The Table:
Between:
USE Sifat;
Output:
IN:
USE Sifat;
Output:
NOT IN :
USE Sifat;
Output:
Group By:
USE Sifat;
FROM Sifat1
GROUP BY Customer_Name;
ASE:
USE Sifat;
Output :
DSEC:
USE Sifat;
USE Sifat;
LIMIT 1 OFFSET 1 ;
USE Sifat;
LIMIT 1 OFFSET 2 ;
MIN;
USE Sifat;
MAX:
USE Sifat;