× se Live SQL-SQLW 395.pdf Lab 02: Data Manipulation-Part 1 1- Copy and paste th
ID: 3605220 • Letter: #
Question
× se Live SQL-SQLW 395.pdf Lab 02: Data Manipulation-Part 1 1- Copy and paste the content of the text file "Laboz Dato.bxt into any SQL Editor,t into any SQL Editor, then execute it. This code will create the table Agents and insert sample data into it Provide the SQL statements that perform the following tasks: 2- List full details of all agents. 3- List full details of all agents sorted in the descending order of the date of birth. 4- List the agent number, the first and last names, the state, and the salary of all agents. 5- List the agent number, the first and last names, the state, and the salary of all agents sorted in the ascending order of the state and the descending order of the salary. 6- Produce a list for all agents, showing the agent number, the first and last names, and the monthly salaries (salary/12). Use the AS clause to name the last column monthlySalary 7- List the state attribute of all agents. 8- Use the DISTINCT keyword to list the state values without duplications. 9- List the agent number, the first and last names, the address, the city, the state, and the salary of all agents with a salary greater than $50000. 10-List the agent number, the first and last names, the address, the city, the state, and the salary of all agents with a salary greater than $50000 and live in NY stateExplanation / Answer
2. select * from Agents;
This query will lists all the details of agents from the agents table.
3.select * from Agents order by dob desc;
This query will lists all the details of agents from the agents table in descending order of their date of births.
4. select Agent_No,Fname,Lname,State,Salary from Agents;
This query will list all the required fields.
5. select Agent_No,Fname,Lname,State,Salary from Agents order by state asc,salary desc;
This query will list the required fields in the order of ascending order by state and descending order by salary.
6. select Agent_No,Fname,Lname, (Salary/12) as monthlysalary from Agents;
7. select state from Agents;
8. select distinct state from Agents;
9. select Agent_No,Fname,Lname,Address,City,State,Salary from Agents where Salary>50000;
10. select Agent_No,Fname,Lname,Address,City,State,Salary from Agents where Salary>50000 and State='NY';
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.