Write the following queries in Oracle SQL: Count the number of businesses having
ID: 3664396 • Letter: W
Question
Write the following queries in Oracle SQL: Count the number of businesses having business category name as “National Parks” situated in Arizona.
Here are the tables that you will be using. Please provide the code for the SQL as well for the creation of these tables along with the question provided above.
Busn Catg. Id BCT1 BCT2 BCT3 BCT4 BCT5 BCT6 BCT7 BCT8 Busn Catg Name Amusement Parks National Parks Career Counseling Food and More List Of Subcategories Water Parks Wildlife National Parks Career Counselling for kids lce-cream and Yougurt Sports bair lce-cream and Yougurt Swimming pool cleaners Cold coffee shops Restaurents Pool Cleaners Coffee ShopsExplanation / Answer
The SELECT statement is used to select data from a database.
The COUNT() function returns the number of rows that matches a specified criteria.
The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
SELECT COUNT(*) FROM table_name; if the column have the duplicate values use distinct.
SELECT COUNT(DISTINCT column_name) FROM table_name;
Select count (Busn Catg Name) where BusnCatg.ListofSubcategories = national Parks and Business.Address contains(Arizona);
it access the two tables with the given condition. it counts the Busn Catg Name field.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.