Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to create a stored procedure that will be used to show the top student records based on gpa. An input parameter should be

I need to create a stored procedure that will be used to show the top student records based on gpa. An input parameter should be used to indicate the number of records to return...

I need to be able to execute exec spTopGPA(3) should return the top 3 student records based on gpa. I don't have to use ties. but ,I have to use dynamic sql and use the follow table schema.

CREATE TABLE [dbo].[student]( [StudentID] [int] IDENTITY(1,1) NOT NULL, [Firstname] [varchar](50) NOT NULL, [Lastname] [varchar](50) NOT NULL, [SS#] [int] NOT NULL, [GPA] [int] NOT NULL, PRIMARY KEY CLUSTERED ( [StudentID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], UNIQUE NONCLUSTERED ( [SS#] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[student] WITH CHECK ADD CHECK (([GPA]>=(0))) GO

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Upgrade Migration And Transformation Tips And Techniques

Authors: Edward Whalen ,Jim Czuprynski

1st Edition

0071846050, 978-0071846059

More Books

Students also viewed these Databases questions

Question

4. What should learners revisit and remember?

Answered: 1 week ago