Concept explainers
Primary Key:
A Primary Key in a
Example:
Students in Universities are assigned a unique registration number.
Therefore, in a STUDENT database table, the attribute “reg_no” acts as primary key.
Foreign Key:
Foreign Key is a column in a relational database table which provides a relation between two tables. It provides a cross reference between tables by pointing to primary key of another table.
Example:
In STUDENT database table, the attribute “reg_no” acts as primary key and in COURSE database table in which the student selects his or her course, the same “reg_no” acts as foreign key for the STUDENT table.
Entity Integrity:
Entity Integrity is a
- The primary key of one database table row must not match the primary key of any other row present in the table.
- No component of primary key must be null.
Trending nowThis is a popular solution!
Chapter 3 Solutions
Database Systems: Design, Implementation, & Management
- Do the tables exhibit referential integrity? Answer yes or no, and then explain your answer. Write NA (Not Applicable) if the table does not have a foreign key. FIGURE P3.17 THE CH03_TRANSCO DATABASE TABLESarrow_forwardDo the tables exhibit referential integrity? Answer yes or no, and then explain your answer. Write NA (Not Applicable) if the table does not have a foreign key.arrow_forwardFor each table, identify the primary key and the foreign key(s). If a table does not have a foreign key, write None. FIGURE P3.17 THE CH03_TRANSCO DATABASE TABLESarrow_forward
- Create the table that results from applying an INTERSECT relational operator to the tables shown in Figure Q3.13. FIGURE Q3.13 THE CH03_VENDINGCO DATABASE TABLESarrow_forwardHow is the processing of SQL DDL statements (such as CREATE TABLE) different from the processing required by DML statements?arrow_forwardWhat is a primary key? What is the primary key for each of the tables in the Colonial Adventure Tours database shown in Chapter 1?arrow_forward
- How does Second Normal Form (2NF) differ from Third Normal Form (3NF), and why might you choose one over the other in database design?arrow_forwardExplain the concept of normalization in database design. What are the advantages of using normalized tables in a database?arrow_forwardSQL Database Designs Identify the functional dependencies in the following unnormalized table. Convert the table to third normal form. TRIP (TRIP_ID, TRIP_NAME, STATE_ABBREVIATION, STATE_NAME, (GUIDE_NUM, GUIDE_LAST, GUIDE_FIRST))arrow_forward
- A concise explanation of the many reasons why the use of tables in database design is a good idea could be of some use. Would you mind providing a brief remark on the subject of NULL?arrow_forwardHelp with SQL database 2. In database lab01, create 4 tables: course, advisor, student, and department (Note: The order of tables below is not proper for creating tables. Please think about which table should be created first) course (course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0), primary key (course_id), foreign key (dept_name) references department (dept_name)) advisor (s_ID varchar(5), i_ID varchar(5), primary key (s_ID), foreign key (s_ID) references student (ID)) student (ID varchar(5), name varchar(20) not null, dept_name varchar(20), tot_cred numeric(3,0), primary key (ID), foreign key (dept_name) references department (dept_name)) department (dept_name varchar(20), building varchar(15), budget numeric(12,2), primary key (dept_name)) . Populate tables (Note: The order of populating table below is not proper. Please think about which table should be populated first) Populate the table "student" with the data below: ('23121', 'Chavez',…arrow_forwardWhen considering creating a join between two tables, how are we demonstrating the concept of "relational" databases? Why is it essential that we create the join by finding a common attribute that is unique in at least one table and look at situations where that attribute has the same value ( is equal ) in both tables?arrow_forward
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr