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

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  What is redundant data and why should it be avoided

What are the advantages of using relational databases in the development of interactive web applications.

  Explain two methods for categorical data conversion

explain two methods for categorical data conversion. List the advantages and disadvantages of this approach.

  What is the time efficiency class of the algorithm

Write down an algorithm for finding the largest key in the binary search tree. What is the time efficiency class of your algorithm in the worst case?

  Identifying the malicious activity in the program

State the most effective method in order to find if an attack has been made on the computer network? Specify the malicious activities does your recommendation recognize?

  What sorts of network servers and resources

What sorts of network servers and resources.

  What is the significance of optimizing the design

What is the significance of optimizing the design

  Distributed database

A distributed database is also termed as the Replicated Virtualized Rendered Concatenated database.

  What is an interface

What is an interface

  Describe how logical and physical representations

explain how logical and physical representations of a To-Be system will differ.

  Application and technology architectures

Generate an application architecture plan for the RPS to follow for the next five (5) years. Build a technology architecture plan and graphic rendering for RPS in order to follow for the next five (5) years.

  Compute integral of n-order polynomial using simpson''s rule

The user shall be able to define that integration technique they want to use (They should also have the option to run both integration techniques in one execution)

  Creating a traffic light with three small square text boxes

Create a traffic light having three small square text boxes substituted vertically on the form initially, bottom text box is solid green and other text boxes are dark gray.

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