Question
Asked Nov 22, 2019
4 views

What are the SQL query commands (does not need to be on a platform, just need to verify the query commands) to create  tables

COURSE, FASHION, & TECHNOLOGY 

(full ERD attached) with appropriate attributes and data types together with primary keys, foreign keys, relationships and constraints.

Populate tables with data using SQL queries.  Each table must contain a minimum of 3 records.

PROFESSOR
PROF NUM
PK
DEPARTMENT ID
PROF LASTNAME
PROF FIRSTNAME
(1,1)
teaches
(1,2)
COURSE
COURSE TYPE
FK
DEPARTMENT ID
COURSE TITLE
COURSE_DESCRIPTION
FK
COURSE TYPE CODE
COURSE_TYPE_CODE
T
'F'
FASHION
TECHNOLOGY
COURSE TYPE
PK
COURSE TYPE
PK
FR
LAPTOP NUMBER
RUNWAY DATE
OH
help_outline

Image Transcriptionclose

PROFESSOR PROF NUM PK DEPARTMENT ID PROF LASTNAME PROF FIRSTNAME (1,1) teaches (1,2) COURSE COURSE TYPE FK DEPARTMENT ID COURSE TITLE COURSE_DESCRIPTION FK COURSE TYPE CODE COURSE_TYPE_CODE T 'F' FASHION TECHNOLOGY COURSE TYPE PK COURSE TYPE PK FR LAPTOP NUMBER RUNWAY DATE OH

fullscreen
check_circle

Expert Answer

Step 1

SQL query commands to create tables:

  • To create table “COURSE” with “COURSE_TYPE” as primary key,

CREATE TABLE COURSE (COURSE_TYPE INTEGER PRIMARY KEY, DEPARTMENT_ID INTEGER, COURSE_TITLE TEXT, COURSE_DESCRIPTION TEXT, COURSE_TYPE_CODE INTEGER);

  • To create table “FASHION” with “COURSE_TYPE” as foreign key,

CREATE TABLE FASHION (RUNWAY_DATE DATE, COURSE_TYPE INTEGER, FOREIGN KEY(COURSE_TYPE) REFERENCES COURSE(COURSE_TYPE));

  • To create table “TECHNOLOGY” with “COURSE_TYPE” as foreign key,

CREATE TABLE TECHNOLOGY (LAPTOP_NUMBER INTEGER, COURSE_TYPE INTEGER, FOREIGN KEY(COURSE_TYPE) REFERENCES COURSE(COURSE_TYPE));

Step 2

To insert three records into the table:

  • To insert three records into the table “COURSE”,

INSERT INTO COURSE VALUES (100, 1, "AAA", "AAA DESCRIPTION", 101);

INSERT INTO COURSE VALUES (101, 2, "BBB", "BBB DESCRIPTION", 102);

INSERT INTO COURSE VALUES (102, 1, "CCC", "CCC DESCRIPTION", 103);

  • To insert three records into the table “FASHION”,

INSERT INTO FASHION VALUES ("1982-10-30",...

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

Related Computer Science Q&A

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

Q: Think of one of your Math homework. How can you use program to reveal the answer? Write a calculatio...

A: A program is to be created that uses at least 10 variables to calculate a problem. Let us consider a...

question_answer

Q: How does Amazon Web Services support Netfilx as an information system?

A: The way that AWS support Netflix:Neflix is the leading internet Television (TV) network in the world...

question_answer

Q: 1. Why do we need data structures? Provide an example of each.2. Discuss a mathematical model and im...

A:  Data structure:Data structure is defined as a collection of data values, operations that are perfor...

question_answer

Q: Write a program in Python that converts an improper fraction to a mixed number. The program should p...

A: Program:#Display the messageprint("Calculate Mixed Number")print("======================")print()#Pr...

question_answer

Q: Python 3.7.4: The file Pioneers.txt contains some computer pioneers and their accomplishments.  The ...

A: Program:arr = []try:       with open('Pioneers.txt','r') as p:               for line in p:         ...

question_answer

Q: In Python Use the Design Recipe to write a function bools_2_str, which consumes a list of booleans a...

A: Create a Boolean list with true and false value such as:boolList = [True, True, False, True, False, ...

question_answer

Q: Hi, I am programming for java and I need step by step detailed explanations of how to code assignmen...

A: The given java program will obey the following rubrics:Importing essential header files.Displaying m...

question_answer

Q: How to write a java program will read in the strings from the text file, keep count of the number of...

A: Program Instructions:Open a file named “grades.txt” to get the strings of grades.Use scanner class o...

question_answer

Q: Preffered language is java. Will be compiled with intellij Problem 1 consists of multiple parts. You...

A: Since there are multiple questions and you have not specified which part needs to be answered, we ha...