District attorney

In the United States, a district attorney (DA), state's attorney or state attorney is the chief prosecutor representing a U.S. state in a local government area, typically a county. The exact name and scope of the office varies by state. Alternative titles for the office include county attorney, commonwealth's attorney, solicitor, or county prosecutor.
The prosecution is the legal party responsible for presenting the case against an individual suspected of breaking the law, initiating and directing further criminal investigations, guiding and recommending the sentencing of offenders, and are the only attorneys allowed to participate in grand jury proceedings. The prosecutors decide what criminal charges to bring, and when and where a person will answer to those charges. In carrying out their duties, prosecutors have the authority to investigate persons, grant immunity to witnesses and accused criminals, and plea bargain with defendants.
A district attorney leads a staff of prosecutors, who are most commonly known as deputy district attorneys (DDAs). The deputy who serves as the supervisor of the office is often called the assistant district attorney. Most prosecutions will be delegated to DDAs, with the district attorney prosecuting the most important cases and having overall responsibility for their agency and its work. Depending upon the system in place, DAs may be appointed by the chief executive of the jurisdiction or elected by local voters.
History.
This term for a prosecutor originates with the traditional use of the term "district" for multi-county prosecutorial jurisdictions in several U.S. states. For example, New York appointed prosecutors to multi-county districts prior to 1813. Even after those states broke up such districts and started appointing or electing prosecutors for individual counties, they continued to use the title "district attorney" for the most senior prosecutor in a county rather than switch to "county attorney".
Role.
The principal duties of the district attorney are usually mandated by law and include representing the State in all criminal trials for crimes which occurred in the district attorney's geographical jurisdiction. The geographical jurisdiction of a district attorney may be delineated by the boundaries of a county, judicial circuit, or judicial district.
Their duties generally include charging crimes through informations and/or grand jury indictments. After levying criminal charges, the state's attorney will then prosecute those charged with a crime. This includes conducting discovery, plea bargaining, and trial.
In some jurisdictions, the district attorney may act as chief counsel for city police, county police, state police and all state law enforcement agencies within the state's attorney's jurisdiction.
In some jurisdictions, the district attorney oversees the operations of local prosecutors with respect to violations of county ordinances. In other jurisdictions, the district attorney prosecutes traffic matters and/or misdemeanors. In some states the district attorney prosecutes violations of state laws to the extent that the state permits local prosecution of these. District attorneys do not prosecute federal crimes, which are the jurisdiction of a United States Attorney.
Many district attorneys also bear responsibilities not related to criminal prosecution. These include defending the county against civil suits, occasionally initiating such suits on behalf of the county, preparing or reviewing contracts entered into by the county and providing legal advice and counsel to local government. In some jurisdictions, the county attorney does not handle any criminal matters at all, but serves only as the legal counsel to the county.
For example, in Arizona, Missouri, Montana, and Minnesota a county attorney represents the county and state within their county, prosecutes all felonies occurring within the county, and prosecutes misdemeanors occurring within unincorporated areas of the county. In Ohio a county prosecutor represents the county and state within their county, prosecutes all crimes within the county, and is legal adviser to the board of county commissioners, board of elections, and all other county officers and boards. On the other hand, county attorneys in Kentucky and Virginia prosecute only certain misdemeanors and sometimes traffic matters and serve as legal counsel for their county, with felony prosecutions and prosecutions of offenses not handled by the county attorney being the responsibility of the commonwealth's attorney for the given county.
Departments.
The district attorney usually divides their services into several departments that handle different areas of criminal law. Each department is staffed by several duly appointed and sworn ASAs. The departments of a large district attorney's office may include but are not limited to: felony, misdemeanor, domestic violence, traffic, juvenile, charging (or case filing), drug prosecution, forfeitures, civil affairs such as eminent domain, child advocacy, child support, victim assistance, appeals, career criminal prosecution, homicide, investigations, organized crime/gang, and administration.
Nomenclature.
The name of the role of local prosecutor may vary by state or jurisdiction based on whether they serve a county or a multi-county district, the responsibility to represent the state or county in addition to prosecution, or local historical customs. 
"District attorney" and "assistant district attorney" are the most common titles for state prosecutors, and are used by jurisdictions within the United States including California, Delaware, Georgia, Massachusetts, Nevada, New York, North Carolina, Oklahoma, Oregon, Pennsylvania, Texas, and Wisconsin.
"State's attorney" or "state attorney" is used in Connecticut, Florida (state attorney), Illinois, Maryland, North Dakota, South Dakota, and Vermont. In Maryland, the roles of Assistant and Deputy are reversed from those used in "District Attorney" jurisdictions, with Deputy State's Attorney being the primary subordinate to the elected State's Attorney and Assistant State's Attorneys (ASA) being the line-level prosecutors of the office.
In Kentucky and Virginia, the title is commonwealth's attorney. Commonwealth's attorneys are elected in their respective jurisdictions in both Virginia and Kentucky for terms of four years and six years, respectively.
In St. Louis, Missouri, the title is "circuit attorney", while in St. Louis County, Missouri, the title is "prosecuting attorney".
Assistant district attorney.
The assistant district attorney (assistant DA, ADA) (or state prosecutor or assistant state's attorney) is a law enforcement official who represents the state government on behalf of the district attorney in investigating and prosecuting individuals alleged to have committed a crime. In carrying out their duties to enforce state and local laws, ADA have the authority to investigate persons, issue subpoenas, file formal criminal charges, plea bargain with defendants, and grant immunity to witnesses and accused criminals. 
"Administrative assistant district attorney" (admin ADA), "executive assistant district attorney" (exec ADA), "chief assistant district attorney" (chief ADA), or "first assistant district attorney" (First ADA) are some of the titles given to the senior ADA leadership working under the DA. The chief ADA or first ADA, depending on the office, is generally considered the second-in-command, and usually reports directly to the DA. The exact roles and job assignments for each title vary with each individual office, but generally include management of the daily activities and supervision of specialized divisions within the office. Often, a senior ADA may oversee or prosecute some of the larger crimes within the jurisdiction. In some offices, the Exec ADA has the responsibility of hiring lawyers and support staff, as well as supervising press-releases and overseeing the work of the office.
The salary of an ADA will be lower than the elected DA. The non-monetary benefits of the job induce many to work as an ADA; these include the opportunity to amass trial experience, perform a public service, and network professionally.
Upon leaving employment as an ASA, persons seek employment as a judge, in private law firms, or as U.S. Attorneys.
Appeals.
Depending on state law, appeals are moved to appellate courts (also called appeals courts, courts of appeals, superior courts, or supreme courts in some states). During the appeals process district attorneys, in many cases, hands all relative prosecutorial materials to a state appellate prosecutor who in turn will represent the state in appellate courts with the advice and consent of the district attorney. 
District attorney investigators.
Some district attorneys maintain their own law enforcement arm whose members are sworn peace officers. Depending on the jurisdiction, they are referred to as "district attorney investigators" or "county detectives".
Other jurisdictions.
In England and Wales, the vast majority of criminal prosecutions are prosecuted by the Crown Prosecution Service. The CPS is headed by the Director of Public Prosecutions, who is appointed by the Attorney General for England and Wales. Within the CPS, 14 Chief Crown Prosecutors, answering to the DPP, head regional teams of Crown Prosecutors. With the exception of the AG and Solicitor General for England and Wales, no prosecutors are political officials in England and Wales and no prosecutor in England and Wales is a law enforcement official by virtue of their job.
In Canada, the equivalent position to a district attorney is a "crown attorney", "crown counsel" or "crown prosecutor" depending on the province, and the equivalent to an assistant district attorney is the assistant crown attorney, assistant crown counsel or assistant crown prosecutor respectively.