Question

In: Computer Science

describe what these mysql queries do 1.) select lastname, firstname, region, birthday from Members where birthday...

describe what these mysql queries do

1.)

select lastname, firstname, region, birthday

        from Members

        where birthday in (select birthday

                            from Members

                            where email is not null) 

2.)

select Sales.Firstname As EmpFirst, Sales.Lastname as EmpLast, 

        Sup.Firstname as SupFirst, Sup.Lastname as SupLast

        from Salespeople Sales inner join Salespeople Sup

         On Sales.Supervisor=Sup.SalesID 

3.)

select Region, Gender, Count(*) As Num

         from Members

         where Email is null group by region, gender   

4.)

select title

        from titles

        where not Genre = 'Jazz'; 

Solutions

Expert Solution

Query 1:

In this query firstly inner query run and select all the birthday from member table where email id is not null. After that outer query is run and print lastname,firstname,region, bithday from member table where bithday are matching with inner query output.

Query 2:

this query consist of inner join in Salespeople table on supervisor and salesId column.

this query two alies name are creaed of the same table first is sales and second is sup.

So when condition Sales.Supervisor=Sup.SalesID is matched, then

it print sales first name as EmpFirst and Sales Lastname as EmpLast and sup first name as SupFirst and Sup Lastname as SupLast.

Query 3:

In this query, it group all the region and gender where email id is null and then print region ,gender with their count.( same region and gender are group together).

Query 4:

In this query,

it select all the title from titles table where Genre not equals to 'Jazz'


Related Solutions

Design a database/mysql that has 3 tables: TABLE 1 student: StudID (int), LastName (varchar), FirstName (varchar),...
Design a database/mysql that has 3 tables: TABLE 1 student: StudID (int), LastName (varchar), FirstName (varchar), MiddleName(varchar) TABLE 2 Course: StudID, CourseID TABLE 3 study course: CourseID(int), CourseTitle(varchar), Units(int), PreqCourse(varchar) ** Insert at least 5 records. ** Use the "select" command to view the content of the tables. ** POST THE SCREENSHOT
Subject DataBase/MySQL What is wrong with this statement? SELECT vendor_id, (SELECT vendor_name FROM vendors), avg(invoice_total) FROM...
Subject DataBase/MySQL What is wrong with this statement? SELECT vendor_id, (SELECT vendor_name FROM vendors), avg(invoice_total) FROM invoices GROUP BY vendor_id; Select one: a. The subquery returns more than 1 row. b. You need a JOIN ON clause to pull from multiple tables. c. You cannot have a subquery in the SELECT statement. d. The result is a Cartesian Product. e. There is nothing wrong with this statement. What is wrong with this statement? SELECT vendor_name, avg(invoice_total) AS 'Invoice Total' FROM...
1) What term describe the region in space where there is a high probability of finding...
1) What term describe the region in space where there is a high probability of finding an electron? a) Quantum b) Dimension c) Configuration d) Orbital 2. Using the bronsted-lowry theory of acids and bases, what is the conjugate acid of HSO4? a) H2SO4 b) 2HSO4 c) HSO4 d) SO42 3.) How is the atomic mass of any element calculated? a) Protons plus electron b) Protons plus neutrons c) Electrons plus neutrons d) It is the number of protons 4.)...
What is SELECT? What is UPDATE? What is DELETE? What is FROM? What is WHERE? What...
What is SELECT? What is UPDATE? What is DELETE? What is FROM? What is WHERE? What is CREATE TABLE? What is INSERT INTO? What is VALUES? What is first Normal form
Please select three companies and describe what they do. Select a major component of their production...
Please select three companies and describe what they do. Select a major component of their production process and speculate on how to calculate unit costs. Identify what you think are their variable, fixed, and mixed costs of each. I need another essay with different companies and reference in APA style
Where and how do you select a sample? I am stuck on the concept of what...
Where and how do you select a sample? I am stuck on the concept of what it means.
A survey of 800 adults from a certain region​ asked, "What do you buy from your...
A survey of 800 adults from a certain region​ asked, "What do you buy from your mobile​ device?" The results indicated that 57​% of the females and 48​% of the males answered clothes. The sample sizes of males and females were not provided. Suppose that of 500 ​females, 285 reported they buy clothing from their mobile​ device, while of 300 ​males, 144 reported they buy clothing from their mobile device. A. is there evidence of a difference between males and...
A survey of 800 adults from a certain region​ asked, "What do you buy from your...
A survey of 800 adults from a certain region​ asked, "What do you buy from your mobile​ device?" The results indicated that 57​% of the females and 48​% of the males answered clothes. The sample sizes of males and females were not provided. Suppose that of 500 ​females, 285 reported they buy clothing from their mobile​ device, while of 300 ​males, 144 reported they buy clothing from their mobile device. D: What are your answers to​ (a) through​ (c) if...
A survey of 800 adults from a certain region​ asked, "What do you buy from your...
A survey of 800 adults from a certain region​ asked, "What do you buy from your mobile​ device?" The results indicated that 57​% of the females and 48​% of the males answered clothes. The sample sizes of males and females were not provided. Suppose that of 500 ​females, 285 reported they buy clothing from their mobile​ device, while of 300 ​males, 144 reported they buy clothing from their mobile device. A. is there evidence of a difference between males and...
A survey of 900 adults from a certain region​ asked, "What do you buy from your...
A survey of 900 adults from a certain region​ asked, "What do you buy from your mobile​ device?" The results indicated that 48​% of the females and 40​% of the males answered clothes. The sample sizes of males and females were not provided. Suppose that of 300 ​females, 144 reported they buy clothing from their mobile​ device, while of 600 ​males, 240 reported they buy clothing from their mobile device. Complete parts​ (a) through​ (d) below. a. Is there evidence...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT