0% found this document useful (0 votes)
0 views

SQL Exercises, Practice, Solution - Retrieve Data From Tables

The document contains a series of SQL statements for various exercises. It includes queries to display all salespeople information, a specific string, three numbers in columns, the sum of two numbers, an arithmetic expression, specific columns for salespeople, and ordered columns for orders. Each SQL statement is designed to demonstrate different functionalities of SQL queries.

Uploaded by

kravishind
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

SQL Exercises, Practice, Solution - Retrieve Data From Tables

The document contains a series of SQL statements for various exercises. It includes queries to display all salespeople information, a specific string, three numbers in columns, the sum of two numbers, an arithmetic expression, specific columns for salespeople, and ordered columns for orders. Each SQL statement is designed to demonstrate different functionalities of SQL queries.

Uploaded by

kravishind
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Write a SQL statement that displays all the information about all salespeople
select * from salesman;
2. Write a SQL statement to display a string "This is SQL Exercise, Practice and
Solution".
SELECT 'This is SQL Exercise, Practice and Solution' AS result FROM dual;
3. Write a SQL query to display three numbers in three columns.
select 1 col1,2 col2,3 col3 from dual;
4. Write a SQL query to display the sum of two numbers 10 and 15 from the RDBMS
server.
select 10+15 sum from dual;
5. Write an SQL query to display the result of an arithmetic expression.
select 2+25-3*4/2 "arithmetic expression" from dual;
6. Write a SQL statement to display specific columns such as names and commissions
for all salespeople.
select name,commission from salesman;
7. Write a query to display the columns in a specific order, such as order date,
salesman ID, order number, and purchase amount for all orders.
select ord_date,salesman_id,ord_no,purch_amt from orders;

You might also like