[go: up one dir, main page]

0% found this document useful (0 votes)
3 views1 page

SQL Query

The document outlines the creation of an Employee table with specific attributes and data insertion using SQL. It includes various SQL queries for selecting employee details based on specific criteria, modifying the table structure by adding and deleting columns, and changing data types. Additionally, it addresses the dropping of the primary key constraint from the emp_id column.

Uploaded by

king20001409
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

SQL Query

The document outlines the creation of an Employee table with specific attributes and data insertion using SQL. It includes various SQL queries for selecting employee details based on specific criteria, modifying the table structure by adding and deleting columns, and changing data types. Additionally, it addresses the dropping of the primary key constraint from the emp_id column.

Uploaded by

king20001409
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Create a table with the following filled and then insert the following data using sql.

Table Name:- Employee


Emp_id – primary key,emp name size 20

Empid EmpName Department ContactNo EmailId EmpHeadId


101 Isha E-101 1234567890 isha@gmail.com 105
102 Priya E-104 1234567890 priya@yahoo.com 103
103 Neha E-101 1234567890 neha@gmail.com 101
104 Rahul E-102 1234567890 rahul@yahoo.com 105
105 Abhishek E-101 1234567890 abhishek@gmail.com 102

Now solve the following using SQL

1.Select the detail of the employee whose name start with P.


2. Select the detail of employee whose emailId is in gmail.
3.Select the details of the employee who work either for department E-104 or E-102.
4. What is the department name for DeptID E-102?
5. Add an attribute called salary and filled the salary data.

6. What is the department name for DeptID E-102?


7.Add another column called mobile no

8.Delete the mobile column.

9.Modify the name EmpHeadId to HeadId

10.change the size of datatype of name from 20 to 40

11.drop the primary key attribute from the emp_id column.

You might also like