Question

Given the following relation schemas, instances, primary and foreign key constraints, list all constraint violations. R(A,D)...

Given the following relation schemas, instances, primary and foreign key constraints, list all constraint violations.

R(A,D)
S(A,B,C)
S.A is a foreign key to R.A.
C and D have string domains.  A and B have integer domains.
R(A,D)
A D
1 aa
2 null
null 4
5 b3c
X 4
S(A,B,C)
A B C
1 aa X
4 4 null
3 null Y
null 3 Z
1 2 Z

Homework Answers

Answer #1

1)

PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely identifies each row in a table

NOT NULL - Ensures that a column cannot have a NULL value

Above table violates Primary key constraint where A is the primary key of R. And R.A has a null value which violates the primary key constrain. Also, it violates NOT NULL Constraint.

2. Domain Constraint

Table S, R violates domain constraint. In the description, it is given that C and D have string domains, A and B have integer domains. But in R.A we have X which is not an integer, R.D has integers which is not a string, S.B has "aa" which is not an integer.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Suppose we have the following relation R with composite primary key {A,B} together with the set...
Suppose we have the following relation R with composite primary key {A,B} together with the set FD of functional dependencies: R(A,B,C,D,E,F,G). FD = { C -> G, E -> B, A -> D, AB -> C, AB -> D, AB -> E. AB -> F, AB -> G } Draw the initial dependency diagram using the above information. The relation from part a) is in first normal form. Using the techniques described in the lecture, convert it to 2NF by...
1.Consider the following (normalized) relational model (primary keys are underlined, foreign keys are in italics). EMPLOYEE(SSN,...
1.Consider the following (normalized) relational model (primary keys are underlined, foreign keys are in italics). EMPLOYEE(SSN, ENAME, EADDRESS, SEX, DATE_OF_BIRTH, SUPERVISOR, DNR) S U P E R V I S O R : foreign key refers to SSN in EMPLOYEE, NULL value allowed D N R : foreign key refers to DNR in DEPARTMENT, NULL value not allowed DEPARTMENT(DNR, DNAME, DLOCATION, MGNR) MGNR: foreign key refers to SSN in EMPLOYEE, NULL value not allowed PROJECT(PNR, PNAME, PDURATION, DNR) DNR: foreign...
1. In SQL. Given the following relational database schema . The primary key is underlined. All...
1. In SQL. Given the following relational database schema . The primary key is underlined. All attributes are of type string if not indicated otherwise.  branch(branch_name,branch_city,assets: integer)  customer(customer_i,customer_name,customer_street,customer_city)  account(account_number,branch_name,balance)  depositor(customer_id,account_number) a. Find the names of customers that have accounts in every branch in Miami. b. Find the names of customers who do not have an account. (assume the bank keeps the customer information even if the account is closed.)
1. Which of the following is NOT a type of data anomaly? a. Insertion b. Transformation...
1. Which of the following is NOT a type of data anomaly? a. Insertion b. Transformation c. Deletion d. Modification 2. Functional dependency has the following characteristics EXCEPT a. Attribute Y is functionally dependent upon attribute X, if the value of X uniquely determines the value of Y b. It's a constraint between two tables c. It's a constraint between two attributes (columns) d. Represented as Determinant(s) -> Dependent(s) 3. The definition of a partial dependency is a.One or more...
Matching a Schema b DBMS c ODBC d Table e Field f Primary key g Foreign...
Matching a Schema b DBMS c ODBC d Table e Field f Primary key g Foreign key h Normalization i Data warehouse j Data mining 1. Brings together disparate company data sources 2. Also known as a data attribute 3. Standard protocol for data exchange 4. Holds records 5. Looks for trends or patterns 6. Uniquely identifies a record 7. Used to make effective and efficient tables 8. Ties data entity relationships together 9. Allows for data access and manipulation...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x < 6} would be {1,2,3,4,5}.) (a) {a | a ∈Z,a2 ≤ 1}. (b) {b2 | b ∈Z,−2 ≤ b ≤ 2} (c) {c | c2 −4c−5 = 0}. (d) {d | d ∈R,d2 < 0}. 2. Let S be the set {1,2,{1,3},{2}}. Answer true or false: (a) 1 ∈ S. (b) {2}⊆ S. (c) 3 ∈ S. (d) {1,3}∈ S. (e) {1,2}∈ S (f)...
Given that A to Z are mapped to integers 0-25 as follows. A:0, B:1, C:2, D:3,...
Given that A to Z are mapped to integers 0-25 as follows. A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I: 8, J: 9, K:10, L:11, M:12, N:13, O:14, P:15, Q:16, R:17, S:18, T:19, U:20, V:21, W:22, X:23, Y:24, Z:25. Encrypt the following message using Vigenere Cipher with key: CIPHER THISQUIZISEASY What is the ciphertext? Show your work. PLEASE HELP
/* myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following...
/* myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following tables: VENDOR, PRODUCT, CUSTOMER, INVOICE, LINE EMPLOYEE and loads the default data rows */ set echo on; set serveroutput on; select systimestamp from dual; show user; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY'; DROP TABLE LINE CASCADE CONSTRAINTS; DROP TABLE INVOICE CASCADE CONSTRAINTS; DROP TABLE CUSTOMER CASCADE CONSTRAINTS; DROP TABLE PRODUCT CASCADE CONSTRAINTS; DROP TABLE VENDOR CASCADE CONSTRAINTS; DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE...
/* myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following...
/* myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following tables: VENDOR, PRODUCT, CUSTOMER, INVOICE, LINE EMPLOYEE and loads the default data rows */ set echo on; set serveroutput on; select systimestamp from dual; show user; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY'; DROP TABLE LINE CASCADE CONSTRAINTS; DROP TABLE INVOICE CASCADE CONSTRAINTS; DROP TABLE CUSTOMER CASCADE CONSTRAINTS; DROP TABLE PRODUCT CASCADE CONSTRAINTS; DROP TABLE VENDOR CASCADE CONSTRAINTS; DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE...
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as...
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as an input. The first task is to compute the frequency of each character appearing in the string. In the output, the characters have to be arranged in the same order as they appear in the input string. Then characters have to be rearranged, such that all the characters having a specific frequency, say xx, come together. Let the frequency of a character, lying in...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT