You are on page 1of 5

1.

) P_ID Name Consider


Design the table
Salary Allowance
Personal given below:
Table: Personal
` P01 Rohan Manager 89000 4800

P02 Arjun Clerk NULL 1600

P03 Mahesh Supervisor 48000 NULL

P04 Sahel Clerk 31000 1900

P05 Ravi Supervisor NULL 2100

Increase the salary by 5% of personals whose allowance known.

2.) Display Name and Total Salary (sum of Salary and Allowance of all personals.) The column
heading ‘Total Salary’ should be displayed. (Refer table from Q.1)

3.) Delete the record of Supervisors who have salary greater than 25000. (Refer table from Q.1)

4.)

Table : Teacher

T_ID Name Age Department Date_of_join Salary Gender

1 Jagan 34 Computer Sc 10/01/2017 12000 M


2 Sharmila 31 History 24/03/2008 20000 F
3 Sandeep 32 Mathematics 12/12/2016 30000 M
4 Sangeeta 35 History 01/07/2015 40000 F
Table : Posting
5 Rakesh 42 Mathematics 05/09/2007 25000 M
P_ID6 Shyam
Department50 History
Place 27/06/2008 30000 M
1 7 Shiv Om
History 44 Computer
Agra Sc 25/02/2017 21000 M
2 8 Shalakha 33
Mathematics Mathematics
Raipur 31/07/2018 20000 F
3 Computer Science Delhi
To list the names of female teachers who are in Mathematics department.

5.) To list the names of all teachers with their date of joining in ascending. (Refer table from Q.4)
6.) To display name, bonus for each teacher where bonus is 10% of salary. . (Refer table from Q.4)

7.)

To display the record from table student in alphabetical order as per the name of the student.

8.) To increase marks of all students by 20 whose class is “XII?”

9.) How do you retrieve the top 5 highest-paid employees?

10.) How do you create link between 2 tables using constraints?

11.)
Mark_1 Mark_2 Mark_3
Stu_id StuName
11 Mohan 75.0 65.0 70.0

12 Balaji 80.0 60.0

Which
SQL 13 Kiran 70.0 69.0 68.0
statement would
give you 14 Deepak 69.0 70.0 following
output?

12.) Write a SQL


command based on
data integrity

12 Balaji 140

14 Deepak 139

constraints?

13.) Write all SQL command based on Data Definition Language (DDL).

14.) How do you retrieve all records from a table in existing databases?
15.) Write a query to display the name which has more than 4 letter in an existing tables?

16.) Write a query to fetch customers whose names start with the letter "A."

17.) Write a query to rename the column name?

18.) Write a query to prove the primary key condition (using examples)?

19.) How can you update data using a subquery?

20.) How do you change the value in empty place of the given table?

TABLE: cs

Name ID Cont_no Age

Arjun 10023 94658455 25

Siva 10123 23
Gopal 10223 84455424 27

Guru 73882313

21.) Populate the table using SQL command (refer table: cs)?

22.) Write a query to display the oldest person in the table (refer table: cs)?

23.) Create a view table and use sum function.

24.) table : sport

Display the names of the student who have grade ‘C’ in either Game1 or Game2 or both

25.) Display the names of the student who have same game for both Game1 and Game2. (Refer table:
sport)

26.) Display all the Name sorted in ascending order. (Refer table: sport).

27.)
To increase the prize by 1000 for those customer whose name starts with ‘S’?

28.) Write SQL command for average value for the condition “like %r %”.( refer
table from Q.27)

29.) Write SQL command for creating foreign key using CUSTOMER and
COMPANY table. (Refer table from Q.27).

30.) Write SQL command to display designation without duplicate entries from
the CUSTOMER and COMPANY table (Refer table from Q.27).

You might also like