# [Type B] Chapter 14 Sumita Arora Solutions | Class 12 Computer Science

Here is class 12 computer science [TYPE B] Unit 14 solutions for Sumita Arora back exercise assignment. Below includes both textual and video solutions wherever required. View all the answers in assignment for chapter 14 and for all chapters here.

Watch all tutorials for chapter 12.

Refer this Data for Question 1 to 10
Q1. Which SQL statement allows you to find the highest price from the table BOOK_INFORMATION?

#### Solution:

`(b) SELECT MAX(PRICE) FROM BOOK_INFORMATION;`
Q2. Which SQL statement lets you find the sales amount for each store?

#### Solution:

`(c) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE ID;`
Q3. Which SQL statement lets you list all stores whose total sales amount is over 5000?

#### Solution:

```(c) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES
WHERE SUM(SALES_AMOUNT)>500 0GROUP BY STORE_ID;```
Q4. Which SQL statements lets you to find the total number of stores in the SALES table?

#### Solution:

```(b) SELECT COUNT(DISTINCT STORE_ID) FROM SALES;
```
Q5. Which SQL statements allows you to find the total sales amount for Store ID 25 and the total sales amount for Store ID 45?

#### Solution:

```(d) SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES
WHERE STORE_ID=25 AND STORE_ID=45 GROUP BY STORE_ID;```
Q6. Which SQL statements do we use to find the average exam score for EXAM_ID = 1?

#### Solution:

`(c) SELECT AVG(EXAM_SCORE) FROM EXAM_RESULTS GROUP BY EXAM_ID HAVING EXAM_ID =1;`
Q7. Which SQL statements do we use to find out how many students took each exam?

#### Solution:

`(a) SELECT COUNT(DISTINCT STU_ID) FROM EXAM_RESULTS GROUP BY EXAM_ID;`
Q8. Which SQL statements do we use to print out the record of all students whose last name starts with ‘L’?

#### Solution:

`(a) SELECT * FROM EXAM_RESULTS WHERE LNAME LIKE 'L%';`
Q9. What is the result of the following SQL statements?

#### Solution:

`(d) 95`
Q10. Given the following table?

#### Solution:

```(i) 4
(ii) 34
(iii)  35.33
(iv)  7800```
Q11. Given the following table?

#### Solution:

```(i) 64.4
(ii) 1150.00
(iii)  475.00
(iv)  Error```
Q12. In the Dataset, there are two table given below?

#### Solution:

```(i) SELECT employeeid, name, jobtitle from EMPLOYEE, JOB
WHERE EMPLOYEE.jobid = JOB.JOBID ;

(ii) SELECT name, sales, jobtitle from EMPLOYEE, JOB
WHERE EMPLOYEE.jobid = JOB.JOBID and EMPLOYEE.sales>1300000 ;

(iii) SELECT name, jobtitle from EMPLOYEE, JOB
WHERE EMPLOYEE.jobid = JOB.JOBID and EMPLOYEE.name LIKE "%SINGH%" ;

(iv) JOBID

(v) UPDATE EMPLOYEE
set jobid = 104
WHERE employeeid is "E4";```
Q13. Show the average salary for all departments with more than 3 people for a job.
```SELECT avg(salary), departments from JOB
where COUNT(DISTINCT departments) >3;```
Q14. Display only the jobs with maximum salary greater than or equal to 3000.
```SELECT job from JOB
where max(salary) >= 3000 ;```
Q15. Find out number of employees having “Manager” as job.
```SELECT COUNT(jobs) from JOB
where jobs is "Manager" ;```
Q16. List the count of employees grouped by deptno. (table EMPL)
```SELECT COUNT(employees) from EMPL
GROUP BY deptno ;```
Q17. List the sum of employees salaries grouped by department. (table EMPL)
```SELECT COUNT(salaries) from EMPL
GROUP BY department ;```
Q18. List the maximum salary of employee grouped by their department number (table EMPL)
```SELECT MAX(salaries) from EMPL
GROUP BY dept_num ;```
Q19. List the total customers orders grouped by customer id.
```SELECT COUNT(order) from CUSTOMERS
GROUP BY id ;```
Q20. List all the customers (name) who have orders.
`SELECT name from CUSTOMERS;`
Q21. List the sum of the totals of orders grouped by customer and slate.
```SELECT SUM(orders) from CUSTOMERS
GROUP BY customer;```
Q22. List the sum of the totals of orders where this sum is greater than \$1000 grouped by customer(id) and state and ordered by slate.
```SELECT SUM(orders) from CUSTOMERS
where sum(orders)>1000
GROUP BY id
ORDER by slate;```
Q23. List the customers (name) and their orders’details.
`SELECT name, order from CUSTOMERS;`
Q24. List the customers (name) and the total amount of all their orders
`SELECT name, sum(order) from CUSTOMERS;`
Q25. List the department names and the number of their employees.
`SELECT DeptName from Dept;`
Q26. List the employee names and the department names and the number of their employees.
`SELECT Emp_name, DeptName,  from EMPL, Dept;`

Clear Doubts with Computer Tutor
In case you’re facing problems in understanding concepts, writing programs, solving questions, want to learn fun facts | tips | tricks or absolutely anything around computer science, feel free to join CTs learner-teacher community: students.computertutor.in