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.
Many to One Relationship:
When more than one record in a database table is associated with only one record in another table, the relationship between the two tables is referred as many to one relationship. It is also represented as M: 1 relationship.
One to Many Relationship:
When one record in a database table is associated with more than one record in another table, the relationship between the two tables is referred as one to many relationship. It is also represented as1: M relationship. This is the opposite of many to one relationship.
CROW FOOT ERD:
The Crow Foot ERD is an Entity Relationship Diagram which is used to represent the cardinalities present in the basic ER diagram. It is used to represent the relationships present between two tuples or tables present in the database.
Trending nowThis is a popular solution!
Chapter 3 Solutions
Database Systems: Design, Implementation, & Management
- For 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_forwardCreate 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_forwardUsing the tables in Figure Q3.13, create the table that results from MACHINE DIFFERENCE BOOTH. FIGURE Q3.13 THE CH03_VENDINGCO DATABASE TABLESarrow_forward
- Use Figure Q3.13 to answer Questions 1317. FIGURE Q3.13 THE CH03_VENDINGCO DATABASE TABLES Write the relational algebra formula to apply a UNION relational operator to the tables shown in Figure Q3.13.arrow_forwardAn EMPLOYEES table was added to the JustLee Books database to track employee information. Display a list of each employee’s name, job title, and manager’s name. Use column aliases to clearly identify employee and manager name values. Include all employees in the list and sort by manager name.arrow_forwardHow is the processing of SQL DDL statements (such as CREATE TABLE) different from the processing required by DML statements?arrow_forward
- Problems 2224 are based on the following query: SELECT P_CODE, P_DESCRIPT, P_PRICE, P.V_CODE, V_STATE FROM PRODUCT P, VENDOR V WHERE P.V_CODE = V.V_CODE AND V_STATE = 'NY' AND V_AREACODE = '212' ORDER BY P_PRICE; Write the commands required to create the indexes you recommended in Problem 22.arrow_forwardWhat is the role of an index in a database, and how does it impact query performance?arrow_forwardThe ABC Database Tables Table A TRUCK_NUM BASE CODE TYPE_CODE TRUCK_MILES TRUCK BUY DATE TRUCK SERIAL NUM 501 502 501 23-Sep-07 AA-322-12212-WM1 05-Feb-06 AC-342-22134-Q23 11-Nov-OS AC-445-78656-Z99 06-Jan-07 WVQ-112-23144-T34 01-Mar-06 FR-998-32245-W12 15-Jul-03 AD-456-00845-R45 17-Oct-04 AA-341-96573-284 07-Aug-05 DR-559-22169-D33 12-Feb-08 DE-887-98458-E94 1001 1032 1003 1004 1005 1006 1007 1009 1009 Table C Table B BASE CODE 501 502 Lexington 503 Cape Girardeau 504 Detton 503 501 502 502 T TYPE_CODE 503 BASE CITY Murfreesboro TYPE DESCRIPTION 1 Single box, double-sode 2 Single box, single-axde 3 Tandem trailer, single-exde 1 1 2 1 2 2 3 32 2 32123.5 76934.3 12346.6 2894.3 45673.1 193245.7 32012.3 44213.6 10932.9 BASE STATE BASE_AREA_CODE TN KY MO GA 615 568 456 901 BASE PHONE 123-4567 234-5678 345-6789 458-7890 BASE MANAGER Andree D. Gallager | George H. Delarosa Maria J. Talindo Peter F. McAveaarrow_forward
- What is a composite key in a relational database, and when might you use one?arrow_forwardConvert a "Construct" database to SQL format.arrow_forwardA select operation in a relational database decreases the size of a table by deleting columns that fulfill certain criteria.Is it correct or incorrect?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
- Enhanced Discovering Computers 2017 (Shelly Cashm...Computer ScienceISBN:9781305657458Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. CampbellPublisher:Cengage LearningA Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage