Question
CREATE TABLE DOG_OWNER (OWNER_ID INTEGER, OWNER_FIRST_NAME VARCHAR2(30) NOT NULL, OWNER_LAST_NAME VARCHAR2(30) NOT NULL, OWNER_PHONE VARCHAR2(15) NOT NULL, EMP_ID INTEGER NOT NULL, PRIMARY KEY (OWNER_ID), FOREIGN
CREATE TABLE DOG_OWNER (OWNER_ID INTEGER, OWNER_FIRST_NAME VARCHAR2(30) NOT NULL, OWNER_LAST_NAME VARCHAR2(30) NOT NULL, OWNER_PHONE VARCHAR2(15) NOT NULL, EMP_ID INTEGER NOT NULL, PRIMARY KEY (OWNER_ID), FOREIGN KEY (EMP_ID) REFERENCES DOG_OWNER (OWNER_ID)); CREATE TABLE DOG (DOG_NAME VARCHAR2(30) NOT NULL, DOG_BREED_ID INTEGER NOT NULL, DOG_DOB DATE NOT NULL, DOG_SEX VARCHAR2(6), OWNER_ID INTEGER, PRIMARY KEY (DOG_NAME, DOG_DOB), FOREIGN KEY (DOG_BREED_ID) REFERENCES DOG_BREED (DOG_BREED_ID), FOREIGN KEY (OWNER_ID) REFERENCES DOG_OWNER (OWNER_ID)); CREATE TABLE EMPLOYEE (EMP_ID INTEGER NOT NULL, EMP_FIRST_NAME VARCHAR2(30), EMP_LAST_NAME VARCHAR2(30), EMP_DOB DATE, EMP_STREET_NUM INTEGER, EMP_STREET_NAME VARCHAR2(30), EMP_CITY VARCHAR2(30), EMP_STATE VARCHAR2(30), EMP_ZIP VARCHAR2(30), PRIMARY KEY (EMP_ID)); CREATE TABLE DEPENDENT (DEPENDENT_FIRST_NAME VARCHAR2(30) NOT NULL, DEPENDENT_MIDDLE_NAME VARCHAR2(30) NOT NULL, DEPENDENT_LAST_NAME VARCHAR2(30) NOT NULL, DEPENDENT_DOB DATE, DEPENDENT_SEX VARCHAR2(1), EMP_ID INTEGER, PRIMARY KEY (DEPENDENT_DOB, EMP_ID), FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE (EMP_ID)); CREATE TABLE WALKS (EMP_ID INTEGER NOT NULL, DOG_NAME VARCHAR2(30), DOG_DOB DATE, START_DATE_TIME DATE, END_DATE_TIME DATE, PARK_NAME VARCHAR2(50), PRIMARY KEY (EMP_ID, DOG_NAME, DOG_DOB, START_DATE_TIME), FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE (EMP_ID), FOREIGN KEY (DOG_NAME, DOG_DOB) REFERENCES DOG (DOG_NAME, DOG_DOB)); 1,Using your own words and NOT SQL syntax, what does line 45 ensure will happen?
2, A correlated sub-query executes once for each row of the outer query; how can you tell its correlated? 3,Write a SQL query with proper syntax to retrieve the phone number of the dog owner named Paul Beckman. 4,Without using ANY SQL or database terms, what is line 16 supposed to do? Will it work? Why or why not?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started