01 Bidgoli Chpt3 RelationalDatabase Short Explanation

01 Bidgoli Chpt3 RelationalDatabase Short Explanation -...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Exhibit-5 3-. Customer number Method of payment 2.1 The Relational Model A relational model uses a two-dimensional table of rows and columns of data. Rows are records (also called “tuples”), and columns are fields (also referred to as “attributes”). To begin designing a relational database, you must define the logical structure by defining each table and the fields in it. For example, the Students table has fields for StudentID, StudentFirstNarne, StudentLast- Name, and so forth. The collection of these definitions is stored in the data dictionary. The data dictionary can also store other definitions, such as data types for fields, default values for fields, and validation rules for data in each field, as described in the following list: 0 Field name—Student name, admission date, age, and major. . l .. " ‘ remasswaws "- sang. W assmasessaasaaaaginW in _ _, ea: Wesmsesssa _ . . “lg :% I that “Q? 9 mean m ‘42 Part J': Fundamentals of information Systems an ' «a . an ao§ sewaaeeaawmi as 0 Field data type—— Character (text), date, and number. 0 Default value— The value entered if none is available; for example, if no major is declared, the value is “undecided.” 0 Validation rule— A rule determining whether a value is valid, for example, a student’s age can’t be a negative number. In a relational _ database, every record a. .5, . H must be uniquely iden- tified by a primary key. Student ID numbers, social security numbers, account numbers, and invoice numbers are examples of primary keys. To establish relationships between tables so that data can be linked and retrieved more efficiently, a pri- mary key for one table can appear in other tables. In this case, it’s called a foreign key. For example, a student ID number is the primary key for the Students table, and the code for a student’s major (such as MKT, M18, or FIN) is the primary key for the Majors table. Each student can have one major, and a number of students can be enrolled in each major. The primary key of the Majors table is a foreign key in the Students table. To improve database efficiency, a process called normaiization is used, which eliminates redundant data (storing customer names in only one table, for example) and enSures that only related data is stored in a table. Normalization can go through several stages, from first normal form (INF) to fifth normal form (SNF). Typi- cally, however, only stages 1NF through 3NF are used. For example, the following tasks are performed in the 1NF stage: 0 Eliminate duplicated fields from the same table 0 Create separate tables for each grOup of related data 0 Identify each record with a unique field (the primary key) Data stored in a relational model is retrieved from tables by using operations that pick and combine data from one or more tables. There are several operations, such as select, project, join, intersect, union, and differ- ence. The first three are the most commonly used and are explained in the following paragraphs. . A select operation searches data in a table and retrieves records based on certain criteria (also called “conditions”). Table 3.1 shows data stored in the Stu- dents table. Using the select operation “Major=MlS,” you can generate a list of only the students majoring in 2 M15, as Table 3.2 shows. A project operation pares down a table by eliminating columns {fields) according to certain criteria. For example, you need a list of students but don’t want to include their ages. Using the project operation “PROJECT Student ID#, Name, Major, GPA (Table 3.1),” you can retrieve the data shown in Table 3-3. The “(Table 3.1)” in this statement means to use the data in Table 3.1. A joint operation combines two tables based on a common field {for example, the primary key in the first table and the foreign key in the second table). Table 3.4 shows data in the Customers table, and Table 3.5 _ __ _ __ _ _ __ shows data in the Invoices table. i 5' I The Customer# is the primary key I I for the Customers tables and a foreign key in the Invoices table; the Invoice# is the primary key for the Invoices table. Table 3.6 shows the table resulting from joining these two tables. Chapter 3: Database Systems, Data Warehouses, and Dara ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern