You are on page 1of 4

Q1. What is SQL?

Ans. sql is the structure query language which is used to manipulate the data in database

Q2. What is a Database?


Ans: it is the organized collection of data store and accessed from system

Q-3. What Can SQL do?


Ans sql is used to communicate with the data in database

Q-4. Some of The Most Important SQL Commands.


Ans SELECT select
1 UPDATE
2 DELETE
3 INSERT INTO
4 CREATE DATABASE
5 ALTER DATABASE
6 CREATE TABLE
7 ALTER TABLE
8 DROP TABLE
9 CREATE INDEX
10 DROP INDEX

Q5. What is use of "Where" SQL Clause ?


Ans

Q6. What is SQL Aliases?


Ans

Q7. How many types of joins are there in SQL?


Ans

Q8. What is a query?


Ans:

Q9. Which operator is used in query for pattern matching?


Ans:

Q10. How to select unique records from a table?


Ans.
Qery>
Q1.

Ans

Q2.

Q3.
Ans

Q4.
Ans

Q5.
Ans

Q6.
Ans

Q7.
Ans

Q8.
Ans

Q9.
Ans
Select the two Empid(2,5) all recond from Employeeinfo Table

select * from employee where emplid=2,5;

Q2. Write a query to fetch the number of employees working in the department ‘HR’.

Select count(*) from employeeinfo where department = "HR"

Write a query to get the current date.


select getdate() as 'currentdatetime';

Write a query to get (EMP code,EMP Name,Gender)


select emp code , name , gender from emplyeeinfo;

Write a query find number of employees whose DOB is between 02/05/1970 to 31/12/1975 and are groupe
select count(*), gender from employeeinfo where DOB between 02/05/1970 and 31/12/1975 group by gender;

 Write a query to fetch details of employees whose EmpLname ends with an alphabet ‘A’ and contains fiv
select employeename from employeeinfo where employeename like '%%%%A' and length(employeename)=5

Write a query to fetch details of all employees excluding the employees with first names, “Sanjay” and “S
select * from employeeinfo where employeename not in ('sanjay', 'sonia');

Write a query to fetch all employees who also hold the managerial position.
select e.empfname, e.emplname, P.empposition from employeeInfo innerj oin employeeposition ON e.empid = p.empi

Write a query to fetch all recods from "EmployeeInfo" Table and matching recods from "EmployeePositi
select emplyeefname, employeelname, department, project, address, dob, gender from employeeinfo inner join emplo
2/1975 and are grouped according to gender
up by gender;

et ‘A’ and contains five alphabets.


gth(employeename)=5 orderby employeename

ames, “Sanjay” and “Sonia” from the EmployeeInfo table.

on ON e.empid = p.empid and p.empposition in ('manager');

rom "EmployeePosition table"


yeeinfo inner join employeeposition on employeeid=employeeid;

You might also like