Question

Case Study The City Jail Technologies Department is constructing an application to allow users in the...

Case Study

The City Jail Technologies Department is constructing an application to allow users in the Crime Analysis Unit to query data more easily. This system requires creating a number of views, described in the following list. Provide the SQL statement to perform each task and test your views with a query.

1. Create a statement that always returns the names of the three criminals with the highest number of crimes committed.

2. Create a view that includes details for all crimes, including criminal ID, criminal name, criminal parole status, crime ID, date of crime charge, crime status, charge ID, crime code, charge status, pay due date, and amount due. This view shouldn’t allow performing any DML operations. Each time the view is used in the application, the data should be queried from the database. (For example, each use of the view should reflect the most current data in the database.)

3. Create a view that includes all data for officers, including the total number of crimes in which they participated in filing charges. To speed up the officer queries, store this view data and schedule the data to be updated every two weeks.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

--1

Select c.frist,c.last,cr.criminal_id,count(cr.crime_id) As NumberOfCrimes from crimes INNER join criminals c on cr.criminal_id=c.criminal_id group by cr.criminal_id,c first,c.last order by count(cr.crime_id) desc fetch first 3 rows only;

In above we have used fetch to limit records and inner join between table to get count of crimes of each criminal.and with help of group by aggregate of crimes.

Add a comment
Know the answer?
Add Answer to:
Case Study The City Jail Technologies Department is constructing an application to allow users in the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Oracle 12c SQL - Chapter 5: Case Study: City Jail, Part II Note: You are limited...

    Oracle 12c SQL - Chapter 5: Case Study: City Jail, Part II Note: You are limited to using the Oracle Live interface to create solutions for the problems below. SQL Live does not allow as many commands, statements, and symbols as full Oracle SQL. Specifically, the ampersand substitution variable symbol (&) may not be used for any of the solutions below because Oracle Live does not recognize it. Oracle Live is available to use here: https://livesql.oracle.com/apex/f?p=590:1000 Execute the CityJail_5.sql script...

  • Note: Use the City Jail database created with the CityJail_8.sql script that you ran for the...

    Note: Use the City Jail database created with the CityJail_8.sql script that you ran for the Chapter 8 case study. The following list reflects the current data requests from city managers. Provide the SQL statements that satisfy the requests. For each request, include one solution using the traditional method and one using an ANSI JOIN statement. Test the statements and show execution results 4. Create an alphabetical list of all criminals, including criminal ID, name, violent offender status, parole status,...

  • Oracle 12c: SQL   Joan Casteel ISBN: 978-1-305-25103-8 Chapter 12 Case Study: City Jail Make sure you...

    Oracle 12c: SQL   Joan Casteel ISBN: 978-1-305-25103-8 Chapter 12 Case Study: City Jail Make sure you have run the CityJail_8.sql script from Chapter 8. This script makes all database objects available for completing this case study. The city's Crime Analysis unit has submitted the following data requests. Provide the SQL statements using subqueries to satisfy the requests. Test the statements and show execution results. Use a sql sub-query statement to answer the following: (Please provide correct answer for questions 6...

  • Connect to mySQL DBMS, open a SQL script file, navigate to CityJail.sql file and execute it...

    Connect to mySQL DBMS, open a SQL script file, navigate to CityJail.sql file and execute it to create tables and populate with the supplied data. If there are any errors in the script fix them. It is your job to find the errors and correct them. This is important. You will need correct data for future exercises in this module. Then answer all questions. Write the answer below each question then take screen shot of the result. This script builds...

  • Project Steps: 1. Database Design 1.1. Design and create a database in third normal form based...

    Project Steps: 1. Database Design 1.1. Design and create a database in third normal form based on the following requirements: • Each Job is for a specific customer and there can be more than one job per customer. • The name and address must be tracked for each customer. • Each job is described by up to 2000 characters. • Each job has a status of ‘open, ‘in process’, or ‘complete’. • Each job has a start date and end...

  • The University Accommodation Office Case Study The director of the University Accommodation Offic...

    The University Accommodation Office Case Study The director of the University Accommodation Office requires you to design a database to assist with the administration of the office. The requirements collection and analysis phase of the database design process has provided the following data requirements specification for the University Accommodation Office database followed by examples of query transactions that should be supported by the database. Data Requirements Students(entity) The data stored for each full-time student includes: the banner number, name (first...

  • Case Study – Personnel Self-Service System (PSS) Background Sales Corporation (SC) has approximately 3000 personnel. SC...

    Case Study – Personnel Self-Service System (PSS) Background Sales Corporation (SC) has approximately 3000 personnel. SC has experienced a 10 percent increase in personnel over the past two years, and long-range projections show that trend continuing for the next three years.Ron Taylor, the Human Resources (HR) director, is thinking of putting in place a Personnel Self-Service System (PSS) that will provide the capability for personnel to maintain some personal information so that it is accurate and up to date. The...

  • making a file You are tasked with creating a text-based program for storing data on Hotel...

    making a file You are tasked with creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages course, you will be creating the same application in the following three programming languages: • Java, • Python, and • Lisp As you implement the application in each language you should keep notes on: - The features of the languages used, - Which features you found useful, and - Any issues or complications which...

  • 1) analyze the following case 2) give a summary and suggest ways for the company ——————...

    1) analyze the following case 2) give a summary and suggest ways for the company —————— Salesforce.com, one of the most disruptive technology companies of the past few years, has single-handedly shaken up the software industry with its innovative business model and resounding success. Salesforce provides customer relationship management (CRM) and other application software solutions in the form of software as a service leased over the Internet, as opposed to software bought and installed on machines locally. The company was...

  • CASE 8 Unlocking the Secrets of the Apple iPhone in the Name of access the male...

    CASE 8 Unlocking the Secrets of the Apple iPhone in the Name of access the male San Bernardino suspect's iPhone 5c. Cook stated: Antiterrorism We are challenging the FBI's demands with the deepes respect for American democracy and a love of our country. We believe it would be in the best interest of everyone to step back and consider the implications While we believe the FBI's intentions are good, if would be wrong for the w e nt to force...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT