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

  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.

  Explain the common user interface

Think about how the Microsoft Office applications have been designed to work together. Look at the user interfaces of all the Microsoft Office applications you have installed on your computer and define the common user interface and features you s..

  Creating a static method

Write down a static method, getBigWords, which takes a String parameter and returns an array whose elements are words in the parameter that consists of more than 5 letters.

  Which of following statements is true

Which of following statements is true

  Developing program for real estate agent in java language

Write down a java program for the real estate agent. The program must carry out the following tasks: Ask the users for average house price for the each of the past 5 years for the single family residence of 1500 square feet.

  What are the hardest things in learning a new language

What is the hardest thing in learning a new language like Java and C++? How best to master these languages for a beginner with only procedual programming language experience.

  Utilize linked stack class to support an application

Utilize Linked stack class to support an application

  Electrical or magnetic field that the nervous system produce

activation of the brain is measured by electrophysiological techniques using an electrical or magnetic field that the nervous system produces. These types of measures include may include magneto-encephalography (MEG) or electroencephalography (EEG..

  Find out if they pass or fail the course

The administration of you local Community College has asked you to write down a VB.NET program that allows students to calculate the sum of their grades and find out if they pass or fail the course.

  The cpu of a personal computer''s hardware

Discuss in detail \CPU of a personal computer's hardware, and define how the characteristics of that aspect affect overall computer performance.

  Security issues while users processing the database

Describe the security issues which may be encountered when the multiple users process the database concurrently.

  Who approves and reject resources

What kind of system should be in place to manage change request and why you are choosing this technique.

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