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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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