SlideShare a Scribd company logo
1 of 38
Angela Sherrock
Abdulaziz Alghamdi
Saad Alqahtani
Mansour Alturki
Lab_4_Bank
The main purpose of this lab was to be able to create a
bank database and to be able to understand the way it works.
Being able to see the way it works with selecting the language,
deciding on which account you would like to view and or pull
money out of or to make a deposit.
Abdulaziz- create the tables and the data in the tables, queries
Saad- did the Entity Relationship Diagram, the Designing and
Implementation, and the Data Schema, queries
Masour- did the data into the tables, the data dictionary, queries
Angela (I)- did the specs document, the statistic queries, and the
index creation queries
Design and Implementation
With this you can choose your language, enter your pin. After
entering in your pin you can choose which you would like to do,
review your checking, savings accounts, make a withdrawal, or
make a deposit. You change enter in numbers if you mistype a
number and answer a yes or no question regarding if you want a
slip printed or not. If you are withdrawing then the desired
account needs to be entered. The same happens with depositing
money and reviewing both accounts.
Data Schema
Entity Relationship Diagram
Process
Clients
Bank
Insert Card
Pin Code
Amount Blanace
Deposit
Withdraw
Select Acount Type (Savings or Cheking)
Need a print or Not
Another Transaction or Exit
Select Language
View Available Balance
Select Deposit Type (Cash or check)
Insert Cash Or Check
Press If correct or change
Need a Print or Not
Another Transaction or Exit
Select Acount Type (Savings or Cheking)
Inter Amount
Take Your Money
Need a Print or Not
Another Transaction or Exit
Running head: LOCAL GOVERNMENT BUDGET
1
LOCAL GOVERNMENT BUDGET
4
Local Government Budget
Student’s Name
Institution
Local Government that has not signed Bankruptcy Petition
In the era where the economy has a lot of uncertainties, many
local governments are not able to meet their financial
obligations. This is one thing that is making the local
governments file for bankruptcy. Signing for bankruptcy is a
measure that is considered as being extreme. One of the local
government that has no doubt be faced with economic turmoil in
California. In the year 2009 California signed bankruptcy. With
the signing of the bankruptcy, the local government has not
engaged in the signing of a petition in order to get out of the
bankruptcy issue(Huang,2012).
Distribution of Income
The income gap has been rapidly on the increase in the past
three years in the state of California. Most people in the state of
California have been losing ground as compared to other people
in other states. However, the state has been facing a lot of
decline in the steep earnings of the poor and the low-income
earners in the state of California. The gap between the rich and
the poor has rapidly grown in California than in any other state
in the nation(Hyman,2014). When it comes to the distribution of
income in the three-year period, the male workers in California
have seen their position go down and get eroded. These are
aspects that have been affected due to the recession in the world
and which affected the US a lot.
Trends in revenue sources
The major revenue trends that have been witnessed in California
and other states are in the case in which the institutions of
finance get to be part of lives for people daily. This means if
the institutions are providing services to government or even
other population, it is then in order for the service and the
revenues to be reviewed. The trends should also have some
aspects of rewarding coupled with fun too. Trends of revenue
sources will also have to put into use the tools that are digital to
discover and meets the needs of people(Huang,2012). With the
provision of the funds together with the surplus, it then becomes
critical for government to have a restriction on how the budget
gets to be used.
Ethical Practices of the Financial Policy in regards to Fees
Taxes and Charges
The main ethical practices when issues to do with charges, fees
and taxes are involved are to do with transparency, honesty and
even accountability. When the taxes are collected, they should
be kept safe and as they are used there should be accountability
on the projects that they are used in. Charges should not be
hiked but should be retained at the normal rate and there should
be honesty on the side of those that are collecting the
charges(Hyman,2014). Same with the fees, there should also be
integrity and the fees should not be overcharged or misused for
wrong reasons.
Internal/External opportunities and challenges of revenue
sources
Technology is one of the best ways in which the revenue
resources can be Improved and even monitored. Technology is
used to make the revenue resources to get to be efficient making
money and other things to be well taken care of. Despite the
opportunities, challenges are there in the form of misuse of the
technology to steal from the revenue resources and even divert
money to own and selfish gains. Technology should be used to
make revenue resources more efficient(Huang,2012).
References
Huang, C. (2012, April 24). Recent studies find raining taxes on
high-income households
would not harm the economy. Retrieved from
http://www.cbpp.org/research/recent-studies-find-
raising-taxes-on-highincome-households-would-not-harm-the-
economy
Hyman, D. N. (2014). Public Finance: A contemporary
application of theory to policy (11th
ed.). Stamford, CT: Cengage Learning.
PA 5305, Public Finance and Budgeting 1
Course Learning Outcomes for Unit VII
Upon completion of this unit, students should be able to:
5. Evaluate a model budget.
5.1 Analyze taxation impact on budget allocations.
5.2 Determine the internal and external challenges of public
services and goods.
8. Apply practical methods to reconstructing finance and
budgeting techniques.
8.1 Identify financial policy of a municipal stabilization fund.
Reading Assignment
Chapter 14:
Taxation of Personal Income in the United States
Chapter 15:
Taxation of Corporate Income
Unit Lesson
The United States tax code has become unfathomably complex
(Glastris, 2011). The federal tax code that
impacted most Americans on April 15, 2015, was 74,608 pages
long. “That is 187 times longer than the code
was a century ago” (Russell, 2015a, para. 2). Tax reform can be
viewed as simplifying the tax code through
extending the tax base, which can be done by eliminating or
lowering exemptions and deductions. Reform,
experts suggest, should simultaneously reduce marginal tax
rates (MTR) while creating a more progressive
tax system (Common ground on tax, 2015). Although simplicity
is the goal, some argue that it leads to unfair
and/or unreasonable outcomes (Russell, 2015b). Many
presidents have historically had success in shaping
tax policy. A review of tax reform efforts can aid us in
understanding the evolution of the United States tax
code.
Experts affirm that efforts to account for how the distribution
and allocation from income tax impacts public
budgets should be a central focus of government officials
(Galper, Rueben, Auxier, & Eng, 2014). The 1981
Economic Recovery Tax Act cut marginal income tax rates
significantly for all taxpayers from 70% to 50% of
top tier earnings and from 14% to 11% for lower tier earnings
(Silliman, 2008). Later in 1986, the income tax
system was overhauled. Personal income tax rates and brackets
were sharply reduced, and the elimination of
many deductions, exclusions, and exemptions occurred (Hyman,
2014).
Central tenants of the 1993 Deficit Reduction Act proposed an
increase in gasoline taxes, an increase in
income tax on wealthier Social Security recipients, and a
marginal tax rate increase on upper earnings
(Silliman, 2008). The 1997 Taxpayer Relief Act offered
reductions such as middle-income credits for families
with children as well as incentives for home investments
(Silliman, 2008). Additionally, credits for college
tuition expenses were approved. For example, the Hope tax
credit was implemented. This credit was allowed
to be applied to the payment of the first two years of college
tuition and related expenses (Pirrone & Silliman,
2014). A second college credit included the Lifetime Learning
tax credit, which allowed students to claim up to
UNIT VII STUDY GUIDE
Tax Reform
PA 5305, Public Finance and Budgeting 2
UNIT x STUDY GUIDE
Title
$2,000 for qualified education expenses (Pirrone
& Silliman, 2014). In 2001, the Economic Growth
and Tax Relief Reconciliation Act implemented a
$1.3 trillion tax cut, including the reduction in what
many referred to as the marriage penalty tax
policy (Silliman, 2008).
Approved in 2003, the Jobs, Growth, Tax Relief,
and Reconciliation Act was designed to lower
rates pertaining to capital gains and dividends
(Silliman, 2008). Additionally, the act encouraged
business investment. Similarly, the 2009
American Recovery Reinvestment economic
policy encouraged spending, home and vehicle
ownership, and jump started business sectors of
the economy (Hyman, 2014). These and other
basic tax rate reductions were set to expire at the
end of 2010 (Hyman, 2014).
However, because of the recession of 2007-2010,
Congress opted to extend the tax cuts through the
end of 2012. Due to the slowly recovering and
fragile economy, Congress enacted the American Taxpayer
Relief Act in the latter part of 2012. This new
legislation prevented a considerable tax rate hike for American
citizens (Hyman, 2014). As a result, many
local governments reevaluated their budgetary stabilization
funds.
Tax reform can affect the distribution of the tax burden
(Hyman, 2014). Due to the complicated nature of the
tax code, the income tax can lead to efficiency loss. Therefore,
some tax reform efforts can trigger an
additional burden on the economy.
Taxpayers file federal and state income tax returns indicating
income earned (Hyman, 2014). It may surprise
many to know that although all income is required to be
reported, not all income is taxable. Universally,
taxable income represents earnings subject to income tax after
allowable deductions and exemptions have
been applied. Taxpayers must calculate their taxable income
beginning with totaling gross earnings, which
represent all income received including wages, salaries, interest
income, dividends, rental income, profits,
and unemployment compensation. Second, subtract allowable
adjustments to arrive at the adjusted gross
income. Third, subtract personal exemptions, which are a
predetermined, set amount by the government.
Personal exemption varies with the number of dependents.
Fourth, subtract the standard deduction or
itemized deductions, which yield taxable income.
Other steps in completing tax forms include analyzing the tax
liability. This is a specific tax rate that applies to
the base on the tax bracket and the filing status. Filing statuses,
according to Hyman (2014), are single,
couples who are married filing jointly, couples who are married
filing separately, and or heads of individual
households. Additionally, tax credits could be available based
on the gross income, such as the Earned
Income Tax Credit (EITC). The EITC is a credit from the IRS to
workers with dependent children. The EITC
offsets payroll tax on wages for many low-income workers.
Not only is income from individuals taxed, but revenue earned
by businesses or corporations is also subject to
taxation. However, sole owners of businesses file a tax form
referred to as Schedule C. The income of
business structures such as sole proprietorships and partnerships
is treated as personal income to the
owners of the business.
The level of taxation of corporations influences where they
locate. Countries with lower tax rates attract global
businesses. Domestically and internationally, the United States’
economy plays a significant role in business
development (Hyman, 2014). Many are familiar with the GM
and Chrysler government bailouts. Some
suggest that corporate tax reform will generate budget revenue,
rather than more bailouts (Minter, 2014). For
example, some argue that refurbishing the corporate tax code is
the solution to generating a wider tax base
(Desai, 2012). An interesting concept to note is a stockholder’s
income resulting from dividends is subjected
to double taxation (Hyman, 2014). Business profits can be
determined by subtracting costs from receipts for a
specified time frame, typically one year.
Photo of a master sergeant receiving his master’s
degree
(Hale, 2012)
PA 5305, Public Finance and Budgeting 3
UNIT x STUDY GUIDE
Title
Tax preferences, options, or loopholes are available in the forms
of exemptions, tax credits, exclusions, and
deductions (Hyman, 2014). These options are justified through a
general consensus that administrative tasks
for certain taxes are not feasible. Justification for these options
can be established because first, it is
collectively accepted that the aforementioned options result in
improving equity amongst taxpayers as well as
stimulate private expenditures. Second, the result aids
government in generating external benefits to the
public (Hyman, 2014). For example, Hyman (2014) suggests
that personal exemption amounts increase
simultaneously with dependents. Therefore, most citizens, if not
all, agree with the idea of providing tax
credits for dependent children. Similarly, medical expenses can
arise from a casualty or loss of wellbeing.
Individuals that fall into this category are viewed as being less
capable to pay (Hyman, 2014).
Additionally, tax preferences can be justified to promote
goodwill activities such as charitable donations and
endeavors that produce affirmative externalities (Hyman, 2014).
Furthermore, they act as proxies for
corrective subsidies, thereby helping to
achieve efficiency (Hyman, 2014). For
example, a business can apply for the Work
Opportunity Tax Credit if it hires military
veterans and active reservists. The Tax
Increase Prevention Act of 2014 also includes
the following tax credits and deductions for
individuals and businesses: Native American
employment credit and accelerated
depreciation on Native American reservations,
biodiesel and renewable diesel tax credits,
energy tax credits and deductions, clothing
donations to Goodwill, and monetary
donations to charities (Battersby, 2015).
Exclusions for taxable purposes can include
income fringe benefits, in-kind services,
capital gains, rental homes, interest on
allowable bonds, and dividends (Hyman,
2014). However, tax expenditures can cause
losses in efficiency and reductions in revenue
collection. For example, Goodwill donations,
legal itemized deductions, adjusted gross
income, property taxes, and approved medical
expenses are commonly known as miscellaneous deductions
(Hyman, 2014).
Many experts view the current tax code as outdated, unfair, and
inefficient (Glastris, 2011). However, income
tax revenue will likely grow as a share of the economy (Saving
& Viard, 2015). Ultimately, this growth will
continue to exacerbate the need for tax code reform, hence
promoting sustainability and fiscal growth.
References
Battersby, M. E. (2015). Tax increase prevention. Pit & Quarry,
107(8), 56-58.
Common ground on tax reform. (2015). Business Week, (4413),
12.
Desai, M. A. (2012). A better way to tax U.S. businesses.
Harvard Business Review, 90(7/8), 134-139.
Galper, H., Rueben, K., Auxier, R., & Eng, A. (2014).
Municipal debt: What does it buy and who benefits?.
National Tax Journal, 67(4), 901-924.
Glastris, P. (2011). Clean up as you cook. Washington Monthly,
43(3), 3.
Hale. J. (2012). JLBM’s first combined college graduation
DVIDS519916 [Photograph]. Retrieved from
https://commons.wikimedia.org/wiki/File:JBLM%27s_first_com
bined_college_graduation_DVIDS5199
16.jpg
Photo of a Goodwill store
(Henderson, 2010)
PA 5305, Public Finance and Budgeting 4
UNIT x STUDY GUIDE
Title
Henderson, J. (2010, April 1). Goodwill Tapscott jeh
[Photograph]. Retrieved from
https://commons.wikimedia.org/wiki/File:Goodwill_Tapscott_je
h.JPG
Hyman, D. N. (2014). Public finance: Contemporary application
of theory to policy (11th ed.). Stamford, CT:
Cengage Learning
Minter, S. (2014). The auto bailout and US manufacturing: A
house still divided. Industry Week, 263(6), 8.
Pirrone, M. M., & Silliman, B. R. (2014). The impact of college
tuition tax credits since 1998. Journal of
Business & Accounting, 5(1), 106-122.
Russell, J. (2015a, April 15). Look at how many pages are in
the federal tax code. Retrieved from
http://www.washingtonexaminer.com/look-at-how-many-pages-
are-in-the-federal-tax-
code/article/2563032
Russell, R. (2015b). Keeping the idea of reform alive.
Accounting Today, 29(5), 14-16.
Saving, J. L., & Viard, A. (2015). Are income taxes destined to
rise? Fiscal imbalance and the future tax policy
in the United States. National Tax Journal, 68(2), 235-250.
Silliman, B. (2008). Will the next president reform the tax
code? CPA Journal, 78(11), 22-27.
Lab 5 – Individual
Overall: Individually, you will be modifying the lab from last
week (Lab 4, bank lab) by examining the system your group
turned in last week and evaluating it for integrity and security
1- Take your design and discuss about how you could better
enforce referential integrity in terms of semantic data integrity.
For this portion I would like an explanation.
2- Add three constraints of your choice (that make sense) in
your system and explain WHY you have added those
constraints. For this portion I would like code and an
explanation
3- Write a trigger to meet a business need. For this portion I
would like code and an explanation of why the trigger meets the
business need.
4- Write a security plan based on the four areas we went over in
class. For this portion I would like an explanation.
Please notice that you will be graded MORE on your
explanations than the code itself
Make sure I have access to view your instance!
Deliverables:
Outlined above. Each section is worth 25 points. For each
section, the explanation portion is worth 15 points with the code
being worth 10 points.
ISTC3046-01 Advanced Database Management Systems
12/7/2017
Class 5
Integrity
Security
Dr. Bahm
Outline
Midterm
Project presentations next week
Individual Lab
Integrity
Mullins Chapter 13
Effective SQL Chapter 2 (the end)
Security
Mullins Chapter 14
MidtermGreater than 100090 - 100980 - 89770 - 79460 - 69250
- 59340 - 49230 - 39020 - 29010 - 1900 - 90Less than 00
GRADE DISTRIBUTION
77% Pass Percentage
Project Presentations
Next class
15 minutes per group
Go through your project
Focus on why you solved the problem the way that you did
Individual Lab
Modifying last weeks group lab individually
Based on what we will be learning today
Integrity
Chapter 13 Mullins
Two types of integrity
Database structure integrity
Keeping track of database objects and ensuring that each object
is created, formatted, and maintained properly is the goal of
database structure integrity
Semantic data integrity
Refers to the meaning of data and the relationships that need to
be maintained between different types of data
Two types of integrity
Database structure integrity
Keeping track of database objects and ensuring that each object
is created, formatted, and maintained properly is the goal of
database structure integrity
Semantic data integrity
Refers to the meaning of data and the relationships that need to
be maintained between different types of data
This means that you need to know the meaning in the first
place!
Database structural integrity
The DBMS uses internal structures and pointers to maintain
database objects in the proper order.
One potential problem experienced by relational databases is
index corruption
If the pointers do not point to the correct data, the index is
useless. In fact, it could be worse than useless if it is used to
access incorrect data and causes transactions to corrupt the
database.
Large data fields also use pointers
SQL Server text and image columns are not stored contiguously
with the rest of the data.
They are stored in a separate file and the primary file for the
table contains a pointer to the physical data location of the large
object
These pointers to get out of sync with the data, rendering the
data inaccessible.
Backup files
Backup files are another potential area for a structural integrity
problem
Each DBMS formats and maintains a specific structure for its
database backup files.
If the backup file is not formatted correctly, or if data is in the
wrong location in the backup file, it cannot be used by the
DBMS for recovery purposes.
Media failures, tape degradation, and bugs can cause such
problems.
How can you manage these problems?
DBCC utility – Database Console Commands
Be careful using the DBCC utility
Basic consistency checking
DBCC CHECKTABLE(table_name) checks the consistency of
the data and index pages of a table.
When DBCC is run using this option, it will report on the
number of data pages, the number of rows, the number of text
and image columns, as well as any integrity violations.
DBCC REINDEX(table_name) defragments the indexes built on
the specified table.
Other database checking commands
DBCC CHECKDB(database_name) runs CHECKTABLE on
every table in the database. This option checks the consistency
of the data and index pages of all defined tables
DBCC CHECKCATALOG(database_name) checks the
consistency of the system catalog tables for the specified
database. It will report on the size and number of segments
used, as well as detect and report on any integrity errors.
DBCC CHECKALLOC(database_name) checks the consistency
of the specified database and reports on the current extent
structure. The CHECKALLOC option may find spurious
allocation problems if DBCC is run while transactions are
modifying the database. This option also reports on the number
of allocations and the pages used per allocation.
DBCC CHECKFILEGROUP(filegroup_name) checks the
allocation and structural integrity of all tables and indexed
views in the specified database and issues a report of the
findings.
Using other tools
We can also use Microsoft Azure to check in on our system
Go to your Database
Monitoring
Support + Troubleshooting
How would I even know when to use this!?!?!
You will notice that the database performance will begin to “get
weird”
Think about the pointers…if our indexes aren’t working or
they’re pointing to something else, how will out database
behave?
Semantic Integrity
Semantic integrity
It’s all about the meaning of your data
Semantic data integrity deals with the DBMS features and
processes that can be used to ensure the accuracy and viability
of the data contents of a database.
Structural database integrity refers to the consistency of the
“holders” of the data (the database objects), semantic data
integrity refers to the consistency of the data itself.
In general…
If you have good semantic integrity you DON’T HAVE TO do a
bunch of checks
Good design and constraints will lead to a better database
design and better health overall
We used to use triggers and stored procedures to manage this
all, but in general that is falling out of favor
Entity integrity
Entity integrity is the most basic level of data integrity provided
by relational databases.
It means that each occurrence of an entity must be uniquely
identifiable.
In other words, entity integrity requires the specification of a
primary key for each entity and that no component of the
primary key be set to null.
Real talk
No major RDBMS product forces entity integrity because
entities, or tables, can be created without specifying a primary
key.
However, it is considered a bad practice to create tables without
a primary key because it makes identifying rows of the table
difficult.
Unique constraints
A unique constraint is similar to a primary key constraint
Each table can have zero, one, or many unique constraints
consisting of one or more columns each.
The values stored in the column, or combination of columns,
must be unique within the table—that is, no other row can
contain the same value.
Check constraints
A check constraint is a DBMS-defined restriction placed on the
data values that can be stored in a column or columns of a table
When a check constraint is defined, it places specific data value
restrictions on the contents of a column through the
specification of a Boolean expression
Constraints
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY
CHECK
DEFAULT
Defaults
You can set a default value for a field in a table
For example, if you don’t want it to be null, but a user doesn’t
enter the value in, what should you put?
Shows a default with a check
Triggers
Triggers are event-driven specialized procedures that are
attached to database tables.
A trigger is a piece of code that is executed in response to a
data modification statement, that is, an INSERT, UPDATE, or
DELETE.
Each trigger is attached to a single, specified table.
Triggers can be thought of as an advanced form of rule or
constraint that is written using an extended form of SQL. A
trigger cannot be directly called or executed; it is automatically
executed (or “fired”) by the RDBMS as the result of an action—
a data modification to the associated table.
Triggers cont’d
Triggers are quite flexible and can be coded to suit many
purposes. For example, triggers can
Access and modify other tables
Print informational messages
Specify complex restrictions
Example trigger
Beware!
Beware!
Don’t get crazy with triggers
Beware!
Instead, enforce referential integrity by design
Referential integrity
Referential integrity is a method for ensuring the “correctness”
of data.
RI embodies the integrity and usability of a relationship by
establishing rules that govern that relationship
The combination of the primary and foreign key columns and
the rules that dictate the data that can be housed in those key
columns is the beginning of understanding and using RI to
ensure correct and useful relational databases.
Referential integrity guarantees that an acceptable value is
always in the foreign key column.
Three types of rules can be attached to each referential
constraint.
What do you do when these things happen?!!?
INSERT rule
The INSERT rule indicates what will happen if you attempt to
insert a value into a foreign key column without a
corresponding primary key value in the parent table. There are
two aspects to the RI INSERT rule:
1. It is never permissible to insert a row into a dependent table
with a foreign key value that does not correspond to a primary
key value. This is known as the restrict-INSERT rule.
2. Whether actual values must be specified instead of nulls.
INSERT rule cont’d
For each relationship, the DBA must decide whether the foreign
key value(s) must be specified when the row is initially inserted
into the table.
To determine this, ask the following question: “Does it make
sense, in business terms, to know the primary key value in the
parent table when adding a dependent row?”
If a foreign key value is specified, it must be equal to one of the
values currently in the primary key column of the parent table.
This implements the restrict-INSERT rule. If a foreign key
value is optional, it can be set to null.
UPDATE rule
The basic purpose of the UPDATE rule is to control updates
such that a foreign key value cannot be updated to a value that
does not correspond to a primary key value in the parent table.
There are, however, two ways to view the update rule: from the
perspective of the foreign key and from that of the primary key.
UPDATE rule cont’d
Foreign key perspective. Once you have assigned a foreign key
to a row, either at insertion or afterward, you must decide
whether that value can be changed. Again, this is determined by
looking at the business definition of the relationship and the
tables it connects. However, if you permit a foreign key value to
be updated, the new value must either be equal to a primary key
value currently in the parent table or be null.
Primary key perspective. If a primary key value is updated,
three options exist for handling foreign key values:
Restricted UPDATE. The modification of the primary key
column(s) is not allowed if foreign key values exist.
Neutralizing UPDATE. All foreign key values equal to the
primary key value(s) being modified are set to null. Of course,
neutralizing UPDATE requires that nulls be permitted on the
foreign key column(s).
Cascading UPDATE. All foreign key columns with a value
equal to the primary key value(s) being modified are modified
as well.
DELETE rule
Referential integrity rules for deletion define what happens
when an attempt is made to delete a row from the parent table.
Similar to the primary key perspective of the UPDATE rule,
three options exist when deleting a row from a parent table:
Restricted DELETE. The deletion of the primary key row is not
allowed if a foreign key value exists.
Neutralizing DELETE. All foreign key values equal to the
primary key value of the row being deleted are set to null.
Cascading DELETE. All foreign key rows with a value equal to
the primary key of the row about to be deleted are deleted as
well.
GITHUB
http://www.tinyurl.com/istc3046basic
Chapter 2
Listing 2.17
Listing 2.18
Listing 2.19
Stored Procedures
Similar to triggers
Both consist of procedural logic that is stored in or managed by
the database
The difference is that stored procedures are not event driven
and are not attached to a specific table.
A stored procedure is explicitly executed by invoking a CALL
to the procedure (instead of being implicitly executed like
triggers)
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-
procedure-transact-sql
Sequences
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-
sequence-transact-sql
In case you want them
Security
Chapter 14 Mullins text
Make a security plan
We’re talking about people’s data here
Make sure that, like a change management plan, any system you
work with/design has a security plan
Data breaches
https://www.privacyrights.org/data-breaches
Basic security considerations
The basic security and authorization approach taken by DBMS
vendors to secure database access is that all database resources
are controlled by the DBMS.
No default authorizations are given to any user just because the
user logs in to the DBMS. Therefore, for a user to be able to
perform any DBMS operation or function, one of the following
conditions must exist:
The user has been granted the ability to perform that function or
operation, or
That operation or function has been granted generically to all
users.
All database resources are controlled by the DBMS.
Basically…
At a high level, database security boils down to answering four
questions:
Who is it? (authentication)
Who can do it? (authorization)
Who can see it? (encryption)
Who did it? (audit)
Authentication – Who is it?
Strong authentication is the cornerstone of any security
implementation plan
When the DBMS controls the addition of logins, the DBA is
required to provide certain information about the login when it
is created. Typically, other than the actual login name or ID, the
following information either can or must be provided:
Password—the key phrase, word, or character string associated
with the new login that must be provided by the user before
access to the database is permitted
Default database—the name of the database to which the user
will initially be connected during login
Default language—the default language assigned to the login
when using the DBMS if multiple languages are supported
Name—the actual full name of the user associated with this
login
Additional details—additional details about the user for which
the login has been created: e-mail, phone number, office
location, business unit, and so on (this is useful for
documentation purposes)
Authorization – Who can do it?
A login, sometimes called an account, is used to access the
DBMS, or database server. For this reason it is sometimes also
known as a server user ID, or SUID.
A user name is sometimes referred to as a database ID. The user
name is associated with the login account. Users are required by
some DBMS implementations to be set up with a database user
name in order to access each database.
How do I authorize?
GRANT assigns a permission to a database user.
REVOKE removes a permission from a database user
In azure you can also add a user through the portal
Who is granting/revoking?
Decentralized administration is generally easier to establish, but
more difficult to control. As more and more users obtain the
authority to grant privileges, the scope of authority is widened
and becomes unwieldy.
Centralized administration is generally easier to administer but
places a burden on the centralized administrator as the sole
arbiter of privileges within the environment.
Privileges
The following types of privileges are commonly provided by
modern DBMSs:
Table: to control who can access and modify the data within
tables
Database object: to control who can create new database objects
and drop existing database objects
System: to control who can perform certain types of system-
wide activities
Program: to control who can create, modify, and use database
programs
Stored procedure: to control who can execute specific functions
and stored procedures
Table privileges
Table privileges are granted to enable users to access tables,
views, and columns within tables and views. The following
privileges can be granted for tables and views:
SELECT: to enable the user to select from this table/view
INSERT: to enable the user to insert rows into this table/view
UPDATE: to enable the user to update this table/view
DELETE: to enable the user to delete rows from this table/view
ALL: to enable the user to select, insert, update, and delete
using this table/view
For example, to enable user7 to delete rows from the Titles
table, the following statement can be issued:
GRANT DELETE on Titles to user7;
Table privileges
Table privileges are granted to enable users to access tables,
views, and columns within tables and views. The following
privileges can be granted for tables and views:
SELECT: to enable the user to select from this table/view
INSERT: to enable the user to insert rows into this table/view
UPDATE: to enable the user to update this table/view
DELETE: to enable the user to delete rows from this table/view
ALL: to enable the user to select, insert, update, and delete
using this table/view
For example, to enable user7 to delete rows from the Titles
table, the following statement can be issued:
GRANT DELETE on Titles to user7;
By the column!!!!!
Before we go any further…
To find your users….
Database principals:
SELECT * FROM sys.database_principals
Server logins:
SELECT * FROM sys.server_principals
To create a user in SQL:
https://docs.microsoft.com/en-us/sql/relational-
databases/security/authentication-access/create-a-database-user
..or you can do it in azure
What does this do?
LBAC
Label based access control
LBAC provides for a more granular security scheme, specifying
who can read and modify data in individual rows and/or
columns.
Encryption – Who can see it?
SQL Injection attacks
SQL injection is a form of Web hacking whereby SQL
statements are specified in a Web form to expose data to the
attacker.
Let’s say….
SELECT userid, password
FROM uid_pwd_table
WHERE field = '$EMAIL';
Let’s say….
SELECT userid, password
FROM uid_pwd_table
WHERE field = '$EMAIL';
So someone types in anything' OR '1'='1
Let’s say….
SELECT userid, password
FROM uid_pwd_table
WHERE field = '$EMAIL';
SELECT userid, password
FROM uid_pwd_table
WHERE field = 'anything' OR '1'='1';
This will cause a complete dump of every user ID and
passwords
Prevention
Using well-designed query language interpreters and coding
applications appropriately can prevent SQL injection attacks.
When possible, use static SQL (see the next section for more
details).
Always validate user input by testing type, length, format, and
range.
With knowledge of SQL injection techniques and proper
development procedures, all SQL injection attacks can be
prevented.
Auditing – Who did it?
Auditing is a DBMS facility that enables DBAs to track the use
of database resources and privileges.
When auditing is enabled, the DBMS will produce an audit trail
of database operations.
Each audited database operation produces an audit trail of
information, including what database object was impacted, who
performed the operation, and when.
Auditing cont’d
Depending on the level of auditing supported by the DBMS, an
actual record of what data actually changed may also be
recorded. Tracking who does what to which data when is
important because there are many threats to the security of your
data.
Auditing occurs post activity; it does not do anything to
prohibit access.
Internal security threats
External agents trying to compromise your security and access
your company data are rightly viewed as a threat to security.
However, industry studies have shown that many security
threats are internal—within your organization.
The most typical security threat is a disgruntled or malevolent
current or ex-employee who has valid access to the DBMS.
Keep your DBAs happy!
Auditing is crucial because you may need to find an instance of
unauthorized access by an authorized user.
Questions?
Local Government Budgeting and Tax Reform

More Related Content

Similar to Local Government Budgeting and Tax Reform

Finance And Budget Text Questions Essay
Finance And Budget Text Questions EssayFinance And Budget Text Questions Essay
Finance And Budget Text Questions EssayKate Subramanian
 
Report on tax Evasion in Bangladesh
Report on tax Evasion in Bangladesh Report on tax Evasion in Bangladesh
Report on tax Evasion in Bangladesh Abid Hasan
 
Report on tax evasion in bangladesh
Report on tax evasion in bangladeshReport on tax evasion in bangladesh
Report on tax evasion in bangladeshAbid Hasan
 
Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...
Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...
Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...Alexander Decker
 
Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...
Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...
Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...AI Publications
 
Assessment 4 Study GuideCiting Shafritz, J. M., Russell, .docx
Assessment 4 Study GuideCiting Shafritz, J. M., Russell, .docxAssessment 4 Study GuideCiting Shafritz, J. M., Russell, .docx
Assessment 4 Study GuideCiting Shafritz, J. M., Russell, .docxdavezstarr61655
 
Response one PADM-05  Mortgage interest rates are expected to ri.docx
Response one PADM-05  Mortgage interest rates are expected to ri.docxResponse one PADM-05  Mortgage interest rates are expected to ri.docx
Response one PADM-05  Mortgage interest rates are expected to ri.docxronak56
 
Exploring Tax Morale Essay
Exploring Tax Morale EssayExploring Tax Morale Essay
Exploring Tax Morale EssayJennifer Campbell
 
Running head TOPIC SELECTION 1TOPIC SELECTION 4.docx
Running head TOPIC SELECTION 1TOPIC SELECTION 4.docxRunning head TOPIC SELECTION 1TOPIC SELECTION 4.docx
Running head TOPIC SELECTION 1TOPIC SELECTION 4.docxtoltonkendal
 
020911 fiscal solutions tour austin tx
020911 fiscal solutions tour austin tx020911 fiscal solutions tour austin tx
020911 fiscal solutions tour austin txdv8621
 
Testimony -taxreform--pres budget commission5
Testimony -taxreform--pres budget commission5Testimony -taxreform--pres budget commission5
Testimony -taxreform--pres budget commission5Urban Institute
 
Primer [budget 2013]
Primer [budget 2013]Primer [budget 2013]
Primer [budget 2013]VJCiGlobe
 
Week 5 Discussion Responses – Financial AccountingDiscussion Res.docx
Week 5 Discussion Responses – Financial AccountingDiscussion Res.docxWeek 5 Discussion Responses – Financial AccountingDiscussion Res.docx
Week 5 Discussion Responses – Financial AccountingDiscussion Res.docxcockekeshia
 

Similar to Local Government Budgeting and Tax Reform (16)

Finance And Budget Text Questions Essay
Finance And Budget Text Questions EssayFinance And Budget Text Questions Essay
Finance And Budget Text Questions Essay
 
Economics 11
Economics 11Economics 11
Economics 11
 
Report on tax Evasion in Bangladesh
Report on tax Evasion in Bangladesh Report on tax Evasion in Bangladesh
Report on tax Evasion in Bangladesh
 
Report on tax evasion in bangladesh
Report on tax evasion in bangladeshReport on tax evasion in bangladesh
Report on tax evasion in bangladesh
 
Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...
Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...
Determinants of tax compliance behavior in ethiopia the case of bahir dar cit...
 
Fall 2009 Budget Forum
Fall 2009 Budget ForumFall 2009 Budget Forum
Fall 2009 Budget Forum
 
Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...
Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...
Determine the Effect of Subjective Norms on Tax Compliance among Small and Me...
 
Assessment 4 Study GuideCiting Shafritz, J. M., Russell, .docx
Assessment 4 Study GuideCiting Shafritz, J. M., Russell, .docxAssessment 4 Study GuideCiting Shafritz, J. M., Russell, .docx
Assessment 4 Study GuideCiting Shafritz, J. M., Russell, .docx
 
Response one PADM-05  Mortgage interest rates are expected to ri.docx
Response one PADM-05  Mortgage interest rates are expected to ri.docxResponse one PADM-05  Mortgage interest rates are expected to ri.docx
Response one PADM-05  Mortgage interest rates are expected to ri.docx
 
Exploring Tax Morale Essay
Exploring Tax Morale EssayExploring Tax Morale Essay
Exploring Tax Morale Essay
 
Running head TOPIC SELECTION 1TOPIC SELECTION 4.docx
Running head TOPIC SELECTION 1TOPIC SELECTION 4.docxRunning head TOPIC SELECTION 1TOPIC SELECTION 4.docx
Running head TOPIC SELECTION 1TOPIC SELECTION 4.docx
 
Accountable Advice_May-June-2014_1stNat_C
Accountable Advice_May-June-2014_1stNat_CAccountable Advice_May-June-2014_1stNat_C
Accountable Advice_May-June-2014_1stNat_C
 
020911 fiscal solutions tour austin tx
020911 fiscal solutions tour austin tx020911 fiscal solutions tour austin tx
020911 fiscal solutions tour austin tx
 
Testimony -taxreform--pres budget commission5
Testimony -taxreform--pres budget commission5Testimony -taxreform--pres budget commission5
Testimony -taxreform--pres budget commission5
 
Primer [budget 2013]
Primer [budget 2013]Primer [budget 2013]
Primer [budget 2013]
 
Week 5 Discussion Responses – Financial AccountingDiscussion Res.docx
Week 5 Discussion Responses – Financial AccountingDiscussion Res.docxWeek 5 Discussion Responses – Financial AccountingDiscussion Res.docx
Week 5 Discussion Responses – Financial AccountingDiscussion Res.docx
 

More from justine1simpson78276

You will submit a 1-2 page double spaced paper, plus references, des.docx
You will submit a 1-2 page double spaced paper, plus references, des.docxYou will submit a 1-2 page double spaced paper, plus references, des.docx
You will submit a 1-2 page double spaced paper, plus references, des.docxjustine1simpson78276
 
you will submit a 150-200 word reading summary -Reasons for the .docx
you will submit a 150-200 word reading summary -Reasons for the .docxyou will submit a 150-200 word reading summary -Reasons for the .docx
you will submit a 150-200 word reading summary -Reasons for the .docxjustine1simpson78276
 
You will submit a 1500 word fully-referenced critical essay .docx
You will submit a 1500 word fully-referenced critical essay .docxYou will submit a 1500 word fully-referenced critical essay .docx
You will submit a 1500 word fully-referenced critical essay .docxjustine1simpson78276
 
you will submit a 150-200 word reading summary The story of real.docx
you will submit a 150-200 word reading summary The story of real.docxyou will submit a 150-200 word reading summary The story of real.docx
you will submit a 150-200 word reading summary The story of real.docxjustine1simpson78276
 
You will select an enterprise-level risks that impact an organizatio.docx
You will select an enterprise-level risks that impact an organizatio.docxYou will select an enterprise-level risks that impact an organizatio.docx
You will select an enterprise-level risks that impact an organizatio.docxjustine1simpson78276
 
You will select a psychologist (Skinner or Freud ) and conduct a bri.docx
You will select a psychologist (Skinner or Freud ) and conduct a bri.docxYou will select a psychologist (Skinner or Freud ) and conduct a bri.docx
You will select a psychologist (Skinner or Freud ) and conduct a bri.docxjustine1simpson78276
 
You will select a hot button issue from current or relatively re.docx
You will select a hot button issue from current or relatively re.docxYou will select a hot button issue from current or relatively re.docx
You will select a hot button issue from current or relatively re.docxjustine1simpson78276
 
you will research resources available on the Internet for monitoring.docx
you will research resources available on the Internet for monitoring.docxyou will research resources available on the Internet for monitoring.docx
you will research resources available on the Internet for monitoring.docxjustine1simpson78276
 
You will review qualitative research.  The topic is up to you as lon.docx
You will review qualitative research.  The topic is up to you as lon.docxYou will review qualitative research.  The topic is up to you as lon.docx
You will review qualitative research.  The topic is up to you as lon.docxjustine1simpson78276
 
You will review quantitative research.  The topic is up to you as lo.docx
You will review quantitative research.  The topic is up to you as lo.docxYou will review quantitative research.  The topic is up to you as lo.docx
You will review quantitative research.  The topic is up to you as lo.docxjustine1simpson78276
 
You will research one womens movement that we have not discussed in.docx
You will research one womens movement that we have not discussed in.docxYou will research one womens movement that we have not discussed in.docx
You will research one womens movement that we have not discussed in.docxjustine1simpson78276
 
You will research a Native American or African communitys culture, .docx
You will research a Native American or African communitys culture, .docxYou will research a Native American or African communitys culture, .docx
You will research a Native American or African communitys culture, .docxjustine1simpson78276
 
You will receive 15 points extra credit (added to the homework p.docx
You will receive 15 points extra credit (added to the homework p.docxYou will receive 15 points extra credit (added to the homework p.docx
You will receive 15 points extra credit (added to the homework p.docxjustine1simpson78276
 
You will provide a short analysis of the interaction of group member.docx
You will provide a short analysis of the interaction of group member.docxYou will provide a short analysis of the interaction of group member.docx
You will provide a short analysis of the interaction of group member.docxjustine1simpson78276
 
You will produce and submit a Powerpoint  of screenshots related to .docx
You will produce and submit a Powerpoint  of screenshots related to .docxYou will produce and submit a Powerpoint  of screenshots related to .docx
You will produce and submit a Powerpoint  of screenshots related to .docxjustine1simpson78276
 
You will produce a clear and coherent writing that is well organized.docx
You will produce a clear and coherent writing that is well organized.docxYou will produce a clear and coherent writing that is well organized.docx
You will produce a clear and coherent writing that is well organized.docxjustine1simpson78276
 
You will present ADP and Paychex as the recommendations to the VP .docx
You will present ADP and Paychex as the recommendations to the VP .docxYou will present ADP and Paychex as the recommendations to the VP .docx
You will present ADP and Paychex as the recommendations to the VP .docxjustine1simpson78276
 
You will prepare and present a personality analysis of your choo.docx
You will prepare and present a personality analysis of your choo.docxYou will prepare and present a personality analysis of your choo.docx
You will prepare and present a personality analysis of your choo.docxjustine1simpson78276
 
you will prepare a PowerPoint presentation on the consumer infor.docx
you will prepare a PowerPoint presentation on the consumer infor.docxyou will prepare a PowerPoint presentation on the consumer infor.docx
you will prepare a PowerPoint presentation on the consumer infor.docxjustine1simpson78276
 
You will post a 250-word reply to 2 classmate’s threads. The reply r.docx
You will post a 250-word reply to 2 classmate’s threads. The reply r.docxYou will post a 250-word reply to 2 classmate’s threads. The reply r.docx
You will post a 250-word reply to 2 classmate’s threads. The reply r.docxjustine1simpson78276
 

More from justine1simpson78276 (20)

You will submit a 1-2 page double spaced paper, plus references, des.docx
You will submit a 1-2 page double spaced paper, plus references, des.docxYou will submit a 1-2 page double spaced paper, plus references, des.docx
You will submit a 1-2 page double spaced paper, plus references, des.docx
 
you will submit a 150-200 word reading summary -Reasons for the .docx
you will submit a 150-200 word reading summary -Reasons for the .docxyou will submit a 150-200 word reading summary -Reasons for the .docx
you will submit a 150-200 word reading summary -Reasons for the .docx
 
You will submit a 1500 word fully-referenced critical essay .docx
You will submit a 1500 word fully-referenced critical essay .docxYou will submit a 1500 word fully-referenced critical essay .docx
You will submit a 1500 word fully-referenced critical essay .docx
 
you will submit a 150-200 word reading summary The story of real.docx
you will submit a 150-200 word reading summary The story of real.docxyou will submit a 150-200 word reading summary The story of real.docx
you will submit a 150-200 word reading summary The story of real.docx
 
You will select an enterprise-level risks that impact an organizatio.docx
You will select an enterprise-level risks that impact an organizatio.docxYou will select an enterprise-level risks that impact an organizatio.docx
You will select an enterprise-level risks that impact an organizatio.docx
 
You will select a psychologist (Skinner or Freud ) and conduct a bri.docx
You will select a psychologist (Skinner or Freud ) and conduct a bri.docxYou will select a psychologist (Skinner or Freud ) and conduct a bri.docx
You will select a psychologist (Skinner or Freud ) and conduct a bri.docx
 
You will select a hot button issue from current or relatively re.docx
You will select a hot button issue from current or relatively re.docxYou will select a hot button issue from current or relatively re.docx
You will select a hot button issue from current or relatively re.docx
 
you will research resources available on the Internet for monitoring.docx
you will research resources available on the Internet for monitoring.docxyou will research resources available on the Internet for monitoring.docx
you will research resources available on the Internet for monitoring.docx
 
You will review qualitative research.  The topic is up to you as lon.docx
You will review qualitative research.  The topic is up to you as lon.docxYou will review qualitative research.  The topic is up to you as lon.docx
You will review qualitative research.  The topic is up to you as lon.docx
 
You will review quantitative research.  The topic is up to you as lo.docx
You will review quantitative research.  The topic is up to you as lo.docxYou will review quantitative research.  The topic is up to you as lo.docx
You will review quantitative research.  The topic is up to you as lo.docx
 
You will research one womens movement that we have not discussed in.docx
You will research one womens movement that we have not discussed in.docxYou will research one womens movement that we have not discussed in.docx
You will research one womens movement that we have not discussed in.docx
 
You will research a Native American or African communitys culture, .docx
You will research a Native American or African communitys culture, .docxYou will research a Native American or African communitys culture, .docx
You will research a Native American or African communitys culture, .docx
 
You will receive 15 points extra credit (added to the homework p.docx
You will receive 15 points extra credit (added to the homework p.docxYou will receive 15 points extra credit (added to the homework p.docx
You will receive 15 points extra credit (added to the homework p.docx
 
You will provide a short analysis of the interaction of group member.docx
You will provide a short analysis of the interaction of group member.docxYou will provide a short analysis of the interaction of group member.docx
You will provide a short analysis of the interaction of group member.docx
 
You will produce and submit a Powerpoint  of screenshots related to .docx
You will produce and submit a Powerpoint  of screenshots related to .docxYou will produce and submit a Powerpoint  of screenshots related to .docx
You will produce and submit a Powerpoint  of screenshots related to .docx
 
You will produce a clear and coherent writing that is well organized.docx
You will produce a clear and coherent writing that is well organized.docxYou will produce a clear and coherent writing that is well organized.docx
You will produce a clear and coherent writing that is well organized.docx
 
You will present ADP and Paychex as the recommendations to the VP .docx
You will present ADP and Paychex as the recommendations to the VP .docxYou will present ADP and Paychex as the recommendations to the VP .docx
You will present ADP and Paychex as the recommendations to the VP .docx
 
You will prepare and present a personality analysis of your choo.docx
You will prepare and present a personality analysis of your choo.docxYou will prepare and present a personality analysis of your choo.docx
You will prepare and present a personality analysis of your choo.docx
 
you will prepare a PowerPoint presentation on the consumer infor.docx
you will prepare a PowerPoint presentation on the consumer infor.docxyou will prepare a PowerPoint presentation on the consumer infor.docx
you will prepare a PowerPoint presentation on the consumer infor.docx
 
You will post a 250-word reply to 2 classmate’s threads. The reply r.docx
You will post a 250-word reply to 2 classmate’s threads. The reply r.docxYou will post a 250-word reply to 2 classmate’s threads. The reply r.docx
You will post a 250-word reply to 2 classmate’s threads. The reply r.docx
 

Recently uploaded

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 

Local Government Budgeting and Tax Reform

  • 1. Angela Sherrock Abdulaziz Alghamdi Saad Alqahtani Mansour Alturki Lab_4_Bank The main purpose of this lab was to be able to create a bank database and to be able to understand the way it works. Being able to see the way it works with selecting the language, deciding on which account you would like to view and or pull money out of or to make a deposit. Abdulaziz- create the tables and the data in the tables, queries Saad- did the Entity Relationship Diagram, the Designing and Implementation, and the Data Schema, queries Masour- did the data into the tables, the data dictionary, queries Angela (I)- did the specs document, the statistic queries, and the index creation queries Design and Implementation With this you can choose your language, enter your pin. After entering in your pin you can choose which you would like to do, review your checking, savings accounts, make a withdrawal, or make a deposit. You change enter in numbers if you mistype a number and answer a yes or no question regarding if you want a slip printed or not. If you are withdrawing then the desired account needs to be entered. The same happens with depositing money and reviewing both accounts. Data Schema Entity Relationship Diagram Process
  • 2. Clients Bank Insert Card Pin Code Amount Blanace Deposit Withdraw Select Acount Type (Savings or Cheking) Need a print or Not Another Transaction or Exit Select Language View Available Balance Select Deposit Type (Cash or check)
  • 3. Insert Cash Or Check Press If correct or change Need a Print or Not Another Transaction or Exit Select Acount Type (Savings or Cheking) Inter Amount Take Your Money Need a Print or Not Another Transaction or Exit
  • 4.
  • 5. Running head: LOCAL GOVERNMENT BUDGET 1 LOCAL GOVERNMENT BUDGET 4 Local Government Budget Student’s Name Institution Local Government that has not signed Bankruptcy Petition In the era where the economy has a lot of uncertainties, many local governments are not able to meet their financial
  • 6. obligations. This is one thing that is making the local governments file for bankruptcy. Signing for bankruptcy is a measure that is considered as being extreme. One of the local government that has no doubt be faced with economic turmoil in California. In the year 2009 California signed bankruptcy. With the signing of the bankruptcy, the local government has not engaged in the signing of a petition in order to get out of the bankruptcy issue(Huang,2012). Distribution of Income The income gap has been rapidly on the increase in the past three years in the state of California. Most people in the state of California have been losing ground as compared to other people in other states. However, the state has been facing a lot of decline in the steep earnings of the poor and the low-income earners in the state of California. The gap between the rich and the poor has rapidly grown in California than in any other state in the nation(Hyman,2014). When it comes to the distribution of income in the three-year period, the male workers in California have seen their position go down and get eroded. These are aspects that have been affected due to the recession in the world and which affected the US a lot. Trends in revenue sources The major revenue trends that have been witnessed in California and other states are in the case in which the institutions of finance get to be part of lives for people daily. This means if the institutions are providing services to government or even other population, it is then in order for the service and the revenues to be reviewed. The trends should also have some aspects of rewarding coupled with fun too. Trends of revenue sources will also have to put into use the tools that are digital to discover and meets the needs of people(Huang,2012). With the provision of the funds together with the surplus, it then becomes
  • 7. critical for government to have a restriction on how the budget gets to be used. Ethical Practices of the Financial Policy in regards to Fees Taxes and Charges The main ethical practices when issues to do with charges, fees and taxes are involved are to do with transparency, honesty and even accountability. When the taxes are collected, they should be kept safe and as they are used there should be accountability on the projects that they are used in. Charges should not be hiked but should be retained at the normal rate and there should be honesty on the side of those that are collecting the charges(Hyman,2014). Same with the fees, there should also be integrity and the fees should not be overcharged or misused for wrong reasons. Internal/External opportunities and challenges of revenue sources Technology is one of the best ways in which the revenue resources can be Improved and even monitored. Technology is used to make the revenue resources to get to be efficient making money and other things to be well taken care of. Despite the opportunities, challenges are there in the form of misuse of the technology to steal from the revenue resources and even divert money to own and selfish gains. Technology should be used to make revenue resources more efficient(Huang,2012). References Huang, C. (2012, April 24). Recent studies find raining taxes on high-income households would not harm the economy. Retrieved from http://www.cbpp.org/research/recent-studies-find-
  • 8. raising-taxes-on-highincome-households-would-not-harm-the- economy Hyman, D. N. (2014). Public Finance: A contemporary application of theory to policy (11th ed.). Stamford, CT: Cengage Learning. PA 5305, Public Finance and Budgeting 1 Course Learning Outcomes for Unit VII Upon completion of this unit, students should be able to: 5. Evaluate a model budget. 5.1 Analyze taxation impact on budget allocations. 5.2 Determine the internal and external challenges of public services and goods. 8. Apply practical methods to reconstructing finance and budgeting techniques. 8.1 Identify financial policy of a municipal stabilization fund. Reading Assignment
  • 9. Chapter 14: Taxation of Personal Income in the United States Chapter 15: Taxation of Corporate Income Unit Lesson The United States tax code has become unfathomably complex (Glastris, 2011). The federal tax code that impacted most Americans on April 15, 2015, was 74,608 pages long. “That is 187 times longer than the code was a century ago” (Russell, 2015a, para. 2). Tax reform can be viewed as simplifying the tax code through extending the tax base, which can be done by eliminating or lowering exemptions and deductions. Reform, experts suggest, should simultaneously reduce marginal tax rates (MTR) while creating a more progressive tax system (Common ground on tax, 2015). Although simplicity is the goal, some argue that it leads to unfair and/or unreasonable outcomes (Russell, 2015b). Many presidents have historically had success in shaping tax policy. A review of tax reform efforts can aid us in understanding the evolution of the United States tax code. Experts affirm that efforts to account for how the distribution and allocation from income tax impacts public budgets should be a central focus of government officials (Galper, Rueben, Auxier, & Eng, 2014). The 1981 Economic Recovery Tax Act cut marginal income tax rates significantly for all taxpayers from 70% to 50% of top tier earnings and from 14% to 11% for lower tier earnings
  • 10. (Silliman, 2008). Later in 1986, the income tax system was overhauled. Personal income tax rates and brackets were sharply reduced, and the elimination of many deductions, exclusions, and exemptions occurred (Hyman, 2014). Central tenants of the 1993 Deficit Reduction Act proposed an increase in gasoline taxes, an increase in income tax on wealthier Social Security recipients, and a marginal tax rate increase on upper earnings (Silliman, 2008). The 1997 Taxpayer Relief Act offered reductions such as middle-income credits for families with children as well as incentives for home investments (Silliman, 2008). Additionally, credits for college tuition expenses were approved. For example, the Hope tax credit was implemented. This credit was allowed to be applied to the payment of the first two years of college tuition and related expenses (Pirrone & Silliman, 2014). A second college credit included the Lifetime Learning tax credit, which allowed students to claim up to UNIT VII STUDY GUIDE Tax Reform PA 5305, Public Finance and Budgeting 2 UNIT x STUDY GUIDE Title
  • 11. $2,000 for qualified education expenses (Pirrone & Silliman, 2014). In 2001, the Economic Growth and Tax Relief Reconciliation Act implemented a $1.3 trillion tax cut, including the reduction in what many referred to as the marriage penalty tax policy (Silliman, 2008). Approved in 2003, the Jobs, Growth, Tax Relief, and Reconciliation Act was designed to lower rates pertaining to capital gains and dividends (Silliman, 2008). Additionally, the act encouraged business investment. Similarly, the 2009 American Recovery Reinvestment economic policy encouraged spending, home and vehicle ownership, and jump started business sectors of the economy (Hyman, 2014). These and other basic tax rate reductions were set to expire at the end of 2010 (Hyman, 2014). However, because of the recession of 2007-2010, Congress opted to extend the tax cuts through the end of 2012. Due to the slowly recovering and fragile economy, Congress enacted the American Taxpayer Relief Act in the latter part of 2012. This new legislation prevented a considerable tax rate hike for American citizens (Hyman, 2014). As a result, many local governments reevaluated their budgetary stabilization funds. Tax reform can affect the distribution of the tax burden (Hyman, 2014). Due to the complicated nature of the tax code, the income tax can lead to efficiency loss. Therefore, some tax reform efforts can trigger an additional burden on the economy.
  • 12. Taxpayers file federal and state income tax returns indicating income earned (Hyman, 2014). It may surprise many to know that although all income is required to be reported, not all income is taxable. Universally, taxable income represents earnings subject to income tax after allowable deductions and exemptions have been applied. Taxpayers must calculate their taxable income beginning with totaling gross earnings, which represent all income received including wages, salaries, interest income, dividends, rental income, profits, and unemployment compensation. Second, subtract allowable adjustments to arrive at the adjusted gross income. Third, subtract personal exemptions, which are a predetermined, set amount by the government. Personal exemption varies with the number of dependents. Fourth, subtract the standard deduction or itemized deductions, which yield taxable income. Other steps in completing tax forms include analyzing the tax liability. This is a specific tax rate that applies to the base on the tax bracket and the filing status. Filing statuses, according to Hyman (2014), are single, couples who are married filing jointly, couples who are married filing separately, and or heads of individual households. Additionally, tax credits could be available based on the gross income, such as the Earned Income Tax Credit (EITC). The EITC is a credit from the IRS to workers with dependent children. The EITC offsets payroll tax on wages for many low-income workers. Not only is income from individuals taxed, but revenue earned by businesses or corporations is also subject to taxation. However, sole owners of businesses file a tax form referred to as Schedule C. The income of business structures such as sole proprietorships and partnerships is treated as personal income to the
  • 13. owners of the business. The level of taxation of corporations influences where they locate. Countries with lower tax rates attract global businesses. Domestically and internationally, the United States’ economy plays a significant role in business development (Hyman, 2014). Many are familiar with the GM and Chrysler government bailouts. Some suggest that corporate tax reform will generate budget revenue, rather than more bailouts (Minter, 2014). For example, some argue that refurbishing the corporate tax code is the solution to generating a wider tax base (Desai, 2012). An interesting concept to note is a stockholder’s income resulting from dividends is subjected to double taxation (Hyman, 2014). Business profits can be determined by subtracting costs from receipts for a specified time frame, typically one year. Photo of a master sergeant receiving his master’s degree (Hale, 2012) PA 5305, Public Finance and Budgeting 3 UNIT x STUDY GUIDE Title
  • 14. Tax preferences, options, or loopholes are available in the forms of exemptions, tax credits, exclusions, and deductions (Hyman, 2014). These options are justified through a general consensus that administrative tasks for certain taxes are not feasible. Justification for these options can be established because first, it is collectively accepted that the aforementioned options result in improving equity amongst taxpayers as well as stimulate private expenditures. Second, the result aids government in generating external benefits to the public (Hyman, 2014). For example, Hyman (2014) suggests that personal exemption amounts increase simultaneously with dependents. Therefore, most citizens, if not all, agree with the idea of providing tax credits for dependent children. Similarly, medical expenses can arise from a casualty or loss of wellbeing. Individuals that fall into this category are viewed as being less capable to pay (Hyman, 2014). Additionally, tax preferences can be justified to promote goodwill activities such as charitable donations and endeavors that produce affirmative externalities (Hyman, 2014). Furthermore, they act as proxies for corrective subsidies, thereby helping to achieve efficiency (Hyman, 2014). For example, a business can apply for the Work Opportunity Tax Credit if it hires military veterans and active reservists. The Tax Increase Prevention Act of 2014 also includes the following tax credits and deductions for individuals and businesses: Native American employment credit and accelerated depreciation on Native American reservations, biodiesel and renewable diesel tax credits, energy tax credits and deductions, clothing
  • 15. donations to Goodwill, and monetary donations to charities (Battersby, 2015). Exclusions for taxable purposes can include income fringe benefits, in-kind services, capital gains, rental homes, interest on allowable bonds, and dividends (Hyman, 2014). However, tax expenditures can cause losses in efficiency and reductions in revenue collection. For example, Goodwill donations, legal itemized deductions, adjusted gross income, property taxes, and approved medical expenses are commonly known as miscellaneous deductions (Hyman, 2014). Many experts view the current tax code as outdated, unfair, and inefficient (Glastris, 2011). However, income tax revenue will likely grow as a share of the economy (Saving & Viard, 2015). Ultimately, this growth will continue to exacerbate the need for tax code reform, hence promoting sustainability and fiscal growth. References Battersby, M. E. (2015). Tax increase prevention. Pit & Quarry, 107(8), 56-58. Common ground on tax reform. (2015). Business Week, (4413), 12. Desai, M. A. (2012). A better way to tax U.S. businesses. Harvard Business Review, 90(7/8), 134-139.
  • 16. Galper, H., Rueben, K., Auxier, R., & Eng, A. (2014). Municipal debt: What does it buy and who benefits?. National Tax Journal, 67(4), 901-924. Glastris, P. (2011). Clean up as you cook. Washington Monthly, 43(3), 3. Hale. J. (2012). JLBM’s first combined college graduation DVIDS519916 [Photograph]. Retrieved from https://commons.wikimedia.org/wiki/File:JBLM%27s_first_com bined_college_graduation_DVIDS5199 16.jpg Photo of a Goodwill store (Henderson, 2010) PA 5305, Public Finance and Budgeting 4 UNIT x STUDY GUIDE Title Henderson, J. (2010, April 1). Goodwill Tapscott jeh [Photograph]. Retrieved from https://commons.wikimedia.org/wiki/File:Goodwill_Tapscott_je h.JPG
  • 17. Hyman, D. N. (2014). Public finance: Contemporary application of theory to policy (11th ed.). Stamford, CT: Cengage Learning Minter, S. (2014). The auto bailout and US manufacturing: A house still divided. Industry Week, 263(6), 8. Pirrone, M. M., & Silliman, B. R. (2014). The impact of college tuition tax credits since 1998. Journal of Business & Accounting, 5(1), 106-122. Russell, J. (2015a, April 15). Look at how many pages are in the federal tax code. Retrieved from http://www.washingtonexaminer.com/look-at-how-many-pages- are-in-the-federal-tax- code/article/2563032 Russell, R. (2015b). Keeping the idea of reform alive. Accounting Today, 29(5), 14-16. Saving, J. L., & Viard, A. (2015). Are income taxes destined to rise? Fiscal imbalance and the future tax policy in the United States. National Tax Journal, 68(2), 235-250. Silliman, B. (2008). Will the next president reform the tax code? CPA Journal, 78(11), 22-27. Lab 5 – Individual
  • 18. Overall: Individually, you will be modifying the lab from last week (Lab 4, bank lab) by examining the system your group turned in last week and evaluating it for integrity and security 1- Take your design and discuss about how you could better enforce referential integrity in terms of semantic data integrity. For this portion I would like an explanation. 2- Add three constraints of your choice (that make sense) in your system and explain WHY you have added those constraints. For this portion I would like code and an explanation 3- Write a trigger to meet a business need. For this portion I would like code and an explanation of why the trigger meets the business need. 4- Write a security plan based on the four areas we went over in class. For this portion I would like an explanation. Please notice that you will be graded MORE on your explanations than the code itself Make sure I have access to view your instance! Deliverables: Outlined above. Each section is worth 25 points. For each section, the explanation portion is worth 15 points with the code being worth 10 points. ISTC3046-01 Advanced Database Management Systems 12/7/2017 Class 5 Integrity Security Dr. Bahm Outline Midterm
  • 19. Project presentations next week Individual Lab Integrity Mullins Chapter 13 Effective SQL Chapter 2 (the end) Security Mullins Chapter 14 MidtermGreater than 100090 - 100980 - 89770 - 79460 - 69250 - 59340 - 49230 - 39020 - 29010 - 1900 - 90Less than 00 GRADE DISTRIBUTION 77% Pass Percentage Project Presentations Next class 15 minutes per group Go through your project Focus on why you solved the problem the way that you did
  • 20. Individual Lab Modifying last weeks group lab individually Based on what we will be learning today Integrity Chapter 13 Mullins Two types of integrity Database structure integrity Keeping track of database objects and ensuring that each object is created, formatted, and maintained properly is the goal of database structure integrity Semantic data integrity Refers to the meaning of data and the relationships that need to be maintained between different types of data Two types of integrity Database structure integrity Keeping track of database objects and ensuring that each object is created, formatted, and maintained properly is the goal of database structure integrity Semantic data integrity Refers to the meaning of data and the relationships that need to be maintained between different types of data This means that you need to know the meaning in the first place!
  • 21. Database structural integrity The DBMS uses internal structures and pointers to maintain database objects in the proper order. One potential problem experienced by relational databases is index corruption If the pointers do not point to the correct data, the index is useless. In fact, it could be worse than useless if it is used to access incorrect data and causes transactions to corrupt the database. Large data fields also use pointers SQL Server text and image columns are not stored contiguously with the rest of the data. They are stored in a separate file and the primary file for the table contains a pointer to the physical data location of the large object These pointers to get out of sync with the data, rendering the data inaccessible. Backup files Backup files are another potential area for a structural integrity problem Each DBMS formats and maintains a specific structure for its database backup files. If the backup file is not formatted correctly, or if data is in the wrong location in the backup file, it cannot be used by the DBMS for recovery purposes. Media failures, tape degradation, and bugs can cause such
  • 22. problems. How can you manage these problems? DBCC utility – Database Console Commands Be careful using the DBCC utility Basic consistency checking DBCC CHECKTABLE(table_name) checks the consistency of the data and index pages of a table. When DBCC is run using this option, it will report on the number of data pages, the number of rows, the number of text and image columns, as well as any integrity violations. DBCC REINDEX(table_name) defragments the indexes built on the specified table. Other database checking commands DBCC CHECKDB(database_name) runs CHECKTABLE on every table in the database. This option checks the consistency of the data and index pages of all defined tables DBCC CHECKCATALOG(database_name) checks the consistency of the system catalog tables for the specified database. It will report on the size and number of segments used, as well as detect and report on any integrity errors. DBCC CHECKALLOC(database_name) checks the consistency of the specified database and reports on the current extent structure. The CHECKALLOC option may find spurious allocation problems if DBCC is run while transactions are modifying the database. This option also reports on the number of allocations and the pages used per allocation. DBCC CHECKFILEGROUP(filegroup_name) checks the
  • 23. allocation and structural integrity of all tables and indexed views in the specified database and issues a report of the findings. Using other tools We can also use Microsoft Azure to check in on our system Go to your Database Monitoring Support + Troubleshooting How would I even know when to use this!?!?! You will notice that the database performance will begin to “get weird” Think about the pointers…if our indexes aren’t working or they’re pointing to something else, how will out database behave? Semantic Integrity Semantic integrity It’s all about the meaning of your data Semantic data integrity deals with the DBMS features and processes that can be used to ensure the accuracy and viability of the data contents of a database. Structural database integrity refers to the consistency of the “holders” of the data (the database objects), semantic data
  • 24. integrity refers to the consistency of the data itself. In general… If you have good semantic integrity you DON’T HAVE TO do a bunch of checks Good design and constraints will lead to a better database design and better health overall We used to use triggers and stored procedures to manage this all, but in general that is falling out of favor Entity integrity Entity integrity is the most basic level of data integrity provided by relational databases. It means that each occurrence of an entity must be uniquely identifiable. In other words, entity integrity requires the specification of a primary key for each entity and that no component of the primary key be set to null. Real talk No major RDBMS product forces entity integrity because entities, or tables, can be created without specifying a primary key. However, it is considered a bad practice to create tables without a primary key because it makes identifying rows of the table difficult.
  • 25. Unique constraints A unique constraint is similar to a primary key constraint Each table can have zero, one, or many unique constraints consisting of one or more columns each. The values stored in the column, or combination of columns, must be unique within the table—that is, no other row can contain the same value. Check constraints A check constraint is a DBMS-defined restriction placed on the data values that can be stored in a column or columns of a table When a check constraint is defined, it places specific data value restrictions on the contents of a column through the specification of a Boolean expression Constraints NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY CHECK DEFAULT Defaults You can set a default value for a field in a table For example, if you don’t want it to be null, but a user doesn’t enter the value in, what should you put?
  • 26. Shows a default with a check Triggers Triggers are event-driven specialized procedures that are attached to database tables. A trigger is a piece of code that is executed in response to a data modification statement, that is, an INSERT, UPDATE, or DELETE. Each trigger is attached to a single, specified table. Triggers can be thought of as an advanced form of rule or constraint that is written using an extended form of SQL. A trigger cannot be directly called or executed; it is automatically executed (or “fired”) by the RDBMS as the result of an action— a data modification to the associated table. Triggers cont’d Triggers are quite flexible and can be coded to suit many purposes. For example, triggers can Access and modify other tables Print informational messages Specify complex restrictions Example trigger Beware! Beware!
  • 27. Don’t get crazy with triggers Beware! Instead, enforce referential integrity by design Referential integrity Referential integrity is a method for ensuring the “correctness” of data. RI embodies the integrity and usability of a relationship by establishing rules that govern that relationship The combination of the primary and foreign key columns and the rules that dictate the data that can be housed in those key columns is the beginning of understanding and using RI to ensure correct and useful relational databases. Referential integrity guarantees that an acceptable value is always in the foreign key column. Three types of rules can be attached to each referential constraint. What do you do when these things happen?!!? INSERT rule The INSERT rule indicates what will happen if you attempt to insert a value into a foreign key column without a corresponding primary key value in the parent table. There are two aspects to the RI INSERT rule: 1. It is never permissible to insert a row into a dependent table with a foreign key value that does not correspond to a primary key value. This is known as the restrict-INSERT rule. 2. Whether actual values must be specified instead of nulls.
  • 28. INSERT rule cont’d For each relationship, the DBA must decide whether the foreign key value(s) must be specified when the row is initially inserted into the table. To determine this, ask the following question: “Does it make sense, in business terms, to know the primary key value in the parent table when adding a dependent row?” If a foreign key value is specified, it must be equal to one of the values currently in the primary key column of the parent table. This implements the restrict-INSERT rule. If a foreign key value is optional, it can be set to null. UPDATE rule The basic purpose of the UPDATE rule is to control updates such that a foreign key value cannot be updated to a value that does not correspond to a primary key value in the parent table. There are, however, two ways to view the update rule: from the perspective of the foreign key and from that of the primary key. UPDATE rule cont’d Foreign key perspective. Once you have assigned a foreign key to a row, either at insertion or afterward, you must decide whether that value can be changed. Again, this is determined by looking at the business definition of the relationship and the tables it connects. However, if you permit a foreign key value to be updated, the new value must either be equal to a primary key value currently in the parent table or be null. Primary key perspective. If a primary key value is updated, three options exist for handling foreign key values: Restricted UPDATE. The modification of the primary key
  • 29. column(s) is not allowed if foreign key values exist. Neutralizing UPDATE. All foreign key values equal to the primary key value(s) being modified are set to null. Of course, neutralizing UPDATE requires that nulls be permitted on the foreign key column(s). Cascading UPDATE. All foreign key columns with a value equal to the primary key value(s) being modified are modified as well. DELETE rule Referential integrity rules for deletion define what happens when an attempt is made to delete a row from the parent table. Similar to the primary key perspective of the UPDATE rule, three options exist when deleting a row from a parent table: Restricted DELETE. The deletion of the primary key row is not allowed if a foreign key value exists. Neutralizing DELETE. All foreign key values equal to the primary key value of the row being deleted are set to null. Cascading DELETE. All foreign key rows with a value equal to the primary key of the row about to be deleted are deleted as well. GITHUB http://www.tinyurl.com/istc3046basic Chapter 2 Listing 2.17 Listing 2.18 Listing 2.19
  • 30. Stored Procedures Similar to triggers Both consist of procedural logic that is stored in or managed by the database The difference is that stored procedures are not event driven and are not attached to a specific table. A stored procedure is explicitly executed by invoking a CALL to the procedure (instead of being implicitly executed like triggers) https://docs.microsoft.com/en-us/sql/t-sql/statements/create- procedure-transact-sql Sequences https://docs.microsoft.com/en-us/sql/t-sql/statements/create- sequence-transact-sql In case you want them Security Chapter 14 Mullins text Make a security plan We’re talking about people’s data here Make sure that, like a change management plan, any system you work with/design has a security plan Data breaches https://www.privacyrights.org/data-breaches
  • 31. Basic security considerations The basic security and authorization approach taken by DBMS vendors to secure database access is that all database resources are controlled by the DBMS. No default authorizations are given to any user just because the user logs in to the DBMS. Therefore, for a user to be able to perform any DBMS operation or function, one of the following conditions must exist: The user has been granted the ability to perform that function or operation, or That operation or function has been granted generically to all users. All database resources are controlled by the DBMS. Basically… At a high level, database security boils down to answering four questions: Who is it? (authentication) Who can do it? (authorization) Who can see it? (encryption) Who did it? (audit) Authentication – Who is it? Strong authentication is the cornerstone of any security implementation plan When the DBMS controls the addition of logins, the DBA is required to provide certain information about the login when it is created. Typically, other than the actual login name or ID, the following information either can or must be provided: Password—the key phrase, word, or character string associated with the new login that must be provided by the user before
  • 32. access to the database is permitted Default database—the name of the database to which the user will initially be connected during login Default language—the default language assigned to the login when using the DBMS if multiple languages are supported Name—the actual full name of the user associated with this login Additional details—additional details about the user for which the login has been created: e-mail, phone number, office location, business unit, and so on (this is useful for documentation purposes) Authorization – Who can do it? A login, sometimes called an account, is used to access the DBMS, or database server. For this reason it is sometimes also known as a server user ID, or SUID. A user name is sometimes referred to as a database ID. The user name is associated with the login account. Users are required by some DBMS implementations to be set up with a database user name in order to access each database. How do I authorize? GRANT assigns a permission to a database user. REVOKE removes a permission from a database user In azure you can also add a user through the portal Who is granting/revoking? Decentralized administration is generally easier to establish, but more difficult to control. As more and more users obtain the
  • 33. authority to grant privileges, the scope of authority is widened and becomes unwieldy. Centralized administration is generally easier to administer but places a burden on the centralized administrator as the sole arbiter of privileges within the environment. Privileges The following types of privileges are commonly provided by modern DBMSs: Table: to control who can access and modify the data within tables Database object: to control who can create new database objects and drop existing database objects System: to control who can perform certain types of system- wide activities Program: to control who can create, modify, and use database programs Stored procedure: to control who can execute specific functions and stored procedures Table privileges Table privileges are granted to enable users to access tables, views, and columns within tables and views. The following privileges can be granted for tables and views: SELECT: to enable the user to select from this table/view INSERT: to enable the user to insert rows into this table/view UPDATE: to enable the user to update this table/view DELETE: to enable the user to delete rows from this table/view ALL: to enable the user to select, insert, update, and delete using this table/view For example, to enable user7 to delete rows from the Titles table, the following statement can be issued:
  • 34. GRANT DELETE on Titles to user7; Table privileges Table privileges are granted to enable users to access tables, views, and columns within tables and views. The following privileges can be granted for tables and views: SELECT: to enable the user to select from this table/view INSERT: to enable the user to insert rows into this table/view UPDATE: to enable the user to update this table/view DELETE: to enable the user to delete rows from this table/view ALL: to enable the user to select, insert, update, and delete using this table/view For example, to enable user7 to delete rows from the Titles table, the following statement can be issued: GRANT DELETE on Titles to user7; By the column!!!!! Before we go any further… To find your users…. Database principals: SELECT * FROM sys.database_principals Server logins: SELECT * FROM sys.server_principals To create a user in SQL: https://docs.microsoft.com/en-us/sql/relational- databases/security/authentication-access/create-a-database-user ..or you can do it in azure
  • 35. What does this do? LBAC Label based access control LBAC provides for a more granular security scheme, specifying who can read and modify data in individual rows and/or columns. Encryption – Who can see it? SQL Injection attacks SQL injection is a form of Web hacking whereby SQL statements are specified in a Web form to expose data to the attacker. Let’s say…. SELECT userid, password FROM uid_pwd_table WHERE field = '$EMAIL'; Let’s say…. SELECT userid, password
  • 36. FROM uid_pwd_table WHERE field = '$EMAIL'; So someone types in anything' OR '1'='1 Let’s say…. SELECT userid, password FROM uid_pwd_table WHERE field = '$EMAIL'; SELECT userid, password FROM uid_pwd_table WHERE field = 'anything' OR '1'='1'; This will cause a complete dump of every user ID and passwords Prevention Using well-designed query language interpreters and coding applications appropriately can prevent SQL injection attacks. When possible, use static SQL (see the next section for more details). Always validate user input by testing type, length, format, and range. With knowledge of SQL injection techniques and proper development procedures, all SQL injection attacks can be prevented. Auditing – Who did it? Auditing is a DBMS facility that enables DBAs to track the use of database resources and privileges.
  • 37. When auditing is enabled, the DBMS will produce an audit trail of database operations. Each audited database operation produces an audit trail of information, including what database object was impacted, who performed the operation, and when. Auditing cont’d Depending on the level of auditing supported by the DBMS, an actual record of what data actually changed may also be recorded. Tracking who does what to which data when is important because there are many threats to the security of your data. Auditing occurs post activity; it does not do anything to prohibit access. Internal security threats External agents trying to compromise your security and access your company data are rightly viewed as a threat to security. However, industry studies have shown that many security threats are internal—within your organization. The most typical security threat is a disgruntled or malevolent current or ex-employee who has valid access to the DBMS. Keep your DBAs happy! Auditing is crucial because you may need to find an instance of unauthorized access by an authorized user. Questions?