Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Stored Procedures and User - defined functions Part One: 1 . Find the name of the Database you are using. SQL / MySQL Code: Screenshot:
Stored Procedures and Userdefined functions
Part One:
Find the name of the Database you are using.
SQLMySQL Code:
Screenshot:
Find the name of the Database using parameter @id
SQLMySQL Code:
Screenshot:
Create a stored procedure that returns all officers first and last names supplied their
precinct, badge, and their status. This procedure does not use any parameters.
SQLMySQL Code:
Screenshot:
Create a procedure that returns two result sets:
a Top rows showing officer id his first and last name
b Top rows showing crime id and its classification.
SQLMySQL Code:
Screenshot:
Create a stored procedure that returns information for a specific criminal by passing
values for the criminals first name and last name. This procedure accepts only exact
matches for the parameters passed.
SQLMySQL Code:
Screenshot:
Create a stored procedure that returns information for criminals by passing full or partial
values for the criminals first name and last name. This procedure pattern matches the
parameters passed or if not supplied, uses the preset default last names that start with
the letter D
SQLMySQL Code:
Screenshot:
Part Two:
You must create your own functions userdefined
Display code description that has crime code from to display both columns.
SQLMySQL Code:
Screenshot:
Display the lowest fine amount charged to a crime. Give the column an alias name
Lowest Fine Amount
SQLMySQL Code:
Screenshot:
Write a query to return the current date along with time in MS SQL Server.
SQLMySQL Code:
Screenshot:
Add days to the pay due date of the crimecharges table then display the result, name
the column NewDuedate.
SQLMySQL Code:
Screenshot:
Display crime id and calculate how many days between filing and hearing dates, name
this column Days to Hearing
SQLMySQL Code:
Screenshot:
Display officer id along with their last names and the last five characters of their badges.
SQLMySQL Code:
Screenshot:
Write a query to display the probation officers id and their first and last names separated
by comma in upper case letters, name the column O
SQLMySQL Code:
Screenshot:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started