Sei sulla pagina 1di 2

Name______________ class__________ Date______________

Employee

Empid Empname Dept Contactno empheadid


101 Isha E-101 1234567890 105
102 Priya E-104 1234567890 103
103 Neha E-101 1234567890 101
104 Rahul E-102 1234567890 105
105 Abhishek E-101 1234567890 102
Write sql queries based on the above table for the following:-

1) Create a table employee with empid as primary key and contact not null.
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
2) Insert the new record 106 Prisha, E-102, 1234343434, 103
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
3) Display the content of the whole table.
_________________________________________________________________________
4) Display empname of the dept E-101.
_________________________________________________________________________
5) Display record of the employees whose name starts with ‘P’.
_________________________________________________________________________
6) Display the details of employee who works either in department E-102 or E-104.
_________________________________________________________________________
7) List name of all the employees whose names end with ‘a’.
_________________________________________________________________________
8) Update the empheadid of Neha to 103.
_________________________________________________________________________
_________________________________________________________________________
9) Display the details of employee in descending order of their names.
_________________________________________________________________________
10) Add a column emailid in the table employee.
_________________________________________________________________________
11) Write the cardinality and the degree of the table employee.
_________________________________________________________________________

Potrebbero piacerti anche