Could I get some help writing this ER diagram into an SQLlite database. Gross MI
ID: 3702343 • Letter: C
Question
Could I get some help writing this ER diagram into an SQLlite database.
Gross MID DateReleased Title Movie MID MID Username AID Stars Reviews Review FirstName Actor LastName User Joined AID Username CreditedAs Additional information is given below for each attribute. You should assume attributes are required unless stated otherwise: » Movie MID: An auto-generated ID value. Title: A title that is no longer than 127 characters - Gross: A currency value. Should be capable of holding two decimal places. - DateReleased: A month/day/year value.Explanation / Answer
Solution:
Note: The table creation SQL queries are given below.
Query:
CREATE DATABASE MovieReview;
USE MovieReview;
/*Table: Movies*/
CREATE TABLE Movies(
MID integer primary key autoincrement,
Title char(128),
Gross real not null,
DateReleased date
);
/*Table: Actor*/
CREATE TABLE Actor(
AID integer primary key autoincrement,
FirstName char(50) not null,
LastName char(50) not null,
CreditedAs char(50) null
);
/*Table: User*/
CREATE TABLE User
(
Username char(20) not null unique,
Joined datetime not null
);
/*Table: Reviews*/
CREATE TABLE Reviews(
MID integer not null ,
Username char(20) not null ,
Review text not null
);
/*Table: Star*/
CREATE TABLE Star(
AID integer not null,
MID inetger not null
);
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)