Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access...
-
date post
20-Dec-2015 -
Category
Documents
-
view
217 -
download
0
Transcript of Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access...
![Page 1: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/1.jpg)
Course Goals
• Introduce Terms
• Skills– Modern DBMS (SQL Server 2008)– SQL querying and data access– Stored procedures including parameters– Brief introduction to using code to interact with
dbms
![Page 2: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/2.jpg)
Information Resource Management
• What is a Database?
• Database vs. DBMS
• What are the Advantages of the Database Approach?
![Page 3: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/3.jpg)
Retail Sales with Computer System and Bar Codes
• “What Happens when you bar-code a can of beans at Walmart?
• Initial Goal: improve speed & accuracy of checkout – Wipe barcodes to get product ID – Look up price– Calculate total amount
![Page 4: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/4.jpg)
But with this information, we can do much more
• Reduce Errors– Happier customers
• Less skilled checkout people– No need to type #s or memorize prices
• Can change prices much faster• Checkout efficiency
– Credit Check– How fast people working
• Automatic Inventory Control– JustInTime Wholesale ordering – fedex option– Reduced inventory costs– Tax calculations for inventory
• Automatic Floor space v. sales calculations
![Page 5: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/5.jpg)
What Business Functions Represented by This Function?
• Sales and Marketing
• Logistics
• Operations
• Human Recourses
• Management
• Accounting
![Page 6: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/6.jpg)
Information Systems Management
• Data – Raw facts
• Information– Processed to be useful to particular users
![Page 7: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/7.jpg)
What is a Database?
• A database is a shared collection of logically related data to help multiple particular users solve multiple particular problems, possibly in the future, and as yet unknown
• A database management system (DBMS) is a tool to access a database
![Page 8: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/8.jpg)
Vision
• Database that contains ALL corporate data
![Page 9: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/9.jpg)
Hard to achieve in practiceDepartment DBs already exist
– Older non-homogeneous software• Even if not, have to start at department level to keep
tractable• Many often unwilling to start over
– Ego & $$• Different data organization and data dictionary
– E.g. how to store a name• Extra work for some departments so other departments can
do their job better– Turf wars
![Page 10: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/10.jpg)
Function of CIO• Operations Management
– Scheduling, Capacity planning, Operations security, Disaster recovery
• Quality Assurance• Communications Management
– Local/Wide area, Long haul• Data Resources Management
– Data analysis, Database design, Data administration, Database Administration
• Project Management• Corporate-Wide IS planning• Information Center• Systems development and Maintenance
![Page 11: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/11.jpg)
Centralized Database
• All data at a single site– Personal computer– Central Corporate database (big iron)– Client/Server on network
![Page 12: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/12.jpg)
DB Analysts and DB administration have to understand how organization
works
• DB analyst a good path to becoming a CIO
• Requires both solid business AND technical skills including coding and complex query writing.
![Page 13: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/13.jpg)
SQL Server Basics (Chapter 1)
• Overview of Database Objects– Database itself– Transaction log– Tables– Filegroups– Diagrams– Views
![Page 14: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/14.jpg)
Overview of Database Objects
• Indexes• Assemblies• Reports• Full-text Catalogs• User-defined data types
– e.g. ‘zip code’ instead of char(9)
• Roles• Users
![Page 15: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/15.jpg)
Four System Databases
• Master– Contains meta data about other databases
including user-defined databases
• Model– Template for creating of user-defined DBs
• Tempdb– Working area for server
• Don’t touch any of these
![Page 16: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/16.jpg)
MS Sample Databases
• AdventureWorksDW
• Pubs
• Northwinds
• We will use pubs and northwind as examples in this class
![Page 17: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/17.jpg)
Transaction Log
• Transaction is a set of operations that must happen together (more on this later in the course)
• Actions first written to transaction log.
• When that is complete, operations applied to database.
• Rollback and data recovery
![Page 18: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/18.jpg)
Objects within a Particular DB• Table
• Index– Clustered and non clustered
• Triggers
• Constraints
• Filegroups– All tables default to single file, but can be
changed to multiple files, disks, RAIDS, etc
![Page 19: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/19.jpg)
Objects within a Particular DB
• Diagrams (page 9)– Diagram to DB– DB to diagram (!!!)– Views
• Hard to update
– Stored procedures (e.g. subs w/ parameters)– User-defined functions– Users and Roles– Rules– Defaults– User-defined data types– Full-text (images?)
![Page 20: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/20.jpg)
SQL server data types
• See table page 12
• Note– Varchar– Nvarchar– Unique identifier– Conversion matrix
![Page 21: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/21.jpg)
NULLS (page 17)
• Means ‘don’t know’ but might also mean ‘not applicable’ – no way for others to tell
• Nulls are BAD
• Poor DB design sometimes leads to nulls!– If your database design requires nulls you are
doing something wrong
![Page 22: Course Goals Introduce Terms Skills –Modern DBMS (SQL Server 2008) –SQL querying and data access –Stored procedures including parameters –Brief introduction.](https://reader034.fdocuments.us/reader034/viewer/2022052701/56649d415503460f94a1c429/html5/thumbnails/22.jpg)
NAMES• To know something’s true name is to be
able to control it (once and future king)
• Everything in sql server has a name (pg 17)
• SQL server naming rules (pg 18)
• My naming rules– Relations are plural– Attributes are generally singular– All lowercase– No SPACES!!! Or underscores (innercap)