Dbms Lab 2 (1) 230927 135150

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

A.

Create following table: Employee

And store following values

Eid Ename Salary


1 Ajay 83020.561
2 Ravi 50600.567
3 Rajesh 78110.487
4 Prakash 67230.678
5 Anuraag 77901.456
6 Bharat 64000.287
1. Print salary and name of all the employees
2. Select all the employees who have salary greater than 55000 and less than 80000
3. Make eid as primary key.
4. Change salary of Anuraag to 80000.45
5. Change salary of Ajay to 110000.230
6. Remove salary of Ravi (do not remove whole record of ravi).

B. Create following table: customer

cid must be int type and primary key


First_name must be of varchar(8)
Last_name must be of varchar(8)
Country must be of varchar(4)
Cid FName Lname Country
1 John Doe USA
2 Robert Luna USA
3 David Robinson UK
4 Mark Cage UK
5 Betty Taylor UAE
1. Add one column phone in table of varchar type
2. Add phone following phone numbers in this table.

817-466-8833
412-862-0502
208-340-7906
307-242-6285
806-749-2958
3. Try to insert following record.
5 Mark Alexander Denmark 990-267-9088

4. Perform suitable changes in table schema or values to store the record of “Mark Alexander”.
5. Remove column Lname from customer.
C. Create following table: Student

Sroll Sname Dob


1. Vijay Kumar 12-jan-2012
2. Ravi Kumar 13-mar-2011
3. Rajkesh Ranjan 1-july-2009
4. Prakash Jha 3-feb-2011
5. Ashutosh Srivastava 11-dec-2010
6. Akash Rajiv 09-feb-2012

1. Print the name of students from roll 1 to 4.


2. Print the name of students who born on 11/12/ 2010.
3. Print the name of student who born on 12/1/ 2012 and 13/3/2011.
4. Print the name of student who born after 31/12/2010.

You might also like