Question
Asked Nov 21, 2019
45 views

What is the SQL query commands to create the COURSE table (attached) with appropriate attributes and data types together with primary keys, foreign keys, relationships and constraints.

Each table must contain a minimum of 3 records.

(0,N)
(1,1)
SCHOOL
DEPARTMENT
H has «
SCHOOL CODE
DEPARTMENT ID
PK
к
DEPARTMENT ID
DEPARTMENT NAME
(1,1)
employs
(1,N)
PROFESSOR
PK
PROF NUM
DEPARTMENT ID
PROF LASTNAME
PROF FIRSTNAME
(1,1)
teaches
(1,2)
COURSE
Pк
COURSE TYPE
FK
DEPARTMENT ID
COURSE TITLE
COURSE DESCRIPTION
FK
COURSE TYPE CODE
help_outline

Image Transcriptionclose

(0,N) (1,1) SCHOOL DEPARTMENT H has « SCHOOL CODE DEPARTMENT ID PK к DEPARTMENT ID DEPARTMENT NAME (1,1) employs (1,N) PROFESSOR PK PROF NUM DEPARTMENT ID PROF LASTNAME PROF FIRSTNAME (1,1) teaches (1,2) COURSE Pк COURSE TYPE FK DEPARTMENT ID COURSE TITLE COURSE DESCRIPTION FK COURSE TYPE CODE

fullscreen
check_circle

Expert Answer

Step 1

Course table:

COURSE(COURSE_TYPE, DEPARTMENT_ID, COURSE_TITLE, COURSE_DESCRIPTION, COURSE_TYPE_CODE );

 

COURSE TABLE with defined primary and foreign keys:

Create table COURSE( COURSE_TYPE VARCHAR(20) NOT NULL, DEPARTMENT_ID INT, COURSE_TITLE VARCHAR(10),  COURSE_DESCRIPTION VARCHAR(10), COURSE_TYPE_CODE VARCHAR(6), PRIMARY KEY(COURSE_TYPE),  FOREIGN KEY (DEPARTMENT_ID) REFERENCES DEPARTMENT(DEPARTMENT_ID), FOREIGN KEY (COURSE_TYPE_CODE) REFERENCES COURSE(COURSE_TYPE));      

Step 2

Inserting records in the course table:

INSERT INTO COURSE VALUES("fashion", 1, "FASHION DESIGNING", "detailed fashion designing","F" );

INSERT INTO COURSE VALUES("web", 1,...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Databases

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Given the follwing business rules, create an Crows Foot ERD.  The ERD must include all primary keys,...

A: The crow’s foot diagram shows the entities as the boxes and relationship as the lines between the en...

question_answer

Q: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's repre...

A: A c++ program to find the binary equivalent of a number.Ask the user to enter an integer number. if ...

question_answer

Q: I have tried this  a few times and cannot figure it out. This is for python.

A: The sub lists can be printed by printing each row; hence the answer would be:for i in range(len(tabl...

question_answer

Q: Write a program that simulates flipping a coin to make decisions. The input is how many decisions ar...

A: Program algorithm- STARTStep 1: Import the essential headers.Step 2: Define the main function.Step 3...

question_answer

Q: write a c++ program from the attachments below

A: Answer:Program:#include <iostream>#include <cstdlib>#include <iomanip>using namesp...

question_answer

Q: consider the udp header 12 03 00 0f 00 1e a3 10. what is the total length of the udp?

A: The User Datagram Protocol (UDP) is a transport layer communication protocol in the TCP/IP model.The...

question_answer

Q: Given the Boolean function F = xy + x’y’ + y’z 1. Implement it with AND, OR, and inverter 2. Impleme...

A: a) Implementing the given Boolean function by using AND, OR and NOT gate:F = xy + x'y' + y'z Logic c...

question_answer

Q: 2. (5.12 in 8e) answer each of the followig question. a) what does it mean to choose numbers "at ran...

A:  a) Choosing numbers at random means that any number can be selected and every number has an equal c...

question_answer

Q: Language - Java   Create a utility class called DuplicateCounter. Create an instance method called c...

A: Program InstructionsDeclare a map of Strings and create two methods count() and write() in Duplicate...