FIGURE 5.7 THE M:N RELATIONSHIP BETWEEN STUDENT AND CLASS Database name: Ch05 Tinycollege STUDENT ENROLL CLASS PK STU NUM H is written in PK,FK1 OPK,FK2 STU NUM CLASS_CODE is found in PK CLASS CODE STU_LNAME STU_FNAME ENROLL_GRADE CRS_CODE CLASS_SECTION STU_INIT Table name: STUDENT (first four fields) STU NUM STU_LNAME STU FNAME Table name: ENROLL Table name: CLASS (first three fields) STU_INIT CLASS CODE STU_NUM ENROLL_GRADE CLASS CODE CRS CODE CLASS SECTION 321452 Bowser William C 10014 321452 C 10012 ACCT-211 1 324257 Smithson Anne K 10014 324257 B 10013 ACCT-211 2 324258 Brewer Juliette 10018 321452 A 10014 ACCT-211 3 324269 Oblonski Walter H 10018 324257 B 10015 ACCT-212 1 324273 Smith John 10021 321452 C 10016 ACCT-212 2 324274 Katinga 324291 Robertson 324299 Smith Raphael 10021 324257 C 10017 CIS-220 1 Gerald T 10018 CIS-220 2 John B 10019 CIS-220 3, 10020 CIS-420 1 10021 QM-261 1 10022 QM-261 2 10023 QM-362 1 10024 QM-362 2 10025 MATH-243 1 FIGURE 5.7 THE M:N RELATIONSHIP BETWEEN STUDENT AND CLASS Database name: Ch05 Tinycollege STUDENT ENROLL CLASS PK STU NUM H is written in PK,FK1 OPK,FK2 STU NUM CLASS_CODE is found in PK CLASS CODE STU_LNAME STU_FNAME ENROLL_GRADE CRS_CODE CLASS_SECTION STU_INIT Table name: STUDENT (first four fields) STU NUM STU_LNAME STU FNAME Table name: ENROLL Table name: CLASS (first three fields) STU_INIT CLASS CODE STU_NUM ENROLL_GRADE CLASS CODE CRS CODE CLASS SECTION 321452 Bowser William C 10014 321452 C 10012 ACCT-211 1 324257 Smithson Anne K 10014 324257 B 10013 ACCT-211 2 324258 Brewer Juliette 10018 321452 A 10014 ACCT-211 3 324269 Oblonski Walter H 10018 324257 B 10015 ACCT-212 1 324273 Smith John 10021 321452 C 10016 ACCT-212 2 324274 Katinga 324291 Robertson 324299 Smith Raphael 10021 324257 C 10017 CIS-220 1 Gerald T 10018 CIS-220 2 John B 10019 CIS-220 3, 10020 CIS-420 1 10021 QM-261 1 10022 QM-261 2 10023 QM-362 1 10024 QM-362 2 10025 MATH-243 1

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Im having trouble getting this code to run. Please use the diagram and find the numbers by counting the characters in each section. THats how you find the numbers.

 

CREATE TABLE ENROLL (
    CLASS_CODE CHAR(2) NOT NULL,
    STU_NUM CHAR(2) NOT NULL,
    ENROLL_GRADE CHAR(2) NOT NULL,
    FOREIGN KEY (CLASS_CODE) REFERENCES CLASS(CLASS_CODE),
    FOREIGN KEY(STU_NUM) REFERENCES STUDENT(STU_NUM),
    PRIMARY KEY(CLASS_CODE, STU_NUM)
);

 

 

 

 

 

 

**** Implementation of Composite Primary Key

 

 

*** Insert multiple records at once.   

INSERT ALL

INTO customer (first_name, last_name) VALUES ('Kristen', 'Rowley')

INTO customer (first_name, last_name) VALUES ('Jed', 'Tomlinson')

INTO customer (first_name, last_name) VALUES ('Margie', 'Escobar')

INTO customer (first_name, last_name) VALUES ('Harriette', 'Mejia')

INTO customer (first_name, last_name) VALUES ('Francis', 'Little')

SELECT * FROM dual;

FIGURE 5.7 THE M:N RELATIONSHIP BETWEEN STUDENT AND CLASS
Database name: Ch05 Tinycollege
STUDENT
ENROLL
CLASS
PK STU NUM
H
is written in
PK,FK1
OPK,FK2 STU NUM
CLASS_CODE
is found in
PK CLASS CODE
STU_LNAME
STU_FNAME
ENROLL_GRADE
CRS_CODE
CLASS_SECTION
STU_INIT
Table name: STUDENT
(first four fields)
STU NUM STU_LNAME STU FNAME
Table name: ENROLL
Table name: CLASS
(first three fields)
STU_INIT
CLASS CODE STU_NUM ENROLL_GRADE
CLASS CODE CRS CODE CLASS SECTION
321452 Bowser
William
C
10014
321452 C
10012
ACCT-211 1
324257 Smithson
Anne
K
10014
324257 B
10013
ACCT-211 2
324258 Brewer
Juliette
10018
321452 A
10014
ACCT-211 3
324269 Oblonski
Walter
H
10018
324257 B
10015
ACCT-212
1
324273 Smith
John
10021
321452 C
10016
ACCT-212 2
324274 Katinga
324291 Robertson
324299 Smith
Raphael
10021
324257 C
10017
CIS-220
1
Gerald
T
10018
CIS-220
2
John
B
10019
CIS-220 3,
10020
CIS-420
1
10021
QM-261
1
10022
QM-261
2
10023
QM-362 1
10024
QM-362 2
10025
MATH-243 1
Transcribed Image Text:FIGURE 5.7 THE M:N RELATIONSHIP BETWEEN STUDENT AND CLASS Database name: Ch05 Tinycollege STUDENT ENROLL CLASS PK STU NUM H is written in PK,FK1 OPK,FK2 STU NUM CLASS_CODE is found in PK CLASS CODE STU_LNAME STU_FNAME ENROLL_GRADE CRS_CODE CLASS_SECTION STU_INIT Table name: STUDENT (first four fields) STU NUM STU_LNAME STU FNAME Table name: ENROLL Table name: CLASS (first three fields) STU_INIT CLASS CODE STU_NUM ENROLL_GRADE CLASS CODE CRS CODE CLASS SECTION 321452 Bowser William C 10014 321452 C 10012 ACCT-211 1 324257 Smithson Anne K 10014 324257 B 10013 ACCT-211 2 324258 Brewer Juliette 10018 321452 A 10014 ACCT-211 3 324269 Oblonski Walter H 10018 324257 B 10015 ACCT-212 1 324273 Smith John 10021 321452 C 10016 ACCT-212 2 324274 Katinga 324291 Robertson 324299 Smith Raphael 10021 324257 C 10017 CIS-220 1 Gerald T 10018 CIS-220 2 John B 10019 CIS-220 3, 10020 CIS-420 1 10021 QM-261 1 10022 QM-261 2 10023 QM-362 1 10024 QM-362 2 10025 MATH-243 1
FIGURE 5.7 THE M:N RELATIONSHIP BETWEEN STUDENT AND CLASS
Database name: Ch05 Tinycollege
STUDENT
ENROLL
CLASS
PK STU NUM
H
is written in
PK,FK1
OPK,FK2 STU NUM
CLASS_CODE
is found in
PK CLASS CODE
STU_LNAME
STU_FNAME
ENROLL_GRADE
CRS_CODE
CLASS_SECTION
STU_INIT
Table name: STUDENT
(first four fields)
STU NUM STU_LNAME STU FNAME
Table name: ENROLL
Table name: CLASS
(first three fields)
STU_INIT
CLASS CODE STU_NUM ENROLL_GRADE
CLASS CODE CRS CODE CLASS SECTION
321452 Bowser
William
C
10014
321452 C
10012
ACCT-211 1
324257 Smithson
Anne
K
10014
324257 B
10013
ACCT-211 2
324258 Brewer
Juliette
10018
321452 A
10014
ACCT-211 3
324269 Oblonski
Walter
H
10018
324257 B
10015
ACCT-212
1
324273 Smith
John
10021
321452 C
10016
ACCT-212 2
324274 Katinga
324291 Robertson
324299 Smith
Raphael
10021
324257 C
10017
CIS-220
1
Gerald
T
10018
CIS-220
2
John
B
10019
CIS-220 3,
10020
CIS-420
1
10021
QM-261
1
10022
QM-261
2
10023
QM-362 1
10024
QM-362 2
10025
MATH-243 1
Transcribed Image Text:FIGURE 5.7 THE M:N RELATIONSHIP BETWEEN STUDENT AND CLASS Database name: Ch05 Tinycollege STUDENT ENROLL CLASS PK STU NUM H is written in PK,FK1 OPK,FK2 STU NUM CLASS_CODE is found in PK CLASS CODE STU_LNAME STU_FNAME ENROLL_GRADE CRS_CODE CLASS_SECTION STU_INIT Table name: STUDENT (first four fields) STU NUM STU_LNAME STU FNAME Table name: ENROLL Table name: CLASS (first three fields) STU_INIT CLASS CODE STU_NUM ENROLL_GRADE CLASS CODE CRS CODE CLASS SECTION 321452 Bowser William C 10014 321452 C 10012 ACCT-211 1 324257 Smithson Anne K 10014 324257 B 10013 ACCT-211 2 324258 Brewer Juliette 10018 321452 A 10014 ACCT-211 3 324269 Oblonski Walter H 10018 324257 B 10015 ACCT-212 1 324273 Smith John 10021 321452 C 10016 ACCT-212 2 324274 Katinga 324291 Robertson 324299 Smith Raphael 10021 324257 C 10017 CIS-220 1 Gerald T 10018 CIS-220 2 John B 10019 CIS-220 3, 10020 CIS-420 1 10021 QM-261 1 10022 QM-261 2 10023 QM-362 1 10024 QM-362 2 10025 MATH-243 1
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education