Skip to main content

Assignment On SQL - XII CS

Assignment on SQL
1.     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%";

2.     Shopkeeper needs to change the first name of one of his customers in table 'customer'. Which command should he use for the same?
3.     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.
4.     Surpreeth wants to add two more records of customer in customer table. Which command is used to implement this?
5.     Differentiate between delete and drop table command.
6.     Differentiate between update and alter table command.
7.     Differentiate between order by and group by command.
8.  Create the following table items.

Column Name
Data Type
Size
Constraints
Itemno
Number
3
Primary Key
Iname
Varchar
15

Price
Number
10,2

Quantity
Number
3









9.     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



10. Write queries based upon item table given in q. no 9
a) Display all items information.
b) Display item name and price value.
c) Display soap information.
d) Display the item information whose name starts with letter 's'.
e) Display a report with item number, item name and total price. (total price = price * quantity).
f) Display item table information in ascending order based upon item name.
g) Display item name and price in descending order based upon price.
h) Display item name, whose price is in between 50 to 100.
i) Add new column totalprice with number (10, 2).
j) Increase price value by 100.
k) Fill up totalprice = price * quantity.
l) Remove powder information.
m) Remove totalprice column.
n) Remove whole item structure.
10. Write outputs based upon item table given in q. no 9.
a) select sum(price) from item;
b) select avg(price) from item;
c) select min(price) from item;
d) select max(price) from item;
e) select count(price) from item;
f) select distinct price from item;
g) select count(distinct price) from item;
h) select iname,price*quantity from item;

Popular posts from this blog

Project Work for Class XII Informatics Practices (065) - CBSE 2020-2021

  Marks  allotted : 05 Marks A. PROJECT GUIDELINES The aim of the class project is to create tangible and useful IT application. The learner may identify a real-world problem by exploring the environment. e.g. Students can visit shops/business places, communities or other organizations in their localities and enquire about functioning of the organization, and how data are generated, stored, and managed. The learner can take data stored in csv or database file and analyze using Python libraries and generate appropriate charts to visualize. If an organization is maintaining data offline, then the learner should create a database using MySQL and store the data in tables. Data can be imported in Pandas for analysis and visualization. Learners can use Python libraries of their choice to develop software for their school or any other social good. Learners should avoid plagiarism and violation of copyright issues while working on projects. Any resources (data, image etc.) used in t...

Assignments - XII Computer Science

POINTERS ASSIGNMENT Assignment Date: 09/09/15 Submission Date: 14/09/15 Q1. What will be the output of the following program: int main() { int x [ ] = { 50, 40, 30, 20, 10}: int *p, *t; p = x; t = x + 1; cout << *p << “,” << *t++; return 0; } Q2. What will be the output of the program( Assume all necessary header files are included) void print (char * p ) { p = "Comp"; cout<<"value is "<<p<<endl; } int main( ) { char * x = "Class XII"; print(x); cout<<"new value is "<<x<<endl; return 0; } Q3. Identify errors on the following code segment, and underline the error. float c[ ] ={ 1.2,2.2,3.2,56.2}; float *k,*g; k=c; g=k+4; k=k*2; g=g/2; cout<<”*k=”<<*k<<”*g=”<<*g; Q4. Write the output of the following program. void print (char * p ) { p = "Comp"; cout<<"valu...