Information Technology (IT-402)
Practical Questions for class X (Libre Base)
1. Create a table “emp” in base with the given structure
Field name Data type Length
Empid Integer 10 (primary key)
Name Text(varchar) 100
Gender Text(varchar) 5
Desg Text(varchar) 100
Department Varchar(Text) 100
doa Date
Salary float 17
Open Base and create a new database ([Link])
click on table object. Select create Table in design view from task Pane. The table design window will
appear.
Under field name , enter the name of field.
Click on field type column and select the desire data type from the drop down list
To set empid as primary key, right click on row header of empid , a context menu will appear, select
primary key from that menu. When all field are created , click on save button . the save dialog window
will appear. Give a name (emp) in Table name text box.
2. Insert the following records in emp table
Answer
1. Click on Table object from Database pane
2. Right click on emp table from Table Pane. A context menu will appear. Select open from that
menu
3. A Table Data view window will appear. Ener the given records in Table data view window
4. When all data has been entered save it by click save button and close the table data view window
Open the sql query windows and execute the following queries
Click on Query object in Database pane.
Click on t create query in sql view option from Tasks Pane
A query design window will appear
Type the respective query and press F5 or click on run query icon to execute that query
sql query
[Link] employee details of IT department
select * from emp where department=’IT’;
2. Display empid,name and doa of all employee
select empid,name,doa from emp;
3. Display name id, name and department of all managers
select empid,name,department from where desg='Manager'
4. display the name of those employee along with department whose salary is more than 60000
select name,department from emp where salary>60000
5. Display details of female employee.
Select * from emp where gender=’F’
6. Show the details of employees whose DO A is before the year 2020
select * from emp where doa <={d '2019-12-31'}
7. display details of the employees in ascending order of their names
select * from emp order by name
8. display details of the employee in descending order of their salary
select * from emp order by salary desc
9. display details of those employee whose name starts with 'A'
select * from emp where name like 'A%';
[Link] the details of employees whose department are either IT or HR
select * from emp where department ='IT' or department='HR'
11. list out all female employees of IT department .
select * from emp where department='IT' and gender='F'
12. count total female and male employee
select gender,count(*) from emp group by gender
[Link] total number of employees in each department
select department,count(*) as total from emp group by department
14. display total salary distributed in each department
select department,sum(salary) as totalsalary from emp group by department
15. display highest salary in each department
select department,max(salary) as maxsalary from emp group by department
16. count total female and male employee in each department
select department,gender,count(*) from emp group by department,gender order by
department,gender
17. count total number of department in the organisation
select count(distinct department) from emp
[Link] out the name of department
select distinct department from emp;
[Link] details of employees who have joined the company after 2020
select * from emp where doa>{d '2020-12-31'}