Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

SUMMER HOLIDAY HOMEWORK

SUBJECT- IP
GRADE-11
Note:
 This is the assignment that is based on Unit-4’Database Concepts and SQL’.
 Students have to do holidays homework in IP notebook.
Q1. Fill in the blanks:
1. Repetition of data in a database is called data _______.
2. A group of column working as a primary key is called _________ key.
3. To remove duplicate rows from the result of a query, specify the SQL qualifier ________ in
select list.
4. Columns can be sorted in descending sequence by using the SQL keyword_________.
5. ________ command removes all tables, indexes, and constraint from the database.
Q2. State True/False:
1. In an Alter statement, Modify clause is used to look for a certain pattern in a column.
2. By default, the ORDER BY clause sorts the data in ascending order.
3. The keyword LIKE can be used in a WHERE clause to refer to a range of values.
4. ORDER BY can be combined with the SELECT statements.
5. The two wildcards, % and _, are used with the LIKE operator.
Q3: Answer the following questions:
1. Explain the role of the LIKE operator in SQL.
2. Write the use of the DELETE and DROP commands.
3. What is the purpose of the following clauses in a select statement?
a. ORDER BY b. WHERE Clause
4. Differentiate between the following commands:
a. ALTER and UPDATE b. DELETE and DROP
Q4: Activity Time:
1. Write the queries of the following on the basis of given table:
Table: FACULTY
F_id Fname Fsal DOJ

101 Akshay 25000 12-10-80

102 Aarti 34000 10-02-90

103 Sunny 45000 23-07-93

104 Sushma 22000 19-09-97

105 Sunaina 43000 09-07-00

a. Display the details of faculties who had joined after 1990.


b. Display the details of faculties whose salary is more than 20000.
c. Show the name of faculties whose DOJ is 12-10-1980
d. Display the name of faculties whose name start with letter ‘A’.
e. Display the name of faculties whose salary is greater than 25000 and name ends with the
letter ‘n’.

2. Create table Employee with the following structure:


Name of Column ID First_Name Last_Name User_ID Salary

Type Integer Varchar(30) Varchar(30) Varchar(10) Float

Ensure the following specification in created table:


1. ID should be declared as Primary Key 2. User_ID should be unique
3. Salary must be greater than 5000 4. First_Name and Last_Name must not remain
blank.

3. A table ‘EMP’ is already created in a database and few records are entered in the table. The
datails of the table are shown below:
EmpCode Name Dept Salary Phnum

E001 Goutam Elect 42000 0112345678

E002 Ashim Das IT 48000 0117656783

E003 Shivam IT 35000 0118745637

E004 Vikram Mech 41000 0117834261

E005 Deepak Elect 38000 0119875643

Now, perform the given tasks as directed:


(a) Modify name of the employee with EmpCode ‘E003’ to Shivam Gupta.
(b) Increase the salary of all the employee who get less than 40000 by 2000.
(c) Modify the ‘Dept’ of the employee with EmpCode ‘E004’ to ‘Elect’.
(d) Correct the name of the employee with EmpCode ‘E002’ to Abhishek Das.
(e) Chanfe the phnum of the employee with EmpCode ‘E005’ to 0114532786.

You might also like