हिंदी

CBSE solutions for कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ chapter 2 - Structure Query Language [Latest edition]

Advertisements

Chapters

Unit -1 : Review of Phython & Concept of Oops

    1: Review of Phython

    2: Concept of Object Oriented Programming

    3: Classes in Python

    4: Inheritance

Unit -2 : Advanced Programming with Python

    1: Liner List Manipulation

    2: Stacks & Queues in list

    3: Data File Handling

    4: Exception Handling & Generate Functions

Unit -3 : Databases Management Systems and SQL

    1: Databases Concepts and SQL

▶ 2: Structure Query Language

Unit -4 : Introduction to Boolean Algebra

    1: Boolean Algebra

    2: Boolean Functions and Reduce Forms

   Chapter 3: Application of Boolean Logic

Unit -5 : Communication Technologies

   Chapter 1: Networking Concepts Part I

   Chapter 2: Networking Concepts Part II

   Chapter 3: Networking Protocols

   Chapter 4: Mobile Telecommunication Technologies, Network Security and Internet Services

CBSE solutions for कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ chapter 2 - Structure Query Language - Shaalaa.com
Advertisements

Solutions for Chapter 2: Structure Query Language

Below listed, you can find solutions for Chapter 2 of CBSE CBSE for कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२.


EXERCISE
EXERCISE [Pages 196 - 202]

CBSE solutions for कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ 2 Structure Query Language EXERCISE [Pages 196 - 202]

1.Page 196

Mr. Rohan has created a table 'student' with rollno., name, class and section. Now he is confused to set the primary key. So identify the primary key column.

2.Page 196

Ms. Ravina is using a table 'customer' with custno, name, address and phonenumber. She needs to display name of the customers, whose name start with letter 'S'. She wrote the following command, which did not give the result.

Select * from customer where name="S%";

Help Ms. Ravina to run the query by removing the errors and write the correct query.

3.Page 196

Write SQL query to add a column totalprice with data type numeric and size 10, 2 in a table product.

4.Page 196

The name column of a table 'student' is given below.

Name
Anu Sharma
Rohan Saini
Deepak Sing
Kannika Goal
Kunal Sharma

Based on the information, find the output of the following queries:

→ Select name from student where name like "%a";

→ Select name from student where name like "%h%";

5.Page 196

A customer table is created with cno,cname, and address columns. Evaluate the following statement whether it is correct or not?

Delete cname from customer;

6.Page 196

Shopkeeper needs to change the first name of one of his customers in table 'customer'. Which command should he use for the same?

7.Page 196

Sonal needs to display name of teachers, who have "o" as the third character in their name. She wrote the following query.

Select name
From teacher
Where name ="$$o?";

But the query is not producing the result. Identify the problems.

8.Page 197

Pooja created a table 'bank' in SQL. Later on, she found that there should have been another column in the table. Which command is used to add column to the table?

9.Page 197

Surpreeth wants to add two more records of customer in customer table. Which command is used to implement this?

10.Page 197

Deepak wants to remove all rows from the tableBank. But he needs to maintain the structure of the table. Which command is used to implement the same?

11.Page 197

While creating table 'customer', Rahul forgot to add column 'price'. Which command is used to add new column in the table. Write the command to implement the same.

12.Page 197

Write the syntax of creating table command.

13.Page 197

Write the syntax of dropping table command.

14.Page 197

What all are the clause possible in select statement.

15.Page 197

What is the default value of order by command.

16.Page 197

Differentiate between delete and drop table command.

17.Page 197

Differentiate between update and alter table command.

18.Page 197

Differentiate between order by and group by command.

19. a)Page 197

Define the following:

Union

19. b)Page 197

Define the following: 

Cartesian product

19. c)Page 197

Define the following.

Equi Join

19. d)Page 197

Define the following.

Non equi join.

20.Page 197

What is the use of wildcard?

21.Page 197

Create the following table items.

Column name Data type Size Constrain
Itemno Number 3 Primary key
Iname Varchar 15  
Price Number 10,2  
Quantity Number 3  
22.Page 198

Insert the following information:

Table: Item

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100
23. a)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display all items information.

23. b)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display item name and price value.

23. c)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display soap information.

23. d)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display the item information whose name starts with letter 's'.

23. e)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display a report with item number, item name and total price. (total price = price * quantity).

23. f)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display item table information in ascending order based upon item name.

23. g)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display item name and price in descending order based upon price.

23. h)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Display item name, whose price is in between 50 to 100.

23. i)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Add new column totalprice with number (10, 2).

23. j)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Increase price value by 100.

23. k)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Fill up totalprice = price*quantity

23. l)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Remove powder information.

23. m)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Remove totalprice column.

23. n)Page 198

Write query based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

Remove whole item structure.

24. a)Page 198

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select sum(price) from item;

24. b)Page 198

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select avg(price) from item;

24. c)Page 198

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select min(price) from item;

24. d)Page 198

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select max(price) from item;

24. e)Page 198

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select count(price) from item;

24. f)Page 198

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select distinct price from item;

24. g)Page 198

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select count(distinct price) from item;

24. h)Page 199

Write output based upon item table given.

Itemno Iname Price Quantity
101 Soap 50 100
102 Powder 100 50
103 Face cream 150 25
104 Pen 50 200
105 Soap box 20 100

select iname,price*quantity from item;

25.Page 199

In a database there are two tables - 'Brand' and 'Item' as shown below:

BRAND:

ICODE BNAME
100 SONY
200 HP
300 LG
400 SAMSUNG

ITEM:

ICODE INAME PRICE
100 TELEVISION 25000
200 COMPUTER 30000
300 REFRIGERATOR 23000
400 CELL PHONE 40000

Write MYSQL queries for the following:

  1. To display Iname, price and corresponding Brand name (Bname) of those items, whose price is between 25000 and 30000 both values inclusive).
  2. To display ICode, Price and BName of the item, which has IName as "Television".
  3. To increase the Prices of all items by Rs. 10%.
26.Page 199

Create the following table.

Students

Column name Data type Size Constraints
Adno Integer 3 Primary key
Name Varchar 20  
Average Integer 3  
Sex Char 1  
Scode Integer 4  
27.Page 200

Insert the following information:

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222
28. i)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display all students' information.

28. (ii)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display Rohan Saini's information.

28. (iii)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display number of students in the table.

28. (iv)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display number of students in each sex.

28. (v)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display students' information in ascending order using name.

28. (vi)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display students' information in descending order using average marks.

28. (vii)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display students' name starting with letter "K".

28. (viii)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display students' information, whose name ends with "l".

28. (ix)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display a report with adno,name,average*5 as total marks from student table.

28. (x)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display students' information, whose average marks are in between 80 to 90.

28. (xi)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display students' info., who are getting average marks of more than 80 and scode 333.

28. (xii)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display students' name and average marks, whose scode is 222 and 333.

28. (xiii)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display sum of average marks.

28. (xiv)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display maximum average marks.

28. (xv)Page 200

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display minimum average marks.

28. (xvi)Page 201

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display average value of average marks.

28. (xvii)Page 201

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display maximum, minimum and sum of average marks in each scode.

28. (xviii)Page 201

Write query based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Display number of students in each scode.

29.Page 201

Create the following table.

Column name Data type Size Constraints
Scode Integer 3 Primary key
Sname Varchar 20  
Place Varchar 10  
30.Page 201

Insert the following information.

Streams

Scode Sname Place
111 Science SBlock
222 Commerce CBlock
333 Humanity HBlock
444 Art ABlock
31.Page 201

Write queries based upon item table given.

Students

Adno Name Average Sex Scode
501 R.Jain 98 M 111
545 Kavita 73 F 333
705 K.Rashika 85 F 111
754 Rahul Goel 60 M 444
892 Sahil Jain 78 M 333
935 Rohan Saini 85 M 222
955 Anjali 64 F 444
983 Sneha Aggarwal 80 F 222

Streams

Scode Sname Place
111 Science SBlock
222 Commerce CBlock
333 Humanity HBlock
444 Art ABlock
  1. To display Adno, Name, Sex and Average from Student's table and Stream name (Sname) and place from Stream table with respect to Scode.
  2. Add the following information into the student table.
    999 Deepak Sharma  83   M   2222
  3. Display science stream students' information.
32. (i)Page 201

Give the output of the following SQL query.

Select sum(Average)
From students
Where sex='M';
32. (ii)Page 202

Give the output of the following SQL query.

Select distinct (Scode)
From students;
33.Page 202

Remove 111 scode information.

34.Page 202

Add new column state with varchar(10).

35.Page 202

Increment 2 marks for 444 scode info.

36.Page 202

Remove column state.

37.Page 202

Remove the whole table stream.

Solutions for 2: Structure Query Language

EXERCISE
CBSE solutions for कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ chapter 2 - Structure Query Language - Shaalaa.com

CBSE solutions for कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ chapter 2 - Structure Query Language

Shaalaa.com has the CBSE Mathematics कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ CBSE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. CBSE solutions for Mathematics कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ CBSE 2 (Structure Query Language) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.

Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. CBSE textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.

Concepts covered in कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ chapter 2 Structure Query Language are .

Using CBSE कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ solutions Structure Query Language exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in CBSE Solutions are essential questions that can be asked in the final exam. Maximum CBSE कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ students prefer CBSE Textbook Solutions to score more in exams.

Get the free view of Chapter 2, Structure Query Language कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ additional questions for Mathematics कम्प्यूटर साइंस विद पाइथान [अंग्रेजी] कक्षा १२ CBSE, and you can use Shaalaa.com to keep it handy for your exam preparation.

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×