23027119-056 DB Quiz
23027119-056 DB Quiz
select*from SalesRepc
List the name and hire date of anyone with sales over
50000:
SELECT SalRep_name, Hiredate
FROM SalesRepc
WHERE Sales > 50000;
2.Show me the result if I raised each person's quota by
3 percent of their year to date sales:
insert into
Customerm(Customer_id,customer_name,company,creditLimit,address
,sal_rep_id)
values
(201,'ali','xyz pvt.ltd',40000,'123 main st karachi',0001),
(202,'hassan','abc ltd',50000,'456 first st lahore',0002),
(203,'hamza','pqr corporation',60000,'789 second st islamabad',0003)
select*from Customerm
List all the customers whose name starts with 'A' or 'a':
SELECT customer_name
FROM Customerm
WHERE customer_name LIKE 'A%' OR customer_name LIKE 'a%';
insert into
SalesRepg(sal_rep_id,SalRep_name,office_id,title,age,hiredate,manage
r,quota,sales,target)
values
(01,'ali',101,'sales manager',35,'2023-03-14',null,40000,45000,50000),
(02,'hassan',102,'senior sales executive',36,'2024-05-
15',2001,55000,60000,65000),
(03,'shazal',103,'sales executive',23,'2024-05-
08',2002,30000,35000,40000)
select*from SalesRepg
insert into
Customerg(Customer_id,customer_name,company,creditLimit,address,
sal_rep_id)
values
(201,'ali','xyz pvt.ltd',40000,'123 main st karachi',0001),
(202,'hassan','abc ltd',50000,'456 first st lahore',0002),
(203,'hamza','pqr corporation',60000,'789 second st islamabad',0003)
6. selectList orders over 2500, including the name of the sales person
who took the order and the name of the customer who placed it:
insert into
SalesRepk(sal_rep_id,SalRep_name,office_id,title,age,hiredate,manager
,quota,sales,target)
values
(01,'ali',101,'sales manager',35,'2023-03-14',null,40000,45000,50000),
(02,'hassan',102,'senior sales executive',36,'2024-05-
15',2001,55000,60000,65000),
(03,'shazal',103,'sales executive',23,'2024-05-
08',2002,30000,35000,40000)