TAILIEUCHUNG - Lecture Introduction to business information systems (3rd edition): Chapter C - Norrie, Nanjad, Huber
Tech guide C - The Details of SQL, logical modelling, and XML. After studying this chapter you will be able to understand: Using SQL to query relational databases, using logical modelling to create a relational database and querying multitable databases, using XML for data transfer. | Tech Guide C The Details of SQL, Logical Modelling, and XML © John Wiley & Sons Canada, Ltd. C- What We Will Cover © John Wiley & Sons Canada, Ltd. Using SQL to Query Relational Databases Using Logical Modelling to Create a Relational Database and Querying Multitable Databases Using XML for Data Transfer C- USING SQL TO QUERY RELATIONAL DATABASES The primary function of a database is to let knowledge-enabled professionals obtain information in a usable form using queries (questions). To query a relational database, many people use Structured Query Language (SQL), which is a computer language for manipulating data in a relational database. SQL queries also enable database users to add new records, or change or delete records. © John Wiley & Sons Canada, Ltd. C- IMPORTANT TERMS Primary key: a field that holds a unique value for each record in a table Foreign key: the primary key from another table that is in the current table; it relates the two tables Entity: another name for a table in a relational database © John Wiley & Sons Canada, Ltd. C- IMPORTANT TERMS Row: another name for a record in a relational database table Column: another name for a field in a relational database table Query: a statement written in SQL that requests matching records, changes matching records, deletes matching records or adds new records © John Wiley & Sons Canada, Ltd. C- QUERYING A SINGLE TABLE DATABASE To query a single table database, we use an SQL statement of the form: SELECT fields FROM tables WHERE fields match query condition. The SELECT keyword designates which fields to display as a result of the query. The FROM keyword designates which tables to search. The WHERE keyword specifies the search criteria to use in finding records. Note that we use uppercase for keywords to make them stand out, but otherwise case is not important when using SQL. © John Wiley & Sons Canada, Ltd. C- OTHER QUERY KEYWORDS In addition to the SELECT keyword,
đang nạp các trang xem trước