Create a sql query that returns the names of the students

Assignment Help Computer Engineering
Reference no: EM1333294

Write a SQL query that returns the names of the students (lname, fname), and the major of the major with most students. If more than one major is tied for most students, then list all the names of the students from both majors (as well as the majors). Order the results by major (in the case of a tie) and then alphabetically by last name and first name.

Table Data:
id, fname, lname, major

1;"Jeff";"Salvage";"Computer Science"
2;"Thurman";"Munson";"Computer Science"
3;"Chase";"Utley";"Physical Fitness"
4;"Jimmy";"Rollins";"Computer Science"
5;"Derek";"Jeter";"World Series Championships"
6;"Jeff";"Popyack";"Mathematics"
7;"Kurt";"Schmidt";"Mathematics"
8;"Jason";"Lenhart";"Mathematics"
;"";"";""

Table SQL:

-- student information
CREATE TABLE Student (
id SERIAL PRIMARY KEY, -- student id number
fname VARCHAR(20) NOT NULL, -- first name
lname VARCHAR(20) NOT NULL, -- last name
major VARCHAR(60) NOT NULL -- major
);

INSERT INTO Student (fname, lname, major) VALUES ('Jeff', 'Salvage', 'Computer Science');
INSERT INTO Student (fname, lname, major) VALUES ('Thurman', 'Munson', 'Computer Science');
INSERT INTO Student (fname, lname, major) VALUES ('Chase', 'Utley', 'Physical Fitness');
INSERT INTO Student (fname, lname, major) VALUES ('Jimmy', 'Rollins', 'Computer Science');
INSERT INTO Student (fname, lname, major) VALUES ('Derek', 'Jeter', 'World Series Championships');
INSERT INTO Student (fname, lname, major) VALUES ('Jeff', 'Popyack', 'Mathematics');
INSERT INTO Student (fname, lname, major) VALUES ('Kurt', 'Schmidt', 'Mathematics');

Reference no: EM1333294

Questions Cloud

Strategies teams to improve decision making ability : Identify 2 strategies teams can use to improve their decision making ability. Would you argue that different types of decisions require different strategies.
Hr issue within the health care industry : Health Care Administration- HR training - Show training as an HR issue within the health care industry.
Legal principle to handle the court issues : Identify and discuss the legal principle that would be applied by a court to resolve this issue, and predict the outcome of the suit against Tom.
Define political risk : Define political risk and What are the types of political risks?
Create a sql query that returns the names of the students : Write down a SQL query that returns the names of the students (lname, fname), and the major of the major with most students. If more than one major is tied for most students, then list all the names of the students from both majors (as well as the..
Relationship between employee training and development : HR questions answered related to development and training - What is the relationship between employee training and employee development?
Discuss asia as a major marketplace : Discuss Asia as a major marketplace & business center in the world economy.
Develop a competitive advantage through talent : Develop a competitive advantage through talent and knowledge management and Aligning HR and HR related programs to support the organization's mission and goals
Decision model used in finanacial success : What decision model should be used? What is the optimal decision?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create a wbs and enter the tasks in project

Enter realistic durations for each task. Assume you have only four months to complete the project. Take a screen shot of the resulting Gantt chart and paste this into the Word for Windows file.

  Manage the threat, the risk, the disaster

Does one manage an imminent disaster or respond to it? Take a tornado, for example. Is this an imminent disaster waiting to happen? Do you manage the threat, the risk, the disaster or all three.

  Write down a public static method named chunk25

Write down a public static method named chunk25 that takes a double and returns an integer that represents the number of chunks of 25 in that number. A chunk of 25 is 25, or any part thereof

  Dns servers and dhcp servers

Assume that both the DNS servers and the DHCP servers send your client PC and IP addresses. Write down the differences between these two addresses.

  Why are most photographic images stored in a lossy format

Why are most photographic images stored in a lossy format

  Designing an inventory management system

Xhemrock is a brake pad manufacturing company. This company utilizes the raw materials, like carbon powder, ash, iron, and resin. It wishes to design an inventory management system which will have the following attributes: The system must store th..

  How to create an online account

A database would store the student's login name, class list, and number of registered credits. Furthermore, the database will store the administrator's login information and the classes listed in the online catalog. Add error handling to the appli..

  Consider the ways in which you can optimize a file

consider the ways in which you can optimize a file in order to reduce file size and maintain quality. What factors would you consider.

  Imagine we want to add to the sterling class

a penny may be further divided into halfpennies and farthings -> farthing worth 1/4 of a penny. There was a halfpenny coin, farthing coin, halffarthing coin.

  Explain the sum of the inverses of all positive integers

though , when we compute the sum in Java's floating point arithmetic the largest value we get is 15.403683, regardless of how many terms we add. Explain the possible reasons for this anomaly.

  Suspecting the icmp flooding attack

In reviewing your firewall logs, you notice a large number of the ICMP echo requests coming from external host 63.10.100.4. You suspect an attempted ICMP flooding attack. How could you respond.

  Produce a state transition diagram

Produce a state transition diagram

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd