350 likes | 482 Views
Lecture 8. 25/11/13. Outsourcing . Outsourcing has become increasingly popular as companies believe that it is more cost effective than maintaining their own IS staff
E N D
Lecture 8 25/11/13
Outsourcing • Outsourcing has become increasingly popular as companies believe that it is more cost effective than maintaining their own IS staff • Many companies are outsourcing software procurement and support to application service providers (ASPs) who provide and support business application and other software via the Internet and intranets to all of a company’s employees workstations
Benefits of Outsourcing Risks associated with Outsourcing May loose control over IS function Heavy reliance on the vendor Proprietary information may be leaked to the competition if sensitive data is available outside the organisation • To reduce work in the information systems department. • When the IS function within an organisation is limited. • To improve the contribution of IT to enhance business performance. • To create new sources of revenue.
What is a Database? • “a shared collection of logically related data (and a description of this data), designed to meet the information needs of an organisation” (Connolly & Begg, 1999) • Implications? Centralised (minimal duplication), self-describing (program independent to an extent), logical structure (entities, attributes and relationships).
Databases • A database is a central data store where data is recorded and maintained in a standard way. The data is organised and cross-referenced, enabling any individual data items to be accessed. • The concept of a database was developed without reference to computers.
Examples of a Database: • Student Records at UCC • Credit Card details • Directory Enquiries • Insurance Broker • Library System
Advantages of a Database: • Data Integrity is easier to maintain as all data is held in on central location • A database allows for ad-hoc queries and caters to complex questions involving the interaction and relationships between the various data items in the database to be investigated • Security • Minimisation of data duplication • Control of data redundancy • Data Consistency • Increased Concurrency • Improved Maintenance
Last Name First Name Address Phone Number SSN Adams Jefferson George Mary 123 Lancelot Dr. 1779 Washington Ave. 704-555-1234 704-555-6789 987-76-5432 123-45-6789 Jefferson Mary 1779 Washington Ave. 704-555-6789 123-45-6789 The Data Hierarchy Database A collection of interrelated data Personal Data File Credit History File Transaction Data File Table A group of interrelated records Record Jefferson (Last Name) Mary (First Name) 1779 Washington Ave. (Address) 704-555-6789 (Phone Number) 1234-56-789 (Social Security No.) Field Byte R Y M A Bit 0 (or 1)
Database Management System (DBMS) • A group of programs that helps to create, process, store, retrieve, control, maintain, and manage data.
DBMS • A program that makes it possible to : • Create • Use • Maintain • A Database • Provides logical access to the data stored in the DB • Users/programmers do not have to worry about the physical aspect of the DB
Examples of DBMS: • Desktop DB: • MS Access • Enterprise DB: • Oracle
Data Views • Logical view of data • A view that shows the logical relationship(s) between different pieces of data in a database • Physical view of data • A view that shows how and where data are physically stored in a storage medium
The Four Main DBMS Components DBMS Data Manipulation Language Data Definition Language Data Dictionary Reports and Utilities Language to process and update data Language to create and modify data An electronic document that provides detailed information about each and every piece of data in the database Software that generates reports and makes the database user- friendly
Data Languages • Data definition language • A DBMS language used to create and modify the data. • Data manipulation language (DML) • A language that processes and updates data. • Structured query language (SQL) • A language that deals exclusively with data, namely, data integrity, data manipulation, data access, data retrieval, data query, and data security
What is SQL? • SQL stands for Structured Query Language • SQL allows you to access a database • ANSI standard language • SQL can execute queries against a database • Retrieve, insert, delete and update data in a database
Relational Database Structure • Relations, Tuples (Entity Instances), Attributes • Tables, Rows, Columns • Files, Records, Fields • Primary Key must be designated • Foreign Keys must be designated for relationships
What is SQL? • SQL stands for Structured Query Language • SQL allows you to access a database • ANSI standard language • SQL can execute queries against a database • Retrieve, insert, delete and update data in a database
SQL is a 4th generation language. • • Non-procedural • • SQL processes several rows together rather than one row at a time. When we issue an SQL command, the command is sent to the server where all rows are dealt with at the one time.
SQL is used to • Query data • Insert, update, and delete rows • Create, alter, and delete database objects • Control access to database objects and to the database itself • Guaranty database consistency • Monitor database performance
Who uses SQL? • User • Developer • Designer • DBA
Commands can be divided into fourcategories • Query. • Data Manipulation Language (DML) commands • Data Definition Language (DDL) commands • Security
Entering SQL commands SQL has a buffer which stores the current command • SQL commands can span lines • Although not obligatory, clauses should be put on separate lines to improvereadablity. • Tabs should be used to make a command more readable • SQL commands are not case sensitive
Querying RDBS with SQL • Use a form of pseudo English to retrieve data in a view (which looks like a table). • Syntax is based on a number of “clauses”. • Select • Specifies what data elements will be included in the view. • From • Lists the tables involved • Where: • specifies conditions to filter the data • Specifies values sought • Links between tables
Example select * from customer; CIARA CORK 4567890 MARY CORK 67834534 CHARLES KERRY 87676456
Example select name from customer; Name CIARA MARY CHARLES select emp_no, emp_name from employee; Emp_noemp_name 3 HEARNE 4 BYRNE 6 WALSH 8 HARTE
SQL Syntax • Example Select ename, sal from emp; Select * from deptno; • * Includes all the fields in the table Names the table that contains the records to retrieve Specifies the selection criteria Always end the statement with a semi colon ;
Putting the output in order • Oracle can sort a column, or multiple columns select emp_no, emp_name from employee order by emp_name; emp_noemp_name 4 BYRNE 8 HARTE 3 HEARNE 6 WALSH select * from customer order by name; Name phone address CHARLES KERRY 87676456 CIARA CORK 4567890 MARY CORK 67834534
Where Select emp_name, sal, dept_no from employee Where job= 'ANALYST'; emp_namesaldept_no HEARNE 800 4 Select * from customer where name='CIARA'; NAME ADDRESS PHONE CIARA CORK 4567890
More… Select emp_name, sal from employee where job='CLERK'; emp_namesal BYRNE 100
Comparisons BETWEEN .. AND .. Select emp_name, sal from employee where sal between 500 and 800; emp_namesal HEARNE 800 HARTE 700 Select emp_name, sal from employee where sal >500 and sal <800; emp_namesal HARTE 700
Like % Select name, address from customer where address like 'C%'; name address CIARA CORK MARY CORK Select name, address from customer where address like 'c%'; Result??? Another example: select * from employee where job like '%NALYST'; 3 HEARNE ANALYST 4 800
Column Aliases select emp_name "EMPLOYEE" from employee; EMPLOYEE HEARNE BYRNE WALSH HARTE select name "Customer Name", address "Customer Address" from customer; Customer Name Customer Address CIARA CORK MARY CORK CHARLES KERRY
Column Aliases select * from employee; Emp_name job dept_nosalemp_no HEARNE ANALYST4 800 3 BYRNE CLERK3100 4 WALSH MANAGER 4 350 6 HARTE ACCOUNTANT3 700 8 Select emp_name, sal, sal*12, sal+100*12, (sal+100)*12 From employee; emp_namesalsal*12 sal+100*12 (sal+100)*12 HEARNE 800 9600 2000 10800 BYRNE 100 1200 1300 2400 WALSH 350 4200 1550 5400 HARTE 700 8400 1900 9600 Select emp_name“Employee”, sal*12 “Present Yearly Salary”, sal+100*12 “New salary (1)”, (sal+100)*12 “New salary(2)” from employee; Employee Present Yearly Salary New salary (1) New salary(2) HEARNE 9600 2000 10800 BYRNE 1200 1300 2400 WALSH 4200 1550 5400 HARTE 8400 1900 9600
Error? Select * from customer Select name address from customer; Select name, address from customer where name =mary; Select name CUS NAME from customer;