











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Transaction processing and the ACID criteria. Relational Model. The Table, Kinds of Relationship, Nomalisation, MySQL, Java Data Base Connector
Typology: Study notes
1 / 19
This page cannot be seen from the preview
Don't miss anything!












© University of Sussex 2009
At its simplest, a transaction can be defined as a “unit of work” in a database Design of a transaction processing system affected by:
Four criteria to ensure safe data sharing:
Each row represents an n-tuple of R The ordering of rows in immaterial All rows are distinct The ordering of the columns is significant - it corresponds to the ordering S1, S2,…,S n of the domains on which R is defined The significance of each column is partially conveyed by labelling it with the name of the corresponding domain “The term relation is used here in its accepted mathematical sense. Given sets S1, S2,…,Sn, R is a relation on these n sets if it is a set of n-tuples each of which has Its first element from S1, its second element from S2 and so on. We shall refer to Sj as the jth domain of R. As defined above, R is said to have degree n.” E. F. Codd 1970 S1 … Sn
Represents an attribute of the entity type Has a domain that specifies the data type of the value Should be a single value Is uniquely named
Represents a single entity or instance of the entity type Ordering of the rows is undefined Uniquely identified by its primary key
Cardinality (or degree) - the number of instances involved in a relationship
The primary key of one table is also the foreign key referencing another table Could conflate to one table?? 1235 Database systems 1234 SQL 1233 Java bk_isbn PK bk_title 1235 3. 1234 19. 1233 14. pr_isbn PK pr_price books price 1: books book^ prices
The foreign key of the books child table is the primary key of the publishers parent table Database systems SQL Java bk_title 1235 p 1234 p 1233 p bk_isbn PK bk_pub_id p003 Wiley p002 O’Reilly p001 Peachpit pub_id PK oub_name books publishers publisher book 1:M
Junction table : Has a composite primary key, made up of foreign keys a002 Beloff a002 Davies a001 Fehily au_id PK au_name book author M:M 1235 a 1234 a 1234 a ab_isbn CK ab_auid CK 1235 Database systems 1234 SQL 1234 JDO bk_isbn PK bk_title books books_authors authors
A relation is in its first normal form if and only if every non-key attribute is functionally dependent on the primary key Put it another way … A table is in its first normal form if it has columns that contains only atomic values and it has no repeating groups (I.e. the primary key values are unique)
A relation is in second normal form if and only if it is in 1NF and every non-key attribute is fully functionally dependent on the primary key Put it another way … “Can I determine a non-key column value if I know only part of the (composite) primary key value?”
No repeating
Free version of the popular Structured Query Language (SQL) database product Has several parts:
Key MySQL commands
SELECT EmpFN, EmpLN FROM Employees; +----------+----------+ | EmpFN | EmpLN | +----------+----------+ | John | Smith | | Robert | Schroader| | Mary | Michaels | | John | Laguci | | Rita | Carter | | George | Brooks | +----------+----------+ 6 rows in set (0.00 secs)
+----------+----------+----------+----------+ | EmpID | EmpFN | EmpMN | EmpLN | +----------+----------+----------+----------+ | 4 | John | NULL | Laguci | | 5 | Rita | C. | Carter | | 6 | George | NULL | Brooks | +----------+----------+----------+----------+ 3 rows in set (0.02 secs)
Java Data Base Connector (JDBC) is a call-level Application Programming Interface that allows Java to communicate with SQL databases You also need the Connector/J driver JDBC allows Java to execute commands and queries directly Java code example included in the course notes Lab sheet 2 (week 3) deals with MySQL and JDBC
Follow a simple set of steps:
Overview of web technologies (such as PHP, JSP, J2EE) …