12 Worksheet

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

CLASS XII

INFORMATION TECHNOLOGY (802)


WORKSHEET -1
TOPIC : STRUCTURED QUERY LANGUAGE (SQL)

Write SQL Commands to perform the following and execute them

1 Create a table EMPLOYEE with the following


fields EmpNo integer
Name 20 characters
Dept 20 characters
Salary Decimal (10,2)

Ensure that the following constraints are met :


 Empno is the Primary Key
 Default value of Salary is 2000
 Dept should be any of the values given below - “Accounts”, “Sales”,
“Production”, “Stores”.
2 Insert the details of 5 employees.
EMPNO NAME DEPT SALARY
1002 Varun Sales 30000
1003 Devesh Accounts 34000
1004 Krishnan Sales 25000
1005 Abdul Stores 38000
1006 Arun Production 35000

3 Display the structure and contents of the entire table.


4 Display in the following format
Ajay gets a salary 2000 for the employees in Accounts Department.
5 Display the various departments from the table.
6 Add a Column bonus of data type Decimal(8,2)..
7 Compute the bonus as 20% of the salary.
8 Add a Column NetPay of type Decimal(10,2).
9 Compute Netpay as salary + bonus.
10 Display the names of the employees whose salary is in the range 20,000 – 50,000.
11 Display the details of employees whose name ends with the letter ‘n’.
12 Display the names of the employees whose name is starting with letter ‘A’.
13 Display the department and salary of employees having exactly 5 letters in the name.
14 Display the details of employees who have the letter combination ‘sh’ in their name.
15 Change the data type of Dept to 12 characters.
16 Delete the details of the employees from Sales Department.
17 Drop the column Bonus from the table.
18 Drop the default value for Salary.
19 Add a new default value for salary as 3500.
20 Delete the table.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy