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

  Examine how computer forensics investigations pertain to law

Examine how computer forensics investigations pertain to law

  In brief describe rudimentary nms

Briefly explain rudimentary NMS (network management system) software components and the software applications that are required to support a network system.

  Recommend a removable storage backup

Managers want to be able to print schedules on any printer at any restaurant if traveling and in a motel with a laptop. Please explain what you would have to do to allow managers to do this and how they will reference the printer.

  Java program to declare an integer array and initializing it

Write down a complete Java program that declares an integer array, intArray, and initialize it to {1, 2, 3, 4, 5, 6, and 7}. The program must have the following methods:1) void displayOddPositions (). This method displays array elements in the odd..

  Benefits and de-merits of using mobile computing technology

Analyze the benefits and de-merits of utilizing the mobile computing technology to monitor the patients. Assess the security concerns with regard to transmission of the personal medical information over the wireless networks.

  What is standard purchasing system

SPS system would standardize purchasing practices for each Snad and Surf subsidiary and manage all purchasing information. System testing will be completed by end of the week. What kinds of documentation are required for this application?

  Modify program that reads three integer inputs into variable

Write down a program that reads three integer inputs into variables. Display the input values in both the ordered entered and in sorted order. This program should sort the numbers so that value1

  What variety of cable will work to make an association

What variety of cable will work to make an association

  How java programming knowledge benefits nonprogramming

How does information of programming concepts benefits individuals working in almost any IT position? Include at least one specific example of how java programming knowledge benefits nonprogramming working in IT?

  Detecting problem behind slow system booting

Suppose you have observed that your system is performing slower than the usual. Which system resources are likely to be at the root of the problem?

  How to maintain different document object models

Both the Netscape/Mozilla and IE browsers maintain different document object models. Given the current era of open source, what do you think is the wisdom of maintaining two models.

  Utilize routers for connectivity devices instead of hubs

Utilize routers for connectivity devices instead of hubs

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