Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write SQL statements to create the corresponding relations and capture as many o

ID: 670042 • Letter: W

Question

Write SQL statements to create the corresponding relations and capture as many of the constraints as possible for the following E-R diagram. If cannot capture some constraints, explain why. Make sure that the data type and size for each attribute are appropriate. For example, a numerical data type is better choice than a string data type for the attribute salary.   In addition, you have to write SQL statements to load data into each relation. You are required to come up with at least 3 records for each table

address Citv ength subject subject náme state aTime comment tvpe náme Zip Dealerships Appointments Feedback Loans WorksAt Requests Writes Applies ame assword bDate assword ende1 Name ddress phone email aCustomers email Employees services address ssn mpg type year odel sells Purchase comm maker pDate price windPrice TradeIn NewCars UsedCars condition mileage

Explanation / Answer

SQL Queries:

Table: Employees
       CREATE TABLE Employees(id INT PRIMARY KEY,ssn INT,fName VARCHAR2(30),mInital VARCHAR2(10),lName VARCHAR2(10),salary INT,email VARCHAR2(30),password VARCHAR2(20),bDate VARCHAR2(10),gender VARCHAR2(8),phone INT);

Table: Cars
       CREATE TABLE Cars(vin INT ,type VARCHAR2(10),mpg VARCHAR2(10),year INT,model VARCHAR2(10),maker VARCHAR2(10),windPrice DOUBLE,unitCost DOUBLE);

Table: UsedCars
       create table UsedCars(vin int primary key,mileage double,condition varchar2(10));

Table: Customers
       CREATE TABLE Customers(ssn int primary key,fName varchar2(10),mInital varchar2(10),lName varchar2(10),email varchar2(20),address varchar2(50),password varchar2(20));

Table: Appointments
       create table Appointments(id int primary key,subject varchar2(20),aDate date,aTime timestamp);

Table : Feedback
       create table Feedback(id int primary key,subject varchar2(20),comment varchar2(50));

Table: Loans
       create table Loans(id int primary key,name varchar2(20),length int ,type varchar2(10));

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote