0% found this document useful (0 votes)
68 views3 pages

Refer Below Table and Answer The Question

1) SQL is a language used to manage data in relational database management systems. The main types of SQL statements are DML (SELECT, INSERT, UPDATE, DELETE) and DDL (CREATE, ALTER, DROP). 2) The datatype for the dual table is not specified. 3) A cartesian join returns all possible combinations of rows from two or more tables, while a cross join is an explicit cartesian join with the CROSS JOIN keyword. 4) Several questions are asked to list sales person names for different criteria using joins on the provided tables. 5) Display employee names in a mixed case format ordered alphabetically from an employees table. 6) Find the top 5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views3 pages

Refer Below Table and Answer The Question

1) SQL is a language used to manage data in relational database management systems. The main types of SQL statements are DML (SELECT, INSERT, UPDATE, DELETE) and DDL (CREATE, ALTER, DROP). 2) The datatype for the dual table is not specified. 3) A cartesian join returns all possible combinations of rows from two or more tables, while a cross join is an explicit cartesian join with the CROSS JOIN keyword. 4) Several questions are asked to list sales person names for different criteria using joins on the provided tables. 5) Display employee names in a mixed case format ordered alphabetically from an employees table. 6) Find the top 5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1) what is SQL and also describe types of sql statement

2) what is the datatype for dual table??

3) Different between cartesian join and cross join

4)Refer below table and answer the question

Table Name: Sales_person Table Name=Product

Sales_id Sales_person_name Prod_id Prod_name


1001 Raja 5001 XXX
1002 Krishnan 5002 YYY
1003 Suresh 5003 ZZZ
1004 Jayaprathap 5004 AAA

Table_name:Sales_detail

Order_id Sales_id Prod_id


70001 1001 5001
70002 1002 5003
70003 1002 5003

* List the sales person name those who have ordered the product ‘XXX’(using joins)

* List the sales person name those who have not ordered the product ‘XXX’(using joins)

* List the Sales Person Name those who have more then one order

* List the sales person name those who have not placed any order

5) Display half of the employee's name in uppercase and remaining in lowercase and follow the
format in alphabetic order using employees table.
6) find out top 5 salary without using rownum
7) Display employee name,salary and department no for each employee who earn a salary greater
then the average of theri deparment order by deptno
8) Identify number of e in below string
‘select’
9)What is different between truncate and delete and drop???
10) How to change datatype of column???
11) Find the output of below query
* select case when 1=1 then 2 else 3 end from dual;
* select decode(4,2,5,4,9,3) from dual;
* select round('12-nov-2001','yy') from dual;
12) How to fetch even record of the table??
13) What is the syntax for LISTAGG function??
14) Given following table t1

T1
======
2
-2
3
-3
4
-4
Write a single query to calculate the sum of all positive values and sum of all negative values

15)Given following table t2

Weight
10.25
40.64
72.563
99
Write the query to produce below output

Weight kg grams
10.25 10 25
40.64 40 64
72.563 72 563
99 99 0
16) Find the error in below query

Select first_name,to_char(hire_date,’YYYY’) as hire_year from employees where hire_year>1996;

17)Find the error in below query

Select first name ename,last_name fname,hire_date date, salary sa from employees;

18)Write a query to display a list of table owned by a user.

19) In a SELECT statement that includes a WHERE clause, where is the GROUP BY clause
placed in the SELECT statement?

A. Immediately after the SELECT clause


B. Before the WHERE clause
C. Before the FROM clause
D. After the ORDER BY clause
E. After the WHERE clause

20) Which two tasks can you perform using only the TO_CHAR function?

A. convert 10 to ‘TEN’
B. convert ’10’ to 10
C. convert ’10’ to ’10’
D. convert ‘TEN’ to 10
E. convert a date to a character expression
F. convert a character expression to a date

You might also like