Question

Write the following SQL queries based on hbsoe database from Mode: Select all the employee information...

Write the following SQL queries based on hbsoe database from Mode:

Select all the employee information and list them for first 100 only.

Select all the order information from country Germany.

How many distinct orders are made from each country?

List the names of employees who made orders from country Germany.

List the names of companies which supplies chai or tofu

Homework Answers

Answer #1

Answer:

you did not specified the question well here , how many tables are there and what are the attributes , so as per my understanding i am assuming employee, company  and orders are different tables here .

Before starting the execution of SQL queries on table first we go inside the database given hbsoe.

Command:

USE hbsoe;

a) Select all the employee information and list them for first 100 only.

SELECT TOP 100 * FROM employee ;

b)Select all the order information from country Germany.

SELECT *FROM order where country="Germany" ;

c)How many distinct orders are made from each country?

SELECT count( orderid ) as No_of_Id, country FROM Orders group by country;

d)List the names of employees who made orders from country Germany?

SELECT employee_name FROM emplyee INNER JOIN orders ON employee.employeeID=orders.employeeID  where country="Germany" ;

e)List the names of companies which supplies chai or tofu

SELECT company_name from company where supplies='chai' or supplies='tofu';

Please give me more details about the tables if some of the answer will not right because you din't provided the details of tables and there attributes.

let me know if any doubt.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using the Company database in Oracle, construct SQL queries for the following (note: I will make...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make the files to create and populate the Company database available on Isadore shortly): List the last name and address of managers who have a dependent with the same first name as themselves. Retrieve the names of all employees who are directly supervised by ‘Franklin Wong’. Retrieve the names of employees in the Research department who work more than 20 hours per week on the...
Specify the following queries in SQL on the COMPANY database. Show the result of each query....
Specify the following queries in SQL on the COMPANY database. Show the result of each query. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ‘ProductX’ project. List the names of all employees who have a dependent with the same first name as themselves. Find the names of all employees who are directly supervised by ‘Franklin Wong’. Specify the following updates using the SQL update commands. Show the state of...
Assignment 2 Instructions You need to access to the database and write SQL queries on the...
Assignment 2 Instructions You need to access to the database and write SQL queries on the following site: https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in 1. Use INNER JOIN to create a report. In this report, list each customer’s CustomerID, CustomerName, and their each OrderID and each order’s OrderDate, if the customer has ever placed an order. You should use the Customers table and the Orders table in the database to complete this query.   2. Use INNER JOIN to create a report. In this report, list...
Given the following two related tables, write the SQL SELECT statement to solve the following queries...
Given the following two related tables, write the SQL SELECT statement to solve the following queries about developers (Dev) and programs (Prog). The id column in Dev and Prog is the relation between the two tables. Dev(id, name, dept, salary) Prog(id, title, language, lines, size); 1. List name of Devs who have written more than 1000 line programs 2. List title of all programs written in C++ language 3. List name of all developers who have written C++ programs
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the...
***This is a complete question. Do not tag this as incomplete. Write SQL queries to the below Relational Database. • Regarding the SQL queries: • Do not use SELECT * in any query. • Do not use any SQL features (including Nullif) that were not covered in this course. • Do not use subqueries IF joins can be used to answer a question. However, some questions may require the use of subqueries. The Movie Database Notes: TheaterNum, MovieNum, and ActorNum...
Write the following questions as queries in SQL. Use only the operators discussed in class (in...
Write the following questions as queries in SQL. Use only the operators discussed in class (in particular, no outer joins or windows). Type your answers. Before starting, make sure you understand the schema of the database. If you are in doubt about it, please ask the instructor. Assume a database with schema ACTOR(name,age,address,nationality) MOVIE(title,year,genre,budget,director-name,studio) APPEARS(name,title,salary) 1. Find the title, director and studio of the most expensive movie of 2010 (note: there can be ties!). 2. Find the title, director and...
Translating MongoDB Queries to SQL - WILL UPVOTE!! 1. Write the equivalent sql queries for all...
Translating MongoDB Queries to SQL - WILL UPVOTE!! 1. Write the equivalent sql queries for all mongoDB queries. The following is an example of what you are asked to do. Assume the collection name is the table name in an sql database. Example: MongoDB Query: db.zips.aggregate([ {$match: {state: "MO"}}, {$group: {_id: "$city", totalPop: {$sum: "$pop"}}}, {$sort: {totalPop: -1}}, {$limit: 10} ]) SQL Result: Select city, SUM(pop) AS "totalPop" From zips Where state = "MO" Group By city Order By SUM(pop)...
Run the following queries from an SQL database containing the following normalized entities: STORE(SID(pk), SName, SCity,...
Run the following queries from an SQL database containing the following normalized entities: STORE(SID(pk), SName, SCity, SState, SSqFeet) ITEM(ISerialNum(pk), IName, IType, IPrice) SELLS(SID, ISerialNum) (concatenated pk and both fk) 1. Show all the items with name, type, and price and the store that sold them, order by most expensive item first. 2. Show all stores that sold a specific type of an item. For example: show all stores that sold cooking items. 3. Show all stores that have a square...
1. Write a SELECT statement to count SKUs for each department, i.e., a table of two...
1. Write a SELECT statement to count SKUs for each department, i.e., a table of two columns, departments and their SKU counts. use cape_codd; select department, count(*) from sku_data group by department ; 2. List buyers who is responsible for at least two SKUs, in three columns, department, buyer, sku count. Sort buyers by their department names in ascending order. select department, buyer, count(sku) from sku_data group by buyer ; 3. Write a SQL statement which returns all the orders....
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...