Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 44 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
44
Dung lượng
3 MB
Nội dung
Lane Medical Library & Knowledge Management Center http://lane.stanford.edu A Painless Introduction to MS Access Databasing Yannick Pouliot, PhD Bioresearch Informationist lanebioresearch@stanford.edu Lane Medical Library & Knowledge Management Center 4/20/07 Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 2 Preliminaries Launch MS Access Open Simple1.mdb File/Open Using the Help don’t neglect it! Exercise: ask the Office Assistant for “select syntax” Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 3 Contents Familiarization with MS Acces Understanding a simple database Basics of SQL querying Creating a simple database Loading database via MS Excel Tools for running SQL queries Installation (Windows) Selected databases Resources & cheat sheet Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 4 Resources – MS Access Available as eBook Available as eBook Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 5 Resources – Excel/MS Query In Lane catalog Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 6 Resources – MS Access Free Online Training Resources Using an Access database to store and information (2 min) http://office.microsoft.com/en-us/assistance/HA011709681033.aspx Creating a database from Excel (5 min): http://office.microsoft.com/en-us/assistance/HA012013211033.aspx Creating tables in Access (50 min): http://office.microsoft.com/training/training.aspx?AssetID=RC0611832 61033 Writing queries (50 min): http://office.microsoft.com/training/training.aspx? AssetID=RC010776611033 Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 7 Why Bother with MS Access? Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 8 Why MS Access? More: http://office.microsoft.com/en-us/access/HA010429181033.aspx Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 9 Definitions, Definitions… Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 10 Definitions Database: Collection of tables Table Collection of records that share a common fundamental characteristic E.g., patients and locations can each be stored in their own table Schema A view that inter-relates tables to each other Record Basic unit of information in a relational table E.g., 1 record per person A record is composed of fields Query Set of instructions to a database “engine” to retrieve, sort and format returning data. E.g., “find me all patients in my database” Database engine Software application that stores the data and enables querying [...]...Table and Field Definitions How It Looks In Access Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 11 Main Relational Database Engines Oracle MS Access MS SQL Server Filemaker MS SQL Server MySQL Postgress Sybase Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 12 Understanding Relational Databases Lane Medical Library & Knowledge... BioWarehouse System Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 17 Querying MS Access or any relational database… Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 18 How Relational Databases Are Queried Querying = extracting information out of the database … and into something, e.g., Excel This is done using the Structured Query Language... create a shortcut to it and rename it e.g MSQuery Search hidden files and folders move the shortcut to a desired location Also needed: creating a data source name Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 31 To Conclude… If using Excel is a headache, use MS Access Access can work very well on its own reasonably easy to learn/use Lots of free resources to. .. A driver is a piece of software that lets your operating system talk to a database Each database engine (Oracle, MySQL, etc) requires its own driver Installed drivers visible in ODBC manager “data connectivity” tool Generally must be installed by user Drivers are needed by Data Source Name tool and querying programs Require (simple) installation Lane Medical Library & Knowledge Management... Uploading Data in MS Access Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 25 Importing Data Into Acces From Access Important Column headers in Excel file must match those of columns in Access target table Must ensure that data in Excel columns is of correct type (text, number, date) Blanks (not empty cells!) are nasty Exercise: Loading data via Excel No spaces,... quickly learn how to use it MS Access + Excel = dynamite Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 32 Yannick Pouliot, PhD lanebioresearch@stanford.edu Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 33 The NittyGritty Details Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 34 How to Query Using MS Query Steps 1 Make... field_name FROM table [WHERE condition] [ ] = elective Example: Select LastName,FirstName From Patients Where Alive = ‘Y’; Important: Everything is MS Access is case sensitive LastName ≠ lastName Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 21 Realistic Querying With the MS Access Query Builder Lane Medical Library & Knowledge Management Center http://lane.stanford.edu... Database Schema: Your Roadmap For Querying The schema describes all tables and all fields Describes relationships between tables Crucial in enabling retrievall of desired data Simple example: Very important Must understand schema for accurate querying Wrong understanding = wrong results Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 16 Example: The Schema... records for a given patient Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 14 The Relational Principle in Action Related records can be found using a shared key Shared key = identifier that is: unique to each table Can be referenced by another table Example: Patients.ID = Visits.PatientID Lane Medical Library & Knowledge Management Center http://lane.stanford.edu... Cool Things You Can Do In Access Store entire files in records Excel, Word, sounds, pictures anything Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 28 Extras Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 29 Creating Forms Using MS InfoPath Really the easiest way to create interfaces to Access 10 min of work Probably 30 for you . Lane Medical Library & Knowledge Management Center http://lane.stanford.edu A Painless Introduction to MS Access Databasing Yannick Pouliot, PhD Bioresearch Informationist lanebioresearch@stanford.edu Lane. cheat sheet Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 4 Resources – MS Access Available as eBook Available as eBook Lane Medical Library & Knowledge Management. “find me all patients in my database” Database engine Software application that stores the data and enables querying Lane Medical Library & Knowledge Management Center http://lane.stanford.edu 11 Table