Question

The Wombat Film Company has cinemas in Wagga, Orange, Mildura, Bathurst, Albury and Temora. It requires a database to record its screenings and revenue.For each cinema we need to store the owner name...

The Wombat Film Company has cinemas in Wagga, Orange, Mildura, Bathurst, Albury and Temora. It requires a database to record its screenings and revenue.For each cinema we need to store the owner name and phone.Each cinema consists on several theatres, ranging from 6 in Bathurst and Orange, to 2 in Temora. We need to store seating capacity for each theatre. Each theatre has several screenings per day, where we record the theatre number, preview code and name (always one preview shown before the main film), the preview rating (G, PG, MA or R) and distributors name and phone, the film code and name, its rating, distributor’s name and phone, film length, number of adult and concession tickets purchased and the start time and end time of the screening.

For all screenings with a start time before 6pm (Mon to Fri excluding public holidays) the cost is adult $6 and concession $4 (equal price code B). At other times the cost is adult $10 and concession $6 (equals price code A). However, on some special occasions, such as movie releases, all tickets are $12 (equals price code C.)Some of the recorded attributes include town, theatre-no, film-name, preview-name and screening-no.  

The design of your database should be able to handle queries which could work out (not that you are required to do so):the total revenue for each film in each town;the number of screenings of each film for each town;the total number of adult and concession tickets sold each day for each town.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here you need to create 4 below table with is in relationship with each other using primary key and foreign key. You can directly create these table using given code of sql file.

Cinema Table:

f Name Type Collation Attributes Null Default Comments Extra Action □ Cinema-id i) Change Drop ▼ More 1 int(11) No None □ No

Theatres Table

f Name Type Collation Attributes Null Default Comments Extra Action [] 1 Theatres-id> int(11) Change Drop More No None [] 2 C

Screening Table

# Name Type Collation Attributes Null Default Comments Extra Action 1 Screening_id Change Drop More int (11) No None 2 Theatr

Revenue Table

Type Collation Attributes Null Default Comments Extra Action Change f Name Drop ▼ More No None int(11) 1 Revenue- ro op ▼More

SQL file for phpmyadmin:

Copy below text and save as film_company.sql and import it in phpmyadmin of xamp

-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 21, 2019 at 12:49 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.7

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `film_company`
--

-- --------------------------------------------------------

--
-- Table structure for table `cinema`
--

CREATE TABLE `cinema` (
`Cinema_id` int(11) NOT NULL,
`Cinema_name` varchar(255) NOT NULL,
`Town` varchar(255) NOT NULL,
`Owner_name` varchar(255) NOT NULL,
`Owner_Phone` varchar(20) NOT NULL,
`No_of_theatres` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `revenue`
--

CREATE TABLE `revenue` (
`Revenue_id` int(11) NOT NULL,
`Screening_Id` int(11) NOT NULL,
`Theatres_Id` int(11) NOT NULL,
`date` date NOT NULL,
`time` time NOT NULL,
`Adult_ticket_price` int(11) NOT NULL,
`Concession_ticket_price` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `screening`
--

CREATE TABLE `screening` (
`Screening_id` int(11) NOT NULL,
`Theatres_id` int(11) NOT NULL,
`Screening_date` date NOT NULL,
`preview_code` varchar(255) NOT NULL,
`preview_name` varchar(255) NOT NULL,
`preview_rating` varchar(255) NOT NULL,
`distributors_name` varchar(255) NOT NULL,
`distributors_phone` varchar(20) NOT NULL,
`film_code` varchar(255) NOT NULL,
`film_name` varchar(255) NOT NULL,
`film_rating` varchar(10) NOT NULL,
`film_length` varchar(255) NOT NULL,
`number_of_adult` text NOT NULL,
`number_of_concession` text NOT NULL,
`start_time` time NOT NULL,
`end_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `theatres`
--

CREATE TABLE `theatres` (
`Theatres_id` int(11) NOT NULL,
`Cinema_id` int(11) NOT NULL,
`Theatre_name` varchar(255) NOT NULL,
`capacity` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cinema`
--
ALTER TABLE `cinema`
ADD PRIMARY KEY (`Cinema_id`);

--
-- Indexes for table `revenue`
--
ALTER TABLE `revenue`
ADD PRIMARY KEY (`Revenue_id`),
ADD UNIQUE KEY `Screening_Id` (`Screening_Id`),
ADD KEY `Theatres_id` (`Theatres_Id`);

--
-- Indexes for table `screening`
--
ALTER TABLE `screening`
ADD PRIMARY KEY (`Screening_id`),
ADD UNIQUE KEY `Thetres_id` (`Theatres_id`);

--
-- Indexes for table `theatres`
--
ALTER TABLE `theatres`
ADD PRIMARY KEY (`Theatres_id`),
ADD KEY `Cinema_id` (`Cinema_id`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Add a comment
Know the answer?
Add Answer to:
The Wombat Film Company has cinemas in Wagga, Orange, Mildura, Bathurst, Albury and Temora. It requires a database to record its screenings and revenue.For each cinema we need to store the owner name...
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
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
ADVERTISEMENT