1.If you do not have the world schema you can obtain the scripts to create the database schema from https://dev.mysql.com/doc/index-other.html
Queries
1. Write a SQL subquery that shows the unique region names where the languages spoken are English, French or German.
2. Write a SQL query that shows the country name, region, language for the Caribbean region
3. Write a SQL query that shows the country name once and shows the number of cities in that country. The number of cities in the country is from the City table and should have an alias of NumberofCity.
4. Write a SQL query that shows the country name and number of official languages with an alias NumberOfficial. Please note the condition is asking for the count where IsOfficial is true. The results need to be sorted by number of official languages (NumberOfficial) in descending order.
5. Write a SQL query that shows the country name and number of official languages with an alias NumberOfficial. Please note the condition is asking for the count where IsOfficial is true. Also, the results should show only if the count of the number of official languages is greater than 2. The results need to be sorted by number of official languages (NumberOfficial) in descending order.
Query
/*1. Write a SQL subquery that shows the unique region names
where the languages spoken are English, French or German.*/
Select Name from country where Code in(Select CountryCode from
countrylanguage where Language
in('English','French','German'));

/* 2. Write a SQL query that shows the country name, region,
language for the Caribbean region*/
Select country.Name,region,GROUP_CONCAT( Language ) as
"Language"from country inner join countrylanguage on
country.Code=countrylanguage.CountryCode where region='Caribbean'
group by country.Name;

/* 3. Write a SQL query that shows the country name once and shows
the number of cities in that country. The number of cities in the
country is from the City table and should have an alias of
NumberofCity.*/
Select country.Name,GROUP_CONCAT(City.Name) as "City"
from country inner join City on country.Code=City.CountryCode group
by country.Name;

/*4. Write a SQL query that shows the country name and number of
official languages with an alias NumberOfficial. Please note the
condition is asking for the count where IsOfficial is true. The
results need to be sorted by number of official languages
(NumberOfficial) in descending order.*/
Select country.Name,count(*)"NumberOfficial" from country inner
join countrylanguage on countrylanguage.CountryCode=country.Code
where IsOfficial='T' group by country.Name;

/* 5. Write a SQL query that shows the country name and number of
official languages with an alias NumberOfficial. Please note the
condition is asking for the count where IsOfficial is true. Also,
the results should show only if the count of the number of official
languages is greater than 2. The results need to be sorted by
number of official languages (NumberOfficial) in descending
order.*/
Select country.Name,count(*)"NumberOfficial" from country inner
join countrylanguage on countrylanguage.CountryCode=country.Code
where IsOfficial='T' group by country.Name having count(*)>2
order by NumberOfficial desc;

if you still have any Problem regarding this question please comment and if you like my code please appreciate me by thumbs up thank you.........
1.If you do not have the world schema you can obtain the scripts to create the...
if you do not have the world schema you can obtain the scripts to create the database schema from https://dev.mysql.com/doc/index-other.html Queries Write a SQL query that shows all the columns in the country table for the North America region. The results need to be sorted in ascending order by population. Write a SQL query that shows the unique regions in the country table except for the regions from the continent of Oceania. The results need to be sorted in ascending...
using the University database we have provided you with the creation script using the relational schema of a University as shown below. You should run this script in MySQL Workbench and use this database to extract the necessary information. The script is based on the following relational schema: Subject (subjectCode, departmentName) TeachingStaff (employeeNumber, firstName, surname, departmentName) Instructs (employeeNumber, subjectCode, studentID, position) Student (studentID, studentSurname, studentInitials, gender) TeachingCredentials (employeeNumber, degreecode, uni, awardYear) Enrolment (studentId, degreeCode, year, uni, timeMode, placeMode, completed) Grades...
SQL Queries – in this assignment you will be asked to create several SQL queries relating to the Sakila database that we installed in class. You may freely use DBeaver to create these queries, but I will expect your solution to show me the SQL code to answer or complete the tasks below. Write a query that produces the last name, first name, address, district, and phone number for every customer in the customer table. (You don’t need to include...
can someone solve these quick
please and thank you!
sql chapter 4
Query #1: List the company name, contact name, contact title and
the phone number for customers who HAVE NOT put in an order. Use an
outer join.
Query #2: Create a listing displaying the employee first name,
last name and the full name (First name space Last Name) of the
person they report to (Supervisor). This is a self-join. If an
employee does not report to anyone then...
--* BUSIT 103 Assignment #3 DUE DATE : Consult course calendar /* You are to develop SQL statements for each task listed. You should type your SQL statements under each task. You should always create an alias for any derived fields. Add a sort that makes sense for each query. */ USE AdventureWorksLT2012; --1. Build a single column of data in which...
Summarize these pages in your own style and you have to
include in your report some figures highlighting the relation
between these operations.
Basic AGGREGATE functions (Revision) COUNT: returns the number of tuples, which meet the specified condition: SELECT COUNT(DISTINCT Dept) AS Num_Depts FROM subject: SUM: returns the sum of the values in a specified column (i.e. numeric column) SELECT COUNT(*) AS hi_sal, SUM(salary) FROM Lecturer WHERE Salary > 4500 MIN: returns the minimum value in a specified column (numeri...
Put all of your SQL code in a file named grades.sql and submit it below. Download the starter code, which contains import_grades.sql and the grades.csv file. Using he import_grades, sql file, create your database and table. - 0 eded. 1 T Une Modify the LOAD DATA INFILE to correct the path to load the grades.csv file, and add/remove LOCAL he only modification you may make to the import_grades.sql or the grades.csv files. The data represents grades for assignments in a...
You will develop an E-Commerce database used to maintain
customers, products and sales information. You are required to 1)
gather and analyze requirements 2) design logical structure of the
database 3) create stored procedures to develop the tables and
insert the data 4) write SQL statements for data extraction and
reporting.
Throughout the course of this semester you have analyzed the
requirements for an eCommerce database, designed and developed your
database. As a class we have gone through the process...
Write Ten SQL SELECT statements to query the STUDENT schema you created for practice lab. 4. List all cities that have 10 or more students and instructors combined. Show city, state, number of student residents, number of instructor residents, and total student/instructor residents in that city. Sort by total in descending order. 5. List the instructor id and name of the instructors that teach fewer than 10 sections. 7. Find how many students are enrolled in sections taught by Todd...
This is about database system. Thank you.
Question B1 Create a Crow's Foot ERD with the business rules described below. Write all appropriate connectivities and cardinalities in the ERD. A music store would like to develop a database to manage information about the CDs, or vinyl collection, the customers and transactions information. It stores the relationships between artists, albums, tracks, customers and transactions. Here is the list of requirements for the database: The collection consists of albums. An album is...