Safe Referential Integrity Structures in Relational Databases

Total Page:16

File Type:pdf, Size:1020Kb

Safe Referential Integrity Structures in Relational Databases SAFE REFERENTIALINTEGRII-Y STRUCTURESr~ RELATIONAL DATABASES* Victor M. Markowitz Information and Computing SciencesDivision Lawrence Berkeley Laboratory 1 Cyclotron Road, Berkeley, CA 94720 Abstract The concept of referential integrity is still sur- Referential integrity constraints express in rela- rounded by confusion, as illustrated by the successive tional databasesexistence dependenciesbetween modifications of the original definition of [l] (see [21, tuples. Although it is known that certain [3]). Thus, although it is known that certain referential referential integrity structures may cause data integrity structures may cause data manipulation prob- manipulation problems, the nature of these prob- lems (e.g. see [3]), the nature of these problems has not lems has not been explored and the conditions been exp!orcd and the conditions for avoiding them have for avoiding them have not been formally not been formally developed. In particular, problems developed. In this paper we examine these data created by the interaction of referential integrity and null manipulation problems and formally develop constraints have not been investigated, In this paper we safenessconditions for avoiding them. Next, we examine these data manipulation problems and develop discuss the problem of specifying safe rcfcrcn- safeness conditions for avoiding them. It is worth noting tial integrity constraints in three rcprescntativc that the approach of this paper is different from that of relational databasemanagement systems, IBM’s 171,where it is shown that relational schema translations DB2, SYBASE,and INGRES. of object-oriented schemas have referential integrity structures with desirable properties. Key Words : null constraint, referential integrity constraint, relational databasemanagement sys- The referential integrity mechanisms provided by tem, safe referential integrity structure. various RDBMSsare different and difficult to use. Thus, SYBASE4.0 [lo] and MCRES 6.3 [5] provide procedural 1. Introduction mechanisms (rriggm in SYBASE and rules in INGRES) for maintaining referential integrity constraints. Con- Commercial relational datab&se management systems versely, DB2 [4] allows non-procedural (declarative) (RDBMS) provide mechanisms for maintaining key and specifications of referential integrity constraints, but restricted (nulls not allowed) null constraints. Several imposes restrictions on the structure of these constraints. commercial RDBMSs, notably IBM’s DB2, SYBASE4.0, Problems underlying the use of the referential integrity and INGRES6.3 also provide mechanismsfor maintaining mechanisms of DB2, SYBASE, and INGRES have been referential integrity constraints. Referential integrity con- examined in [9]. In this paper we examine these mechan- straints are used in relational databasesfor expressing isms in the context of safe referential integrity structures. existence dependencies between tuples [I]: such con- In SYBASE4.0 and INGRES6.3 the task of specify- straints are specified by associating a foreign-key in one ing correctly referential integrity constraints is left to relation with the primary-key of another relation [2]. users. Thus, no mechanism is provided by these systems Referential integrity constraints are usually associated with rules that define the behavior of the relations for detecting unsafe or even not well-defined referential involved in these constraints under insertion, deletion, integrity constraints. DB2 has been unique among and update of tuples. RDBMSs in addressing the data manipulation problems caused by certain referential integrity structures. DB2 * Also issued as technical report LBL-28363. This work was attempts to avoid these problems by imposing restrictions supported by the Office of Health and Environmental Research Program on the structure of referential integrity constraints it and Ihe Applied Mathematical Sciences Research Program, of tie Office allows. We compare the DB2 restrictions with the safe- of Energy Kesearch, U.S. DepaNnent of Energy, under Contract DE- AC03-76SKXIO98. ness conditions and show that while some DR2 restric- tions are implied by the safeness conditions, other Barcelona, September, 1991 Proceedings of the 17th International 123 Conference on Very Large Data Bases restrictions are too stringent or misplaced. Moreover, DR2 Let R,(Xi) be a relation-scheme associated with allows the specification of certain unsafe rcfcrcntial relation r,. The lotal projection of ri on a subset W of X, integrity structures. is denoted x&(ri), and is equal to (I [W] 1f E ri and The rest of the paper is organized as follows. The r[W] is total). relational concepts used in this paper are reviewed in sec- Let Ri(Xi) be a relation-scheme associated with tion 2. In section 3 we discuss briefly the SYRASE. relation ri. A key consrraint over Ri is a statementof the INGRES,and DE32mechanisms for maintaining rcfcrcntial form Ri: K,~Xi, where Ki is a subset of Xi, called key; integrity and null constraints. In section 4 we examine R,: K,-+X, is sarisfied by ri iff for any two tuples of r,, I the data manipulation problems caused by certain and 1’ , [[K,] = 1’ [Ki] implies I = I’ , and there does not referential integrity and null constraint structures, and exist any proper subset of Ki having this property. A develop the safeness conditions required for avoiding relation-scheme can be associatedwith several candidare these problems. The specification of safe referential keys from which one primary-key is chosen. integrity structures in SYBASE, INGRES, and DR2 is Let R,(Xi) and Rj(X/) be two relation-schemes examined in section 5. The paper concludes with a sum- associated with relations ri and rj, respectively. A mary. referential inregriry constrain1 is a statement of the form Ri [Y ] G Rj[Kj], where Y and Kj are compatible subsets 2. Preliminary Definitions of Xi and Xi, respectively, Kj is the primary-key of Ri, We use in this paper some graph-theoretical concepts. and Y is called a foreign-key of Ri; Ri[Y] E Rj[Kj] IS We denote by G = (V, If) a directed graph with set of satisfied by ri and rj iff rt& (r,) E nLKj (rj). vertices V and set of edges II, and by v,-+vj a directed A referential integrity constraint Ri[Y] G Rj[K,] is edge, h, incidenl from vertex v, to vertex v,. A direcrcd associated with an inset-l-rule, a delete -rule and an paOr from (sfarl) vertex Vi0 to (end) vertex v,m is a updale -rule [2]. There is a unique insert-rule, restricted, sequence of alternating vertices and edges, v,~ h,, vi, which asserts that inserting a tuple I into ri can be pcr- .,.hi, Vi, 9 such that h, is incident from vik-, to v,~, formed only if the tuple of rj referenced by f already llk<m. A directed cycle is a directed path whose start exists. The delete and update rules define the effect of vertex is also its end vertex. deleting (resp. updating the primary-key value in) a tuple (’ of rj : a restricted delete (resp. update) rule assertsthat We review briefly below the relational concepts the deletion of (resp. update of the primary-key value in) used in this paper, Details can bc found in any textbook I’ cannot be performed if there exist tuples in ri refercnc- (e.g. [6]) for the basic concepts, and in [2] for rcfcrcntial ing t’; a cascades delete (resp. update) rule asserts that integrity constraints, WC denote by I a tuple and by t[ W ] the deletion of (resp. update of the primary-key value in) the subtuple of f corresponding to the attributes of W. A I’ implies deleting (resp. updating the subtuple f [Y] in) tuple is said to be rota1 if it has only non-null values. the tuples of ri referencing I’ ; and a nullifies delete (resp. A relational schema RS is a pair (R,A), whcrc R is update) rule asserts that the deletion of (resp. update of a set of relation-schemes and A is a set of constraints the primary-key value in) I’ implies setting to null the over R. We consider relational schemas with subtuple I [Y ] in all the tuples t of ri referencing I’ . A = F v I v N, where F, I, and N denote sets of key, Let RS = (R,A) be a relational schema, so that A referential integrity, and null constraints, respectively. A includes referential integrity constraints. The referential relation-scheme is a named set of attributes, Ri(Xi), integrity (directed) graph associated with RS, where Ri is the relation-scheme name and Xi denotes the G, = (V, w, is defined as follows: V = R, and set of attributes. Every attribute is assigneda domain, and If = (RijRj 1 Ri[Y] c Rj[Kj] E I). The set of referential every relation-scheme, Ri(Xi), is assigned a relation integrity constraints of RS is said to be acyclic iff G, does (value), ri. A database slafe associated with (R, A) is not have directed cycles. defined as r = < r , . ..rk >, where r, is equal to a subset of the cross-product of the domains corresponding to attri- A null cons&a& is a restriction on the way nulls butes of Ri(Xi). A databasestate r associatedwith a rela- appear in relations [6]. Let Ri(Xi) be a relation-scheme tional schema RS = (R,A) is said to be con&en1 if it associated with relation ri, A null constraint is a state- satisfies the constraints of A. Two attributes arc said to mcnt of the form Ri: Y ‘$Z, where Y and Z are subsetsof be compatible if they arc associated with the same X,; Ri: Y %Z is satisfied by ri iff for every tuple t of r,, domain, and attribute setsX and Y are said to be cnmpali- I 1Y ] is total only if ( [Z] is total. All relational database ble iff there exists a one-to-one correspondenceof com- management systems support the specification of nulls- patible attributes betweenX and Y.
Recommended publications
  • Referential Integrity in Sqlite
    CS 564: Database Management Systems University of Wisconsin - Madison, Fall 2017 Referential Integrity in SQLite Declaring Referential Integrity (Foreign Key) Constraints Foreign key constraints are used to check referential integrity between tables in a database. Consider, for example, the following two tables: create table Residence ( nameVARCHARPRIMARY KEY, capacityINT ); create table Student ( idINTPRIMARY KEY, firstNameVARCHAR, lastNameVARCHAR, residenceVARCHAR ); We can enforce the constraint that a Student’s residence actually exists by making Student.residence a foreign key that refers to Residence.name. SQLite lets you specify this relationship in several different ways: create table Residence ( nameVARCHARPRIMARY KEY, capacityINT ); create table Student ( idINTPRIMARY KEY, firstNameVARCHAR, lastNameVARCHAR, residenceVARCHAR, FOREIGNKEY(residence) REFERENCES Residence(name) ); or create table Residence ( nameVARCHARPRIMARY KEY, capacityINT ); create table Student ( idINTPRIMARY KEY, firstNameVARCHAR, lastNameVARCHAR, residenceVARCHAR REFERENCES Residence(name) ); or create table Residence ( nameVARCHARPRIMARY KEY, 1 capacityINT ); create table Student ( idINTPRIMARY KEY, firstNameVARCHAR, lastNameVARCHAR, residenceVARCHAR REFERENCES Residence-- Implicitly references the primary key of the Residence table. ); All three forms are valid syntax for specifying the same constraint. Constraint Enforcement There are a number of important things about how referential integrity and foreign keys are handled in SQLite: • The attribute(s) referenced by a foreign key constraint (i.e. Residence.name in the example above) must be declared UNIQUE or as the PRIMARY KEY within their table, but this requirement is checked at run-time, not when constraints are declared. For example, if Residence.name had not been declared as the PRIMARY KEY of its table (or as UNIQUE), the FOREIGN KEY declarations above would still be permitted, but inserting into the Student table would always yield an error.
    [Show full text]
  • Clarion & ANSI SQL Standard Referential Integrity and Referential
    Clarion & ANSI SQL Standard Referential Integrity and Referential Actions November 12, 2018 Whitemarsh Information Systems Corporation 2008 Althea Lane Bowie, Maryland 20716 Tele: 301-249-1142 Email: [email protected] Web: www.wiscorp.com Referential Integrity and Referential Actions Fundamental Definition: Actions resulting from instruction to the database engine created in the dictionary (i.e., schema) associated with “Relationship” specifications. For SQL-engine DBMSs, these relationship-specifications and actions relate to value congruence between the value-set of a primary key’s column(s) and the value-set of a Foreign key’s column(s). When either a Update or Delete action occurs that violates the value congruence, a Referential Action occurs. The actions depend on whether the Referential Action is specified. In ANSI SQL Standards, the four referential integrity actions: No Action, Cascade, or Set Null or Set Default. In Clarion, the five referential integrity actions are: None, Restrict, Cascade, Clear, Cascade Server, ClearServer and Restrict Server. Copyright 2018, Whitemarsh Information Systems Corporation Proprietary Data, All Rights Reserved 2 Referential Integrity and Referential Actions Referential Integrity and Actions Referential Action taken when violation occurs On Update On Delete Referential Action Parent Child Parent Child Function ANSI Clarion Table Table Table Table Parent Table No equivalent None: Instructs the Primary No change Row is Nothing. Primary Key Application Generator not key in the deleted Effect is to Column value can to generate any code to column foreign key make the change. Foreign maintain referential value can value child table Key Column value integrity between any change row an does not change.
    [Show full text]
  • Relational Schema Relational Integrity
    Relational Schema Relational Integrity Unpassionate and purposeless Orlando never combine his incalculability! Infinitival Oswald signalize canonically or proceed trustingly when Piotr is leery. Orbadiah volatilizes her options bulgingly, she outwalks it amorally. Save my choice for tables can have no parent table, only on data are problems with multiple base tables may be a combination with the! Employee to radio mandatory role of Employee. DBMSs to check important data satisfies the semantics. Filing System, the dummy set add all Counties of all Countries. It does not seriously affect both tables related in relation schema designs the integrity constraints are. RFS, this sin that goes do dot use fresh unique ID to identify value object. Manual is separate horn the Product entity. Overlap constraints: Can Joe be an Hourly_Emps as through as a Contract_Emps entity? Web site which select a few attributes. Was this on helpful? It involves the relational tables that data are shown is an entity and implemented via objects are modified depending on file sharing services can! In relational schema may want to track of your session has gained wide range of moral character. There is our chance for duplication of data. An unknown error occurred. DBMSs but were originally slower. The second sentence to keep only two tables separated. Similarly, data manipulation, enabling them to shelter network traffic and unit run in disconnected mode. Eer object over any data item, delete all enrolled tuple. When there was not refundable and each table should not allowed through views reflects pdf solve mcq quiz yourself, relational integrity risk is called dno in.
    [Show full text]
  • CSC 443 – Database Management Systems Data and Its Structure
    CSC 443 – Database Management Systems Lecture 3 –The Relational Data Model Data and Its Structure • Data is actually stored as bits, but it is difficult to work with data at this level. • It is convenient to view data at different levels of abstraction . • Schema : Description of data at some abstraction level. Each level has its own schema. • We will be concerned with three schemas: physical , conceptual , and external . 1 Physical Data Level • Physical schema describes details of how data is stored: tracks, cylinders, indices etc. • Early applications worked at this level – explicitly dealt with details. • Problem: Routines were hard-coded to deal with physical representation. – Changes to data structure difficult to make. – Application code becomes complex since it must deal with details. – Rapid implementation of new features impossible. Conceptual Data Level • Hides details. – In the relational model, the conceptual schema presents data as a set of tables. • DBMS maps from conceptual to physical schema automatically. • Physical schema can be changed without changing application: – DBMS would change mapping from conceptual to physical transparently – This property is referred to as physical data independence 2 Conceptual Data Level (con’t) External Data Level • In the relational model, the external schema also presents data as a set of relations. • An external schema specifies a view of the data in terms of the conceptual level. It is tailored to the needs of a particular category of users. – Portions of stored data should not be seen by some users. • Students should not see their files in full. • Faculty should not see billing data. – Information that can be derived from stored data might be viewed as if it were stored.
    [Show full text]
  • March 2017 Report
    BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 6 Professional Graduate Diploma in IT ADVANCED DATABASE MANAGEMENT SYSTEMS March 2017 Answer any THREE questions out of FIVE. All questions carry equal marks. Time: THREE hours Answer any Section A questions you attempt in Answer Book A Answer any Section B questions you attempt in Answer Book B The marks given in brackets are indicative of the weight given to each part of the question. Calculators are NOT allowed in this examination. Section A Answer Section A questions in Answer Book A A1 Examiner's General Comments This was a fairly popular question, attempted by around half of the candidates, with two-thirds of the attempts achieving pass level marks. Therefore, the performance was generally quite good with a wide range of marks, some candidates producing near correct solutions. The definition of a true distributed database system is that it consists of a collection of geographically remote sites of physical databases, connected together via some kind of communication network, in which a user at any site can access data anywhere in the network exactly as if the data were all stored in one single database at the user’s own site. a) Explain the problems associated with achieving a true distributed database in practice. 12 marks ANSWER POINTER Fragmentation of tables requires maintenance of unique keys across horizontal fragments and consistency of primary keys that are reflected in vertical fragments. Also increased network traffic occurs as many fragments may need to be consulted to perform one query.
    [Show full text]
  • Declarative Constraints
    THREE Declarative Constraints 3.1 PRIMARY KEY 3.1.1 Creating the Constraint 3.1.2 Naming the Constraint 3.1.3 The Primary Key Index 3.1.4 Sequences 3.1.5 Sequences in Code 3.1.6 Concatenated Primary Key 3.1.7 Extra Indexes with Pseudo Keys 3.1.8 Enable, Disable, and Drop 3.1.9 Deferrable Option 3.1.10 NOVALIDATE 3.1.11 Error Handling in PL/SQL 3.2 UNIQUE 3.2.1 Combining NOT NULL, CHECK with UNIQUE Constraints 3.2.2 Students Table Example 3.2.3 Deferrable and NOVALIDATE Options 3.2.4 Error Handling in PL/SQL 3.3 FOREIGN KEY 3.3.1 Four Types of Errors 3.3.2 Delete Cascade 3.3.3 Mandatory Foreign Key Columns 3.3.4 Referencing the Parent Syntax 3.3.5 Referential Integrity across Schemas and Databases 3.3.6 Multiple Parents and DDL Migration 3.3.7 Many-to-Many Relationships 3.3.8 Self-Referential Integrity 3.3.9 PL/SQL Error Handling with Parent/Child Tables 3.3.10 The Deferrable Option 69 70 Chapter 3 • Declarative Constraints 3.4 CHECK 3.4.1 Multicolumn Constraint 3.4.2 Supplementing Unique Constraints 3.4.3 Students Table Example 3.4.4 Lookup Tables versus Check Constraints 3.4.5 Cardinality 3.4.6 Designing for Check Constraints 3.5 NOT NULL CONSTRAINTS 3.6 DEFAULT VALUES 3.7 MODIFYING CONSTRAINTS 3.8 EXCEPTION HANDLING 3.9 DATA LOADS This is the first of several chapters that cover enforcing business rules with con- straints.
    [Show full text]
  • (12) United States Patent (10) Patent No.: US 9,053,153 B2 Schreter (45) Date of Patent: Jun
    US009053153B2 (12) United States Patent (10) Patent No.: US 9,053,153 B2 Schreter (45) Date of Patent: Jun. 9, 2015 (54) INTER-QUERY PARALLELIZATION OF 95. R. 358. RaSudevan al. et.....I707,as: al. CONSTRAINT CHECKING 7,113.953 B2 * 9/2006 Brown et al. ...... 707,615 7,240,054 B2 * 7/2007 Adiba et al. .......................... 1.1 (75) Inventor: Ivan Schreter, Malsch (DE) 8,301,934 B1 * 10/2012 Ramesh et al. ................. T14, 18 8,336,051 B2 * 12/2012 Gokulakannan ... ... 718, 101 (73) Assignee: SAP SE, Walldorf (DE) 8,375,047 B2 * 2/2013 Narayanan et al. ... 707 764 2002/01741.08 A1* 11/2002 Cotner et al. ..................... 707/3 - r 2004/0010502 A1* 1 2004 Bomfim et al. 7O7/1OO (*) Notice: Subject to any disclaimer, the term of this 2005, 0131893 A1* 6/2005 Von Glan .......................... 707/5 patent is extended or adjusted under 35 2006/0212465 A1* 9, 2006 Fish et al. ... 707/101 U.S.C. 154(b) by 12 days. 2007/0239661 A1* 10, 2007 Cattell et al. ...................... 707/2 2009/0037498 A1* 2/2009 Mukherjee et al. ........... 707,205 (21) Appl. No.: 13/525,935 2010/0005077 A1* 1/2010 Krishnamurthy et al. ........ 7O7/4 9 2011/0010330 A1 1/2011 McCline et al. .............. 707,602 1-1. 2012/0254887 A1* 10/2012 Rodriguez ... ... 718, 106 (22) Filed: Jun. 18, 2012 2012fO265728 A1* 10, 2012 Plattner et al. 707/6O7 2012/0278282 A1* 11/2012 Lu et al. ......... TO7/634 (65) Prior Publication Data 2012,0310985 A1* 12/2012 Gale et al.
    [Show full text]
  • Referential Integrity Quality Metrics
    Referential Integrity Quality Metrics Carlos Ordonez Javier Garc´ıa-Garc´ıa University of Houston UNAM Houston, TX 77204, USA Mexico City, CU 04510, Mexico ∗ Abstract Referential integrity is an essential global constraint in a relational database, that maintains it in a complete and consistent state. In this work, we assume the database may violate referential integrity and relations may be denormalized. We propose a set of quality metrics, defined at four granularity levels: database, relation, attribute and value, that measure referential completeness and consistency. Quality metrics are efficiently computed with standard SQL queries, that incorporate two query optimizations: left outer joins on foreign keys and early foreign key grouping. Experiments evaluate our proposed metrics and SQL query optimizations on real and synthetic databases, showing they can help detecting and explaining referential errors. 1 Introduction Referential integrity is a fundamental global constraint in a relational database [8], that basically ensures a foreign key value exists in the referenced relation. Referential integrity issues are found in database integra- tion, data quality assurance, data warehousing and data modeling. Referential integrity is violated or relaxed for practical reasons. Database integration represents a common scenario where similar tables coming from multiple source databases (OLTP systems) have different referential integrity constraints and each DBMS provides distinct mechanisms and rules to enforce referential integrity [20]. Therefore, source databases may violate referential integrity and their integration may uncover additional referential integrity problems. Performance is the second common reason, where referential integrity checking is disabled to allow fast insertions in batch mode. Finally, the logical data model behind a relational database evolves, incorporating new attributes and new relations not defined before, causing old data to violate new referential integrity constraints.
    [Show full text]
  • Referential Integrity Revisited: an Object-Oriented Perspective
    REFERENTIAL INTEGRITY REVISITED~AN OBJECT-ORIENTED PERSPECTIVE* VICTOR M. ~KOWITZ Lawrence Berkeley Laboratory Computer Science Research and Development Department 1 Cyclotron Road, Berkeley, CA 94720 ABSTRACT represented by relation tuples, while object connec- Referential integrity underlies the relational tions are represented by references between tuples. representation of objeceoriented structures. The con- Such references are enforced in relational databases cept of referential integrity in relational databases is by referential integrity constraints [2]. There are two hindered by the confusion surrounding both the con- approaches to the specification of these constraints in cept itself and its implementation by relational data- relational databases. In the Universal Relation (UR) base management systems (RDBMS). Most of this approach [ll], referential integrity constraints are confusion is caused by the diversity of relational implied by associating different relations with com- representations for object-oriented structures. We mon attributes; the referential integrity meaning of examine the relationship between these representa- relations sharing common attributes is defined by a tions and the structure of referential integrity con- set of rules, called UR assumptions. The UR assump- straints, and show that the controversial structures tions make the description of object structures either do not occur or can be avoided in the rela- extremely difficult and not entirely reliable, mainly tional representations of object-oriented structures. becaise they require excessively complex attribute Referential integrity is not supported uniformly name assignments. by RDBMS products. Thus, referential integrity con- A different approach to the specification of straints can be specified in some RDBMSs non- referential integrity constraints is ‘to associate expli- procedurally (declaratively) , while in other RDBMSs citly a foreign-key in one relation with the primary- they must be specified procedurally.
    [Show full text]
  • 4 Schema Definition with SQL / DDL (II)
    4.3 SQL/DDL - Constraints Different kinds of integrity constraints 4 Schema Definition with SQL / DDL (II) Important • on attributes, column constraints “ 0 <= accountValue“, “must not be NULL” 4.3 SQL/DDL – Constraints • cardinalities 4.3.1 Attribute and simple table constraints 4.3.2 Enforcing cardinality constraints and foreign keys • “semantic” constraints ("business rules") 4.3.3 Deferred constraints e.g. "The percentage of movies not older than one year must be 25% or more" 4.3.4 Assertions and triggers " After 100 loans a video tape (not DVD) has to be discarded" 4.3.5 Case study – Column constraint 4.3.6 Metadata management Specify constraint as part of column definition 4.3.7 Modifying and deleting definitions and more… – Table constraint More than one row involved, specify constraint after the column definitions HS / DBS04-06-DDL -2 2 Constraints 4.3.1 Attribute and simple table constraints Constraints may be violated when DB is changed • PRIMARY KEY (update, insert, delete) – Only once per table ð Exception – Not necessary, but omission is bad style ORA-02291: integrity constraint (SYS_C0067174) – May be column constraint (single attribute) or table violated - parent key not found constraint CREATE TABLE Tape( Constraint name (optional) t_id INTEGER PRIMARY KEY, m_id INTEGER NOT NULL, CONSTRAINT <name> <def> format CHAR(5), Advantage: error message shows violated constraint in a aquired DATE ) readable way CREATE TABLE People( ORA-02291: integrity constraint name VARCHAR(20), (FKMovieOnTape.SYS_C0067174) violated - parent birth_date
    [Show full text]
  • CGS 2545: Database Concepts Summer 2007
    CGS 2545: Database Concepts Summer 2007 Chapter 7 – Introduction To SQL Instructor : Mark Llewellyn [email protected] HEC 236, 823-2790 http://www.cs.ucf.edu/courses/cgs2545/sum2007 School of Electrical Engineering and Computer Science University of Central Florida CGS 2545: Database Concepts (Chapter 7) Page 1 Mark Llewellyn Objectives • Definition of terms. • Discuss advantages of standardized SQL. • Define a database using SQL data definition language. • Write single table queries using SQL. • Establish referential integrity using SQL. • Work with Views. CGS 2545: Database Concepts (Chapter 7) Page 2 Mark Llewellyn The Physical Design Stage of SDLC (Figures 2-4, 2-5 revisited) Project Identification Purpose –programming, testing, and Selection training, installation, documenting Project Initiation Deliverable – operational programs, and Planning documentation, training materials, program/data structures Analysis Logical Design PhysicalPhysical Design Database activity – physical database design and ImplementationImplementation database implementation Maintenance CGS 2545: Database Concepts (Chapter 7) Page 3 Mark Llewellyn SQL Overview •SQL ≡ Structured Query Language. • The standard for relational database management systems (RDBMS). • SQL-99 and SQL: 2003 Standards – Purpose: – Specify syntax/semantics for data definition and manipulation. – Define data structures. – Enable portability. – Specify minimal (level 1) and complete (level 2) standards. – Allow for later growth/enhancement to standard. CGS 2545: Database Concepts (Chapter 7) Page 4 Mark Llewellyn Benefits of a Standardized Relational Language • Reduced training costs • Productivity • Application portability • Application longevity • Reduced dependence on a single vendor • Cross-system communication CGS 2545: Database Concepts (Chapter 7) Page 5 Mark Llewellyn The SQL Environment • Catalog – A set of schemas that constitute the description of a database.
    [Show full text]
  • Enforcement of Partial Referential Integrity in a Database System
    International Journal of Computer Science and Mathematical Theory ISSN 2545-5699 Vol. 4 No.2 2018 www.iiardpub.org Enforcement of Partial Referential Integrity in a Database System Jaja, Azunna Ibimina & E. O. Bennett Department of Computer Science Rivers State University, Port Harcourt. Nigeria. [email protected], [email protected] Abstract A lack of Referential Integrity in a database can lead Relational Databases to return incomplete data, usually with no indication of an error thus it results in records been lost in the database because they are not returned in queries or reports but the presence of Referential Integrity checks prevents orphan table that no longer has a relationship with its parent table by deleting the orphan row, updating the cells or preventing the action from be performed. However, Simple Referential Integrity cannot check for multiple referential relationships as such this research aims at developing a module that will enforce Partial Referential Integrity checks for MySQL database. The Structured System Analysis and Design Methodology (SSADM) was used in the design and implemented with Java programming language. Meanwhile the tools used for this research are Stored Procedures which encapsulates sets of operations or queries to execute on the database server which is supported by most Relational database systems. Furthermore, MySQL Workbench which is a Graphical User Interface based tool was used to run the queries. Therefore the module will reject or validate data that passes the partial referential integrity check and a database was used to test the module hence the results show that the execution time of the system without the module is less than the execution time of the system with the module because the module ensures that data queried are valid and also, the integrity of the system that uses the module shows that the data in the system meets all constraints enforced and the work done by the database server is minimized.
    [Show full text]