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

I wannt to trannslate the E-R design into SQL. I wannt to write tables. Write an

ID: 3711468 • Letter: I

Question

I wannt to trannslate the E-R design into SQL. I wannt to write tables.

Write an SQL script with the commands to create the tables of your database.

The CREATE TABLE statements must specify:

o Appropriate types for the attributes;

o The primary key;

o Constraints such as NOT NULL and UNIQUE whenever appropriate;

o Default values where appropriate; o FOREIGN KEY constraints, together with the policy for reacting to changes (remember that the default is ON DELETE NO ACTION)

Write comments into the script that explain the rationale behind the definition of your constraints.

if there is any errore in the ER, please fix it.

The Victim can be shot by many criminal,

And criminal can shoot many victims.

The Jail can be taken many criminals,

And criminal can send them to many jails.  

The police can catch many criminals,

And criminals can be caught by many police.

The court can hand in the criminal by many police,

And many police can be handed in many criminals to the court.

The punishment is handed out by many courts,

And court can hand out one punishment.

please help me, I have spent many hours to do it, but I have faced many errors.

Address SSN Age SSN Name Address Name Victim Criminal N Send Catch Jail Address Number Address ld Court N hands in Police Address ID Hand Out Punishment Punishment Number Type Year

Explanation / Answer

create table victim /* creating victim table  */
  (
  ssn number(3) primary key, /*  ssn is unique key for victim table */
  address varchar2(30),
  name varchar2(15),
  age number(2)
  );
create table criminal
  (
  ssn number(4) primary key,
  name varchar2(20),
  addess varchar2(35)
  );
create table jail
  (
  id number(5) primary key,
  address varchar2(35) default 'Dehli' /* default address  */
  );
create table police
  (
  id number(2) primary key,
  name varchar2(20),
  address varchar2(30)
  );

create table court
  (
  casenumber number(3) primary key,
  judge varchar2(20) default 'Mr.Pandey',
  address varchar2(30) default 'New Dehli',
  lawyer varchar2(20),
  law varchar2(10)
  );

create table punishment
  (
  punishmentnumber number(4) primary key,
  type varchar2(20),
  year number(4)
  );

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