Question
Regular Expressions In this assignment you will create a regular expression to retrieve a subset data from the purpose column of the taxdata table in
Regular Expressions
In this assignment you will create a regular expression to retrieve a subset data from the purpose column of the taxdata table in the readonly database (access details below). Write a regular expressions to retrieve that meet the following criteria:
Lines that have three upper case characters in parenthesis like (LTI) - remember to escape certain characters :)
As an example (not the solution to this assignment), if you were looking for lines where the very first character was an upper case character letter you would run the following query:
SELECT purpose FROM taxdata WHERE purpose ~ '^[A-Z]' ORDER BY purpose DESC LIMIT 3;
The autograder will add all the SQL - all you need is to enter the appropriate regular expression below.
Here are the first few lines:
1. we are dedicated to animal welfare and preventing cruelty to stray, abandoned or abused dogs and cats in Harris and Montgomery counties of texas. We will focus our efforts on Trap Neuter and Return(TNR) of cats and helping cats and dogs in need. We have established a sanctuary for animals that can't be adopted due to medical condition or age. These activities will be conducted by board members, the volunteers and members of the organization. We will provide shelter, water, food and medical care and rehabilitation for animals in need. Medical care will be performed by local veterinarians and will include but not limited to sterilization, vaccinations, testing for disease, as well any other medical care recommended by the Vet to promote the health of the animal. We focus on animals in need in Harris and Montgomery county Texas. We perform TNR which is common practice in cat rescue. We trap stray animals and spay/neuter/vaccinate and vetted and return them to their location if possible. We also sponsor free cat and dog sterilazation service to residents of the counties. We also offer a voucher system for residents in need who can't afford sterlization services. We also devote our efforts to animals in the 5th ward of Houston which is a low income area. We also offer residents of this area with pet food, vetting and pet care as needed. Our first and foremost goal is to educate and assist area residents who may need help understanding how to better care for their pets and who may need economic assitance to ensure their pets receive essential medical care. We provide residents with vouchers that cover the complete cost of having animals altered and vaccinated against rabies and common diseases. In addition we provide vaccinations and worming in the field free of charge. We also assist residents in placing unwanted puppies born in the area and work with those who own the many chained dogs we observe to provide shelter to protect them from the elements.137186
2. The National Coalition for History (NCH) advocates on federal legislative and regulatory issues affecting historians, archivists, teachers, researchers, and other stakeholders. Since 1982, the National Coalition for History (formerly the National Coordinating Committee for the Promotion of History) has served as the voice for the historical and archival professions in Washington, DC. The history coalition is a non-profit organization organized under Section 501(c)(3) of the Internal Revenue Code. NCH is solely supported by contributions from its member organizations and the general public.
operation of a commercial paper program for the benefit of california state university (CSU) to enhance the capital financing for projects, equipment, and facilities serving csu.
Here are access details for a readonly database:
Host: pg.pg4e.com Port: 5432 Database: readonly User: readonly Password: (hide/show copy) psql -h pg.pg4e.com -p 5432 -U readonly readonly
Here is the schema for the taxdata table:
readonly=# \d+ taxdata Column | Type | ----------+------------------------+ id | integer | ein | integer | name | character varying(255) | year | integer | revenue | bigint | expenses | bigint | purpose | text | ptid | character varying(255) | ptname | character varying(255) | city | character varying(255) | state | character varying(255) | url | character varying(255) |
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