Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Terms

Define the following terms:

1. Implicit syntax vs. Explicit syntax
2. Table alias
3. Qualified column name
4. Inner JOIN vs Outer JOIN vs FULL JOIN
5. Self-join
6. UNION
7. Aggregate function (with two examples)
8. Summary query
9. INTERSECT vs EXCEPT
10. HAVING

Exercise 1 Determine how many products you can find in the Production.Product table.

504
(1 row(s) affected)

Exercise 2 Write a query that retrieves the number of products in the Production.Product table that are included in a subcategory.

Hint: the rows that have NULL in column ProductSubcategorylD are considered not a part of any subcategory.
HasSubCategorylD
295
(1 row(s) affected)
Notice that the result has a column name. Also take a look at the message you receive from SQL Server.

Exercise 3 Determine how many Products reside in each SubCategory.

The answer to this is retrievable if you write a query that uses the COUNT aggregate function combined with a GROUP BY clause.

The column ProductSubcategorylD is a candidate for building groups of rows when querying the Production.Product table. Your result set should look something like the result below:

Notice the column alias for the second column.

ProductSubcategorylD   Counted Products
NULL 209
1 32
2 43
(38 row(s) affected)

Exercise 4 Write a query that lists the country and province names stored in AdventureWorks2014 sample database.

In the Person schema, you will find the CountryRegion and StateProvince tables. Join them and produce a result set similar to the following. Notice that there is no particular sort order in the result set.
Country  Province
Canada  Alberta
United States  Alaska
United States  Alabama
(181 row(s) affected)

Exercise 5 Continue to work with the previous query and add a filter to list only the countries Germany and Canada.

Also, notice the sort order and column headings of the result set. Your result set should look similar to the following:

Country  Province
Canada  Alberta
Canada  British Columbia

Germany Brandenburg
Germany  Hamburg
(20 row(s) affected

Exercise 6 Write a query that retrieves the average commission percent for the SalesPerson table.

Exercise 7 Write a query that retrieves a count of all Male Employees. Name the column.
Hint: Use a HumanResources table.

Exercise 8 Write a query that retrieves the highest List Price and lowest List Price of any Product in the Production.Product table.

Column names should be Max List Price and Min List Price. Min List Price cannot be 0.00.
Exercise 9 Identify the possible causes of error(s) and rectify. Consider the following SQL query:
SELECT ProductlD, LineTotal AS 'Total'
FROM Sales.SalesOrderDetail
Group By Cube(LineTotal)
Once executed, the preceding query generates errors. Identify the possible causes of such error(s) and rectify.
ProductID  Total
707  157772.394392
708  160869.517836
718  395182.699300
(267 row(s) affected

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M92574252
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in DBMS

Answer the following question explain the difference

Answer the following Question : Explain the difference between a database management system (DBMS) and a database. Are Microsoft Access, SQL Server, and Oracle examples of databases or database management systems (DBMS)?

Sqlwrite a select statement that returns one column from

SQL Write a SELECT statement that returns one column from the Vendor table named Full Name. Create this column from the VendorContactFName and VendorContactLName columns. Format it as follows: last name, comma, first nam ...

Suppose that we have a table of house prices and a table of

Suppose that we have a table of house prices and a table of zip codes: • hprices(hid (PK),address,bedrooms,price,zipcode) • zipcodes(zipcode (PK),state) Write a SQL query that finds the average, maximum, and minimum pric ...

Sql transactions exercisesconsider table itemnameprice

SQL Transactions Exercises Consider table Item(name,price) where name is a key, and the following two concurrent transactions. T1: Begin Transaction; Update Item Set price = 2*price Where name = 'pencil'; Insert Into Ite ...

Question a suppose you are a marathon runner that can run a

Question : a) Suppose you are a marathon runner that can run a maximum of n miles on a single bottle of water. You are given a map of your marathon route with all the water stations marked. Design an efficient algorithm ...

Analytic reportpurpose the purpose of this task is to

Analytic Report: Purpose: The purpose of this task is to provide students with practical experience in working in teams to write a Data Analytical report to provide useful insights, pattern and trends in the chosen/given ...

Query 1 the bookstore has decided to keep track of the

Query 1: The bookstore has decided to keep track of the vendors' information. In order to do this, one new table will be added to the database. The schema for this table, as related to the existing tables, is the followi ...

Question create the physical data model for the logical

Question: Create the physical data model for the logical data model that you submitted in IP3. This should include all of the data definition language SQL. Your submission should include all DDL needed to: Create the tab ...

Sqlquery 1 how many products have standard price less than

SQL Query 1. How many products have standard price less than 1000? Query 2: Display all attributes for products made of "Cherry" from Product table w/o referring to column names. Query 3: Display all product names having ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As