Question

using sqlite3, create a db on movies, directors and publishing companies. they need to be relational....

using sqlite3, create a db on movies, directors and publishing companies. they need to be relational. please add 5 movies.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Answer:
$sqlite3 MovieIndustry.db    //create database
sqlite> ATTACH DATABASE 'MovieIndustry.db' as 'movies';  //attach database statement
create table movie(
   mov_id INT PRIMARY KEY    NOT NULL,
   mov_Name       char(30)    NOT NULL,
   mov_time          INT     NOT NULL,
   mov_language      CHAR(10) NOT NULL,
);
create table director(
   dir_id INT PRIMARY KEY    NOT NULL,
   dir_Name       char(30)    NOT NULL,
   mov_id         INT     NOT NULL,
   constraint fk_movie
    FOREIGN KEY (mov_id)
    REFERENCES movie(mov_id)
);

create table publish_company(

com_id INT PRIMARY KEY NOT NULL,

com_name char(30) NOT NULL,

mov_id INT NOT NULL,

dir_id INT NOT NULL,

constraint fk_movie FOREIGN KEY (mov_id) REFERENCES movie(mov_id),

constraint fk_director FOREIGN KEY (dir_id) REFERENCES director(dir_id)

);

// inserting values into movie table

insert into movie values(901, 'vertigo', 128, 'English');

insert into movie values(902, 'the innocents', 100, 'English');

insert into movie values(903, 'lawrence of arabia', 216, 'English');

insert into movie values(904, 'Amadeus', 183, 'English');

insert into movie values(905, 'Blade Runner', 160, 'English');

// inserting values into director  table

insert into director values(201, 'Alfred', 903);

insert into director values(202, 'Jack', 901);

insert into director values(203, 'David', 902);

insert into director values(204, 'Michael', 905);

insert into director values(205, 'Ridley', 904);

// inserting values into publish_company table

insert into director values(101, 'Warner Bros',902,201 );

insert into director values(102, 'Walt Disney studios',901,203 );

insert into director values(103, 'universal pictures',904,202 );

insert into director values(104, 'lionsgate films',903,204 );

insert into director values(105, 'Paramount pictures',905,205 );

Add a comment
Know the answer?
Add Answer to:
using sqlite3, create a db on movies, directors and publishing companies. they need to be relational....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Mary Pell owns three different companies that create different genres of movies. Each company specializes in...

    Mary Pell owns three different companies that create different genres of movies. Each company specializes in one kind of movie. The table below lists the 3 companies, the cost to make each movie and the selling price per movie. Company Cost per movie Selling Price per movie Marginal Profit per Movie Now- See-Me $150 $250 $100 Illusions $200 $275 $75 Movies-R-Us $75 $100 $25 Mary’s goal is simple…maximize her total profit by determining the number of movies to be made...

  • Integrativelong dashOptimal capital structure   The board of directors of Morales​ Publishing, Inc., has commissioned a capital...

    Integrativelong dashOptimal capital structure   The board of directors of Morales​ Publishing, Inc., has commissioned a capital structure study. The company has total assets of $40,800,000 . It has earnings before interest and taxes of $7,910,000 and is taxed at a rate of 27% . a. Create a spreadsheet showing values of debt and equity as well as the total number of​ shares, assuming a book value of  $25 per share. b. Given the​ before-tax cost of debt at various levels...

  • Movie companies need to predict the gross receipts of individual movies after a movie has debuted....

    Movie companies need to predict the gross receipts of individual movies after a movie has debuted. The accompanying results are the first weekend​ gross, the national​ gross, and the worldwide gross​ (in millions of​ dollars) of six movies. QUESTION: Compute the coefficient of correlation between first weekend gross and national​ gross, first weekend gross and worldwide​ gross, and national gross and worldwide gross. Find the coefficient of correlation between first weekend gross and national gross. ​(Round to three decimal places...

  • Movie companies need to predict the gross receipts of individual movies after a movie has debuted....

    Movie companies need to predict the gross receipts of individual movies after a movie has debuted. The accompanying results are the first weekend​ gross, the national​ gross, and the worldwide gross​ (in millions of​ dollars) of six movies. Complete parts​ (a) through​ (d) below.. a. Compute the covariance between first weekend gross and national​ gross, first weekend gross and worldwide​ gross, and national gross and worldwide gross. QUESTION 1: Find the covariance between first weekend gross and national gross. nothing...

  • This assignment allows students to demonstrate their skills in the area of designing relational databases to...

    This assignment allows students to demonstrate their skills in the area of designing relational databases to satisfy specific business rules and requirements. The deliverables for this assignment include an Entity Relationship Diagram and detailed documentation describing the database design and structure. In this assignment you will be provided with a description of an application (below) to create an entityrelationship diagram (ERD) and design accompanying table layout using sound relational modeling concepts and practices. The relationships between the entities and the...

  • SQL CHECK CONSTRAINT AND TEST CASE... SQL Query Here are the tables: CREATE TABLE Movies(     movieID...

    SQL CHECK CONSTRAINT AND TEST CASE... SQL Query Here are the tables: CREATE TABLE Movies(     movieID INT,     name VARCHAR(30) NOT NULL,     year INT,     rating CHAR(1),     length INT,     totalEarned NUMERIC(7,2),     PRIMARY KEY(movieID),     UNIQUE(name, year) ); CREATE TABLE Showings(     theaterID INT,     showingDate DATE,     startTime TIME,     movieID INT,     priceCode CHAR(1),     PRIMARY KEY(theaterID, showingDate, startTime),     FOREIGN KEY(theaterID) REFERENCES Theaters,     FOREIGN KEY(movieID) REFERENCES Movies ); CREATE TABLE Tickets(     theaterID INT,     seatNum INT,     showingDate DATE,     startTime TIME,     customerID INT,     ticketPrice NUMERIC(4,2),     PRIMARY KEY(theaterID, seatNum, showingDate, startTime)...

  • Using the STUDENT table structure shown in Table P6.4, do the following: a. Write the relational...

    Using the STUDENT table structure shown in Table P6.4, do the following: a. Write the relational schema and draw its dependency diagram. Identify all dependencies, including all transitive dependencies. b. Write the relational schema and draw the dependency diagram to meet the 3NF requirements to the greatest practical extent possible. If you believe that practical considerations dictate using a 2NF structure, explain why your decision to retain 2NF is appropriate. If necessary, add or modify attributes to create appropriate determinants...

  • 5. Explain, using relevant case law, the legal scope and purpose, of Directors Duties under the...

    5. Explain, using relevant case law, the legal scope and purpose, of Directors Duties under the Companies Act 2006.

  • Create an RDM that has entities, Customers, Products, Orders, Payments, and OrderDetails using MS ACCESS. For...

    Create an RDM that has entities, Customers, Products, Orders, Payments, and OrderDetails using MS ACCESS. For each entity use the appropriate attributes and explain the relationship being used. (Add as much attributes that reflect on the real world) RDM = relational database model

  • Companies create business records of many types and store the electronic files using an electroni...

    Companies create business records of many types and store the electronic files using an electronic records management (ERM) system. Explain why an ERM is a senior management issue and not simply an IT issue? Describe each of the four V’s of data analytics: variety, volume, velocity, and veracity. Identify the primary functions of a database and a data warehouse. Explain why enterprises need both of these data management technologies.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT