Referential Integrity Constraints

Total Page:16

File Type:pdf, Size:1020Kb

Referential Integrity Constraints Referential Integrity Constraints Referential Integrity constraints in DBMS are based on the concept of Foreign Keys. A foreign key is an important attribute of a relation which should be referred to in other relationships. Referential integrity constraint state happens where relation refers to a key attribute of a different or same relation. However, that key element must exist in the table. Example: In the above example, we have 2 relations, Customer and Billing. Tuple for CustomerID =1 is referenced twice in the relation Billing. So we know CustomerName=Google has billing amount $300 Operations in Relational Model Four basic update operations performed on relational database model are Insert, update, delete and select. • Insert is used to insert data into the relation • Delete is used to delete tuples from the table. • Modify allows you to change the values of some attributes in existing tuples. • Select allows you to choose a specific range of data. Whenever one of these operations are applied, integrity constraints specified on the relational database schema must never be violated. Insert Operation The insert operation gives values of the attribute for a new tuple which should be inserted into a relation. Update Operation You can see that in the below-given relation table CustomerName= 'Apple' is updated from Inactive to Active. Delete Operation To specify deletion, a condition on the attributes of the relation selects the tuple to be deleted. In the above-given example, CustomerName= "Apple" is deleted from the table. The Delete operation could violate referential integrity if the tuple which is deleted is referenced by foreign keys from other tuples in the same database. Select Operation In the above-given example, CustomerName="Amazon" is selected Best Practices for creating a Relational Model • Data need to be represented as a collection of relations • Each relation should be depicted clearly in the table • Rows should contain data about instances of an entity • Columns must contain data about attributes of the entity • Cells of the table should hold a single value • Each column should be given a unique name • No two rows can be identical • The values of an attribute should be from the same domain Advantages of using Relational Model • Simplicity: A Relational data model in DBMS is simpler than the hierarchical and network model. • Structural Independence: The relational database is only concerned with data and not with a structure. This can improve the performance of the model. • Easy to use: The Relational model in DBMS is easy as tables consisting of rows and columns are quite natural and simple to understand • Query capability: It makes possible for a high-level query language like SQL to avoid complex database navigation. • Data independence: The Structure of Relational database can be changed without having to change any application. • Scalable: Regarding a number of records, or rows, and the number of fields, a database should be enlarged to enhance its usability. Disadvantages of using Relational Model • Few relational databases have limits on field lengths which can't be exceeded. • Relational databases can sometimes become complex as the amount of data grows, and the relations between pieces of data become more complicated. • Complex relational database systems may lead to isolated databases where the information cannot be shared from one system to another. Integrity Constraints/ Constraint on Relational Data Model: o Integrity constraints are a set of rules. It is used to maintain the quality of information. o Integrity constraints ensure that the data insertion, updating, and other processes have to be performed in such a way that data integrity is not affected. o Thus, integrity constraint is used to guard against accidental damage to the database. Types of Integrity Constraint 1. Domain constraints o Domain constraints can be defined as the definition of a valid set of values for an attribute. o The data type of domain includes string, character, integer, time, date, currency, etc. The value of the attribute must be available in the corresponding domain. Example: Age ={25 ,26,27,28,29,30} 2. Entity integrity constraints o The entity integrity constraint states that primary key value can't be null. o This is because the primary key value is used to identify individual rows in relation and if the primary key has a null value, then we can't identify those rows. o A table can contain a null value other than the primary key field. Example: 1. Referential Integrity Constraints o A referential integrity constraint is specified between two tables. o In the Referential integrity constraints, if a foreign key in Table 1 refers to the Primary Key of Table 2, then every value of the Foreign Key in Table 1 must be null or be available in Table 2. Example: 4. Key constraints o Keys are the entity set that is used to identify an entity within its entity set uniquely. o An entity set can have multiple keys, but out of which one key will be the primary key. A primary key can contain a unique and null value in the relational table. Example: Key : Primary, Candidate, super, unique, composite etc. INTRODUCTION TO SQL SQL, which is an abbreviation for Structured Query Language, is a language to request data from a database, to add, update, or remove data within a database, or to manipulate the metadata of the database. SQL is a declarative language in which the expected result or operation is given without the specific details about how to accomplish the task. The steps required to execute SQL statements are handled transparently by the SQL database. Sometimes SQL is characterized as non-procedural because procedural languages generally require the details of the operations to be specified, such as opening and closing tables, loading and searching indexes, or flushing buffers and writing data to filesystems. Therefore, SQL is considered to be designed at a higher conceptual level of operation than procedural languages because the lower level logical and physical operations aren't specified and are determined by the SQL engine or server process that executes it. Instructions are given in the form of statements, consisting of a specific SQL statement and additional parameters and operands that apply to that statement. SQL statements and their modifiers are based upon official SQL standards and certain extensions to that each database provider implements. Commonly used statements are grouped into the following categories: What Can SQL do? • SQL can execute queries against a database • SQL can retrieve data from a database • SQL can insert records in a database • SQL can update records in a database • SQL can delete records from a database • SQL can create new databases • SQL can create new tables in a database • SQL can create stored procedures in a database • SQL can create views in a database • SQL can set permissions on tables, procedures, and views RDBMS:- RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. The data in RDBMS is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows. Some of The Most Important SQL Commands • SELECT - extracts data from a database • UPDATE - updates data in a database • DELETE - deletes data from a database • INSERT INTO - inserts new data into a database • CREATE DATABASE - creates a new database • ALTER DATABASE - modifies a database • CREATE TABLE - creates a new table • ALTER TABLE - modifies a table • DROP TABLE - deletes a table • CREATE INDEX - creates an index (search key) • DROP INDEX - deletes an index. CREATE TABLE IN SQL:- The CREATE TABLE statement is used to create a table in a database.Tables are organized into rows and columns; and each table must have a name. SQL CREATE TABLE Syntax CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), column_name3 data_type(size), .... ); The column_name parameters specify the names of the columns of the table.The data_type parameter specifies what type of data the column can hold (e.g. varchar, integer, decimal, date, etc.).The size parameter specifies the maximum length of the column of the table. SQL PRIMARY KEY Constraint The PRIMARY KEY constraint uniquely identifies each record in a database table.Primary keys must contain UNIQUE values.A primary key column cannot contain NULL values.Most tables should have a primary key, and each table can have only ONE primary key. FOREIGN KEY:- FOREIGN KEY in one table points to a PRIMARY KEY in another table. DDL : Data Definition Language:- All DDL commands are auto-committed. That means it saves all the changes permanently in the database. Command Description create to create new table or database Alter for alteration truncate delete data from table drop to drop a table rename to rename a table DML : Data Manipulation Language:- DML commands are not auto-committed. It means changes are not permanent to database, they can be rolled back. Command Description insert to insert a new row update to update existing row delete to delete a row merging two rows or two merge tables TCL : Transaction Control Language:- These commands are to keep a check on other commands and their affect on the database. These commands can annul changes made by other commands by rolling back to original state. It can also make changes permanent. Command Description to permanently commit save rollback to undo change savepoint to save temporarily DCL : Data Control Language:-Data control language provides command to grant and take back authority. Command Description grant permission of grant right revoke take back permission. DQL : Data Query Language:- Command Description retrieve records from one or more select table .
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]