1. Write an SQL query to find the CUSTOMERNAME who order the COMPUTERS. 2. Write an SQL query to change the LOCATION of CUSTOMER as “BARKA" and who's quantity is LESS than 1000. 3. Write an SQL query to display all information from items table and display orders delivered in the month of June.
Q: Write the T-SQL scripts for the following tasks: - Write a query to list all the Employee's details…
A: let us see the answer:- Introduction:- We are going to use a select query to list all the Employees…
Q: Write an SQL query to report the name and bonus amount of each employee with a bonus less than 1000.…
A:
Q: Write an SQL query to fetch the employees whose name begins with any two characters, followed by a…
A: In this case we can see that this query will be solved using two operators: '_' , '%' wild card…
Q: Use the given database to output the results of the following SQL queries: a.) SELECT building,…
A: Query: /*Creating tables*/ CREATE TABLE classroom ( building TEXT, room number INTEGER,…
Q: • Write an SQL query to fetch last_name from employees table using the alias name as Employee Name.…
A: 1ST Query Answer: SELECT last_name AS employee_name FROM employees; Explanation: it will print…
Q: Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending.…
A: Syntax for order by :- By default when you don't mention ascending or descending it takes…
Q: Write an SQL query to display: The last name of the student who registered at the last. Your output…
A: Basic SQL Syntax Example This guide provides a basic, high level description of the syntax for SQL…
Q: Write an SQL query to print the FIRST_NAME from Worker table after removing white spaces from the…
A: SELECT RTRIM(FIRST_NAME) FROM WORKER;
Q: Write SQL query to fetch the Name of all employees working in IT department from table…
A: Write SQL query to fetch the Name of all employees working in IT departmentfrom table Employee(Name,…
Q: d. Write an SQL query to display the client_no.order_no,status from client (matched rows), and…
A: Syntax for using inner join select col1, col2, col3 …. From table1 inner join table2 on…
Q: Write a SQL query to find the employee I'd whose salary lies in between 3000 and 11000.
A: Question. Write a SQL query to find the employee Id whose salary lies in between 3000 and 11000.…
Q: • Write an SQL query to print details for employees with the first_name as "“Lex" and "Den" from…
A: PART1: SELECT * FROM EMPLOYEE WHERE first_name ="Lex" AND first_name="Den";
Q: Write an appropriate SQL query to display all the STUDENT_SURNAMES and STUDENT_NAMES, as well as the…
A: The table name is Student Module. Student Surnames and Names should be displayed using the query.…
Q: • Write an SQL query to print all employee details from employees table sorted based on first_name…
A: 1st answer SELECT * FROM employees ORDER BY first_name ASC; 2nd answer SELECT * FROM…
Q: Write an SQL query to fetch worker names with salaries >= 50000 and <= 100000.
A: Required Write an SQL query to fetch worker names with salaries >= 50000 and <= 100000.
Q: Write an SQL query to display Product ID, name and product date for the products that have been…
A: According to the question below the Complete Query:
Q: Write an SQL query to print details for employees with the first_name as “Lex” and “Den” from…
A: In SQL, comparison operators are used in WHERE clause that compares one expression to another.…
Q: Write an SQL query to display: The last name of the student who registered at the last. Your output…
A: Write SQL query to display the last name of the student who registered at the last. Given: The…
Q: Write an SQL query to fetch the list of employees with different salaries.
A: Giving the answer of question no. 1 :
Q: Write an SQL Query that lists the TeamID, bowler name, and telephone number for all bowlers. The…
A: The full query is given in next step
Q: Q-4. Write an SQL query to print all Worker details from the Worker table order by FIRST NAME…
A: Answer 4. SQL Query to print details of the workers from Worker table order by First_Name Ascending…
Q: Write a SQL query to display product name and list price for products in category 1 which have the…
A: Sql Query:-
Q: Write a SQL query to find the second highest salary from the table Employee(Eno, EName, Salary,…
A: Given Table: Employee(Eno, EName, Salary, Department) Requirement: Write a SQL query to find the…
Q: Write a sql query to create the given table.
A:
Q: Write an SQL query to fetch the EmpId and FullName of all the employees working under Manager with…
A: Answer. A SQL query to fetch the EmpId and FullName of all the employees working under Manager with…
Q: Write a sql query to show first name, job number and department number of those employees whose…
A: The queries for both questions given below
Q: Write an SQL query to fetch the no. of workers for each department in the descending order.
A: Question. Write an SQL query to fetch the no. of workers for each department in the descending…
Q: 13. Describe the function of the following SQL code. update student set age = age +1
A: The function of the Query update student set age = age + 1 is
Q: Write an SQL query to fetch “FIRST_NAME” from Worker table using the alias name as . ii.Write an SQL…
A: Since you have not provided the db schema containing the table and column details, I am providing…
Q: Write a SQL query to show the names of all students who have studied both ECON123 and ECON456 (NOTE:…
A: A query can either be a request for data results from your database or for action on the data.
Q: Write an SQL query to fetch those employees who live in Toronto and work under manager with…
A: Question. Write an SQL query to fetch those employees who live in Toronto and work under manager…
Q: Write the SQL queries.…
A: Sql queries: Display detail of all employees from Employee table. Ans: select * from Employee;…
Q: .Write an SQL query to fetch “FIRST_NAME” from Worker table using the alias name as . ii.Write an…
A: Syntax: SELECT column_name AS alias_nameFROM table_nameWHERE [condition]; Query: i) SELECT…
Q: Write an SQL query to fetch worker names with salaries >= 50000 and <= 100000.
A: According to the asked question, the solution is given below with a proper explanation.
Q: Write an SQL query to fetch last_name from employees table using the alias name as Employee Name.…
A: As per our company guidelines, we are supposed to answer three subparts of a post and kindly…
Q: Write an SQL query that will show all data from the Customers table andOrder By State.
A: SQL query: Query to select all the data from the “Customers” table order by “State” SELECT * FROM…
Q: Write an SQL query to fetch the count of employees working in project ‘P1’.
A: So in order to fetch the count of employees working in project ‘P1’ we mainly use an aggregate…
Q: 4. Write a SQL query to find the name of oldest sailors for each rating level. 5. Find the average…
A: As per our company guidelines we are supposed to answer ?️only first 3️⃣ sub-parts. Kindly repost…
Q: te An SQL Query To Fetch “FIRST_NAME” From Worker Table Using The Alias Name As <WORKER_NA
A: Lets see the solution.
Q: Write a SQL query to find the highest salary from the table Salaries(E_ID, E_Name, E_Post, Salary)
A: Given Table: Salaries(E_ID, E_Name, E_Post, Salary) Requirement: Find the highest salary from the…
Q: . Write a SQL query to display the total salary of each employee adding the Salary with Variable…
A: Given, Table EmployeeDetails: EmpId FullName ManagerId DateOfJoining City 12 John Snow 321…
Q: QUESTION 18 The following SQL Query: SELECT partname FROM quote WHERE UPPER(suppliername) = 'TOOL…
A: The answer is
Q: b) Write SQL query to insert the entry ("CSP-103", "Programming Fundamentals", "Btech", "3") in the…
A: Given Table: Courses(course_code, course_name, programme, year) Requirement: Write SQL query to…
Q: • Write an SQL query to print details of the employees whose last_name ends with 'h' and contains…
A: 1st Query Answer: SELECT * FROM employees WHERE last_name LIKE '_____h'; Explanation: Here it will…
Q: Write the standard SQL query to retrieve only the name of the sales representative and the name of…
A: In step 2, you will get SQL query.
Q: Write an SQL query that fetches the unique values of DEPARTMENT from Worker table and prints its…
A: an SQL query that fetches the unique values of DEPARTMENT from Worker table and prints its length…
Q: Write a sql query to create the following table.
A: Given, Table:
Q: Write an SQL query to fetch the employees whose name begins with any two characters, followed by a…
A: Question. Write an SQL query to fetch the employees whose name begins with any two characters,…
Q: Write an SQL query to fetch the count of employees working in the department ‘Admin’.
A: Write an SQL query to fetch the count of employees working in the department ‘Admin’.
Q: Write the standard SQL query to retrieve the Name and PhoneNumber of customers whose name beg 'S'.…
A: like is used when you want to fetch records based on some patterns like starting with some letter ,…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Perform the following tasks: a. Create an index named ITEM_INDEX1 on the ITEM_NUM column in the ORDER_LINEtable. b. Create an index named ITEM_INDEX2 on the CATEGORY column in the ITEMtable. c. Create an index named ITEM_INDEX3 on the CATEGORY and STOREHOUSE columnsin the ITEM table. d. Create an index named ITEM_INDEX4 on the CATEGORY and STOREHOUSEcolumns in the ITEM table. List categories in descending order.* Single tables Display the information (name, position, salary) about a person who earns the highest salary. Display the number of staff grouped by branch. Display each branchID with the number of rental properties grouped by branch. Display each staffID n with the number of rental properties grouped by staff. Display the rental property located Glasgow Display ownerID who owns the rental property 'PA14'. Display the most frequently viewed property. Display available(possible) rental prices Display the name of client who were looks for "House"* Multiple tables Display branch information (city) with the number of rental properties grouped by branch. Display staff information (name, position, branchID, Brach City) with the number of rental properties grouped by staff. Display owner information (name, address, etc.) who owns the rental property 'PL94'. Display the number of rental properties group by the type List staff information who works at London.2- selects the order line items (orderNumber, orderlinenumber) fromthe “orderdetails” table. Also, display the subtotal (quantityOrdered * priceEach) for eachline item and sorts the result set based on the subtotal descending .3- Display unique last names from employees table ordered by last name.4- Display customerNumber, customerName and creditLimit for getting the top five customerswho have the highest creditLimit.5- Find customer Name, customer country, sales representative employee number fromcustomers who do not have a sales representative.6- For each order status, display status and count of orders have this status.7- For Each order number in order details table, Display order number, sum of quantityordered (itemsCount) and sum of (priceEach * quantityOrdered) as total. With condition“total” greater than 1000.8- Display product code, product name and text description for product.9- Find customer number, customer name, order status and order number, for customerwith their orders…
- CUSTOMERColumns = 7, Rows = 10 CustomerID LastName FirstName Address ZIP Phone Email 1 Shire Robert 6225 Evanston Ave N 98103 206-524-2433 Robert.Shire@somewhere.com 2 Goodyear Katherine 7335 11th Ave NE 98105 206-524-3544 Katherine.Goodyear@somewhere.com 3 Bancroft Chris 12605 NE 6th Street 98005 425-635-9788 Chris.Bancroft@somewhere.com 4 Griffith John 335 Aloha Street 98109 206-524-4655 John.Griffith@somewhere.com 5 Tierney Doris 14510 NE 4th Street 98005 425-635-8677 Doris.Tierney@somewhere.com 6 Anderson Donna 1410 Hillcrest Parkway 98273 360-538-7566 Donna.Anderson@elsewhere.com 7 Svane Jack 3211 42nd Street 98115 206-524-5766 Jack.Svane@somewhere.com 8 Walsh Denesha 6712 24th Avenue NE 98053 425-635-7566 Denesha.Walsh@somewhere.com 9 Enquist Craig 534 15th Street 98225 360-538-6455 Craig.Enquist@elsewhere.com 10 Anderson Rose 6823 17th Ave NE 98105 206-524-6877 Rose.Anderson@elsewhere.com EMPLOYEEColumns = 5, Rows = 5 EmployeeID LastName FirstName…CUSTOMERColumns = 7, Rows = 10 CustomerID LastName FirstName Address ZIP Phone Email 1 Shire Robert 6225 Evanston Ave N 98103 206-524-2433 Robert.Shire@somewhere.com 2 Goodyear Katherine 7335 11th Ave NE 98105 206-524-3544 Katherine.Goodyear@somewhere.com 3 Bancroft Chris 12605 NE 6th Street 98005 425-635-9788 Chris.Bancroft@somewhere.com 4 Griffith John 335 Aloha Street 98109 206-524-4655 John.Griffith@somewhere.com 5 Tierney Doris 14510 NE 4th Street 98005 425-635-8677 Doris.Tierney@somewhere.com 6 Anderson Donna 1410 Hillcrest Parkway 98273 360-538-7566 Donna.Anderson@elsewhere.com 7 Svane Jack 3211 42nd Street 98115 206-524-5766 Jack.Svane@somewhere.com 8 Walsh Denesha 6712 24th Avenue NE 98053 425-635-7566 Denesha.Walsh@somewhere.com 9 Enquist Craig 534 15th Street 98225 360-538-6455 Craig.Enquist@elsewhere.com 10 Anderson Rose 6823 17th Ave NE 98105 206-524-6877 Rose.Anderson@elsewhere.com EMPLOYEEColumns = 5, Rows = 5 EmployeeID LastName FirstName…question 1Create a procedure that accepts a customer id and retrieves the id of the products and quantities that the customer ordered. Use an anonymous to call the procedure and output the result. question 2Create a procedure to insert a row into the product table with appropriate valuesUse an anonymous to call the procedure and output the result. creation code
- 8. Create a trigger for the Invoices table that automatically inserts the vendor name and address for a paid invoice into a table named ShippingLabels. The trigger should fire any time the PaymentTotal column of the Invoices table is updated. The structure of the ShippingLabels table is as follows: CREATE TABLE ShippingLabels (VendorName varchar(50), VendorAddress1 varchar(50), VendorAddress2 varchar(50), VendorCity VendorState VendorZipCode varchar(50), char(2), varchar(20)); Use this UPDATE statement to test the trigger: UPDATE Invoices SET PaymentTotal = 67.92, PaymentDate = '2020-02-23' WHERE InvoiceID = 100;Task 4: The InstantRide Driver Relationship team wants to create groups for drivers according to their ratings such as 3+ or 4+. For instance, a driver with the rating 3.8 will be 3+; whereas a driver with the rating 4.2 will be 4+. You need to return a two column output with DRIVER_ID and DRIVER_RATING which has first FLOOR applied and then CONCAT with + sign for all drivers with a rating greater than 0. Task: Create groups of drivers according to their ratings. (SQL Database Test)Based on the following table, please find the customers who locate in the same state. sales.customers *customer_id first_name last_name phone email street city state zip_code . Based on the following table, please display the staff and their corresponding manager in the same store. Please display staff’s full name in one column, manager’s full name in another column, and store_id. sales.staffs *staff_id first_name last_name email phone active store_id manager_id
- Alternate keys: Identify at least five keys (not already listed as PK or FK) needed by end users. These indexes would be considered Alternate or Secondary keys and are mostly used for queries and quick reporting. They may contain multiple columns. Books Authors Bookstore Members Sales transaction table Inventory tableReferring to the diagram above, which GROUP BY statement would best match the SELECT statement of "SELECT s.CustomerID, s.SaleDate, s.SalesInvoiceID, SUM(Quantity*SoldPrice) AS OrderTotal"? a GROUP BY s.CustomerID, s.SaleDate, s.SalesInvoiceID b GROUP BY OrderTotal. c GROUP BY s.SaleDate d GROUP BY s.SalesInvoiceID Select the best option.Open the Missing Addresses query in Design view. Add a new column to determine if a customer does not have an address on file. If the customer’s Address is null, it should display Missing. If not, it should display nothing. Name the column AddressPresent. Add criteria of Missing to the column you just created, so only the customers missing an address display. Move the AddressPresent field so it appears between PhoneNumber and Address. Run the query. Ensure only customers with null Address fields display. Save and close the query.