Table name:salesmansalesman_id | name | city | commission -------------+------------+----------+------------5001 | James Hoog | New York | 0.155002 | Nail Knite | Paris | 0.135005 | Pit Alex | London | 0.115006 | Mc Lyon | Paris | 0.145007 | PaulAdam | Rome | 0.135003 | Lauson Hen | San Jose | 0.121.Write a SQL statement to display all the information of all salesmen.2.Write a SQL statement to display name and commission for all the salesmen.3.Write a SQL statement to display names and city of salesman, who belongs to the city of Paris.
Answers
Answer:
1. SQL Query for display all the information of all salesmen
select salesman_id, name, city, commission from salesman
or
select * from salesman
2. SQL Query for display name and commission for all the salesmen
select name, commission from salesman
3. SQL Query for display names and city of salesman, who belongs to the city of Paris
select name, city from salesman where city = 'Paris'
SQL Query
- SQL is a standard language for storing, manipulating, and retrieving data in databases.
- We can say that SQL is used to communicate with a database.
- SQL stands for Structured Query Language and its pronunciation is S-Q-L or sometimes as See-Quell
- Following are the queries:
- Query to display all the information of all salesmen
SELECT salesman_id, name, city, commission FROM salesman
The query can also be written as:
SELECT * FROM salesman
2. Query to display the name and commission for all the salesmen
SELECT name, commission FROM salesman
3. Query to display the names and city of a salesman, who belongs to the city of Paris
SELECT name, city FROM salesman WHERE city = 'Paris'
#SPJ2