Create a database with three tables, Each table should be connected via a foreign key, programming homework help

User Generated

subbq

Programming

Description

Create a database with three tables. Each table should be connected via a foreign key. Each table should have a minimum of six fields (to include text and numerical - integer/decimal). You will then produce a report displaying records that satisfy two separate criteria and you will also create two calculated fields (could be the average of the values or an increase in a value, say 12%). You need to use headings other than the field names for the report. All relevant fields should be on the report.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hi! Here is your SQL Code.Have a nice day.

BEGIN TRANSACTION;
/* Create a table called NAMES */
CREATE TABLE TEACHERS(Id integer PRIMARY KEY, Name text, Age integer, Address
text, Salary money, Phone text);
CREATE TABLE STUDENTS(Id integer PRIMARY KEY, Name text, Age integer, Address
text, Phone text, EmergencyPhone text);
CREATE TABLE ACTIVITIES(Id integer PRIMARY KEY, Teacher_Id integer, Student_Id
integer, Activity1 text, Cost1 money,
Activity2 text, Cost2 money, FOREIGN KEY (Teacher_id) REFERENCES
TEACHERS(Id),FOREIGN KEY (Student_Id) RE...


Anonymous
I use Studypool every time I need help studying, and it never disappoints.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags