Basic Clause; simple and advance filter Flashcards

like, upper,lower initcap, TRIM, LTRIM, RTRIM, LPAD,RPAD

1
Q

Write a query to display first_name in uppercase, last_name in lower case, EACH word first character of Job_ID into uppercase and rest in lowercase from employees

A

Select Upper(First_name), lower(last_name), initcap(Job_ID) from employees;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Write a query to display all records from employees table, only those records whose first_name starts with ‘A’

A

Select * from employees
where first_name like ‘A%’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Write a query to display all records from employees table; only those records whose last_name ends with ‘a’;

A

select * from employees where last_name like ‘%A’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Write a query to display all records from employees table, only those records whose first_name having two ‘o’.

A

Select * from employees where first_name like ‘%oo%’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Write a query to display all records from employees table; only those records whose first_name not start with ‘S’;

A

Select * from employees
where first_name not like ‘S%’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Write a query to display all records from employees table, only those records whose last_name start with ‘A’ and ends ‘s’

A

Select * from employees
where last_name like ‘A%s’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Write a query to display all records from employees table, only those records whose first_name having ‘a’ at second position OR last_name having ‘s’ at second last position

A

Select * from employees
where first_name like ‘a%’ OR Last_name like ‘%s’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Write a query to remove left side space from the given string ‘ vaannii’

A

select LTrim (‘ Vaaniii’) from dual;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Write a query to remove @ from left side from given string ‘@@@vaanii’

A

select Ltrim( ‘@@@Vaanii’,’@’) from dual;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Write a query to remove @ from both side from given string

A

select trim ( ‘@’ from ‘@@@Vaanii@@@’) from dual;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Write a Query to format the below string which should be 10 character long; if it is having 10 character then add ‘$’ on right side ‘Vaannii’

A

Select rpad(‘Vaanii’,10,’$’) from dual;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Write a query to display all records from employees table, only show those records whose department_ID is not in 10,20,30

A

Select * from employees where department_ID NOT in (10,20,30) ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly