Topic: Database Software: SQLite Schema Table:   CREATE TABLE name_basics (nconst VARCHAR(45) NOT NULL, primaryName VARCHAR(45) NULL, birthYear YEAR(4) NULL, deathYear YEAR(4) NULL, age INT NULL, movieNum INT NULL, PRIMARY KEY (nconst));   CREATE TABLE attributes ( attributeID INT NOT NULL, attribute VARCHAR(45) NOT NULL, PRIMARY KEY (attributeID) ); CREATE TABLE attributes_collection ( akasID INT NOT NULL, attributeID INT NOT NULL, PRIMARY KEY (akasID, attributeID), CONSTRAINT attributeID FOREIGN KEY (attributeID) REFERENCES attributes (attributeID) ON DELETE NO ACTION ON UPDATE NO ACTION); CREATE TABLE crew_directors ( crewID INT NOT NULL, nconst VARCHAR(45) NOT NULL, PRIMARY KEY (crewID, nconst), CONSTRAINT crewID FOREIGN KEY (crewID) REFERENCES title_crew (crewID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT nconst FOREIGN KEY (nconst) REFERENCES name_basics (nconst) ON DELETE NO ACTION ON UPDATE NO ACTION); CREATE TABLE crew_writers ( crewID INT NOT NULL, nconst VARCHAR(45) NOT NULL, PRIMARY KEY (crewID, nconst), CONSTRAINT crewID FOREIGN KEY (crewID) REFERENCES title_crew (crewID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT nconst FOREIGN KEY (nconst) REFERENCES name_basics (nconst) ON DELETE NO ACTION ON UPDATE NO ACTION); CREATE TABLE genre ( genreID INT NOT NULL, genre VARCHAR(45) NOT NULL, PRIMARY KEY (genreID)); CREATE TABLE genre_collection ( tconst VARCHAR(45) NOT NULL, genre INT NOT NULL,

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Topic: Database

Software: SQLite

Schema Table:

 

CREATE TABLE name_basics (nconst VARCHAR(45) NOT NULL, primaryName VARCHAR(45) NULL, birthYear YEAR(4) NULL, deathYear YEAR(4) NULL, age INT NULL, movieNum INT NULL, PRIMARY KEY (nconst));

 

CREATE TABLE attributes (
attributeID INT NOT NULL,
attribute VARCHAR(45) NOT NULL,
PRIMARY KEY (attributeID)
);


CREATE TABLE attributes_collection (
akasID INT NOT NULL,
attributeID INT NOT NULL,
PRIMARY KEY (akasID, attributeID),
CONSTRAINT attributeID
FOREIGN KEY (attributeID)
REFERENCES attributes (attributeID)
ON DELETE NO ACTION
ON UPDATE NO ACTION);


CREATE TABLE crew_directors (
crewID INT NOT NULL,
nconst VARCHAR(45) NOT NULL,
PRIMARY KEY (crewID, nconst),
CONSTRAINT crewID
FOREIGN KEY (crewID)
REFERENCES title_crew (crewID)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT nconst
FOREIGN KEY (nconst)
REFERENCES name_basics (nconst)
ON DELETE NO ACTION
ON UPDATE NO ACTION);


CREATE TABLE crew_writers (
crewID INT NOT NULL,
nconst VARCHAR(45) NOT NULL,
PRIMARY KEY (crewID, nconst),
CONSTRAINT crewID
FOREIGN KEY (crewID)
REFERENCES title_crew (crewID)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT nconst
FOREIGN KEY (nconst)
REFERENCES name_basics (nconst)
ON DELETE NO ACTION
ON UPDATE NO ACTION);


CREATE TABLE genre (
genreID INT NOT NULL,
genre VARCHAR(45) NOT NULL,
PRIMARY KEY (genreID));


CREATE TABLE genre_collection (
tconst VARCHAR(45) NOT NULL,
genre INT NOT NULL,
PRIMARY KEY (tconst, genre),
CONSTRAINT genre
FOREIGN KEY (genre)
REFERENCES genre (genreID)
ON DELETE NO ACTION
ON UPDATE NO ACTION);


CREATE TABLE known_collection (
tconst VARCHAR(45) NOT NULL,
nconst VARCHAR(45) NOT NULL,
PRIMARY KEY (tconst, nconst),
CONSTRAINT tconst
FOREIGN KEY (tconst)
REFERENCES title_basics (tconst)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT nconst
FOREIGN KEY (nconst)
REFERENCES name_basics (nconst)
ON DELETE NO ACTION
ON UPDATE NO ACTION);

Prompt: Add triggers to the above schema table that automatically updated when new data in inserted.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
SQL Query
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education