The document is an assignment for Class XI Informatics Practices at Delhi Public School Bhopal, issued in December 2015-2016. It includes various SQL-related questions and tasks involving library and teacher tables, such as selecting, updating, and deleting records, as well as creating a new table for Employee. The assignment requires students to demonstrate their understanding of SQL queries and database management concepts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views4 pages
Assignment SQL 2015-16
The document is an assignment for Class XI Informatics Practices at Delhi Public School Bhopal, issued in December 2015-2016. It includes various SQL-related questions and tasks involving library and teacher tables, such as selecting, updating, and deleting records, as well as creating a new table for Employee. The assignment requires students to demonstrate their understanding of SQL queries and database management concepts.
Name: ______________________________________________________ Roll No______________ Class_______ Sec_________
Q. 1 See the table Library given below and answer the questions:-
S_no Title Author Type Pub Qty Price
1 Data Structure Lipchutz DS McGraw 4 217
2 Computer Studies French FND Galgotia 2 75
3 Advanced Pascal Schildt PROG McGraw 4 350
4 Dbase dummies Palmer DBMS Pustak M 5 130
5 Mastering C++ Gurewich PROG BPB 3 295
6 Guide Network Freed NET Z Press 3 200
7 Mastering Foxpro Seigal DBMS BPB 2 135
8 DOS Guide Norton OS PHI 3 175
9 Basic for Beginners Morton PROG BPB 3 40
10 Mastering Window Cowart OS BPB 1 225
a. Select all the PROG type published by BPB from library.
b. Display a list of all books with Price more than 130 and sorted by Qty. c. Write a query to add one new date column orderdate. d. Display all the books sorted by price in ascending order. e. Display title, type, price of those books which have title starting with D from library. f. Write a query to increase price by 100 where price is less than 100. g. Write a query to add not null constraint for column orderdate. h. Select price*2 as “New Price” from library. i. Select Distinct (type) from library. j. Select mod (price, 2) from library where qty>3 and pub=’McGraw’. k. Update library set qty=qty+5; l. Delete from library where pub=’Pustak M’; m. Write a query to delete the table.
Q. 2 See the table Teacher given below and answer the questions:-
No Name Age Department Dateofjoin Salary Gender
1 Jugal 34 Computer 10/01/97 12000 M
2 Sharmila 31 History 24/03/98 20000 F
3 Sandeeep 32 Maths 12/12/96 30000 M
4 Sangeeta 35 History 01/07/99 40000 F
5 Rakesh 42 Maths 05/09/97 25000 M
6 Shyam 50 History 27/06/98 30000 M
7 Shiv Om 44 Computer 25/02/97 21000 M
8 Shalakha 33 Maths 21/07/97 20000 F
a. Select all the name of teachers who belong to department history.
b. Display a list of all teachers whose age is greater than 35 sorted by age. c. Display all the teachers sorted by salary in ascending order. d. Display name, department, salary which have name ending with a. e. Write a query to add one new date column DOB. f. Write a query to increase salary by 1000 where dateofjoin is before 01/01/97. g. Write a query to add not null constraint for column DOB. h. Select name, reverse (name) from teacher. i. Select Distinct (department) from teacher. j. Select dayofweek (dateofjoin) from teacher where gender=’F’ and age<35. k. Update teacher set salary=salary+500; l. Delete from teacher where age>=50; m. Write a query to delete the table.
Q. 3 Give the output of the following:-
1. Select curdate() + 2; (consider curdate is 2015/12/30)
1. Write a SQL command for displaying current date and time.
2. Write a SQL command for displaying length of string, technology. 3. Write a SQL command for displaying the result of the expression 24 mod 13. 4. Write a SQL command for displaying sqrt of 625. 5. Write a SQL command for displaying the reverse of your name.
Q. 5 Create table Employee as per following instructions:-