Introduction
The Movie-Ticket-Booking initiative is a basic project utilizing JSP/Servlet, Java, and PostgreSQL.
It features two login pages: one for administrators and one for users. Administrators can manage
movies
and schedules, while users can select movies, book seats, and purchase tickets (silver, gold,
platinum).
Four database tables have been created: Admin, User, Movie, and Show.
Tables
Here are the SQL queries to create the tables for this project:
Admin
CREATE TABLE admin (
id BIGINT NOT NULL,
name VARCHAR(20),
email VARCHAR(50),
password VARCHAR(20),
PRIMARY KEY (id)
);
User
CREATE TABLE users (
id SERIAL NOT NULL,
name VARCHAR(20) NOT NULL,
email VARCHAR(50) NOT NULL,
country VARCHAR(50) DEFAULT 'USA',
password VARCHAR(20) NOT NULL,
PRIMARY KEY (id)
);
Movie
CREATE TABLE movie (
id SERIAL NOT NULL,
title CHAR(80) DEFAULT NULL,
genre CHAR(20) DEFAULT NULL,
duration INT DEFAULT NULL,
director CHAR(50) DEFAULT NULL,
PRIMARY KEY (id)
);
Show
CREATE TABLE shows (
id SERIAL NOT NULL,
MId INT DEFAULT NULL,
screen INT DEFAULT NULL,
slot INT DEFAULT NULL,
booked INT DEFAULT NULL,
PRIMARY KEY (id),
CONSTRAINT shows_ibfk_1 FOREIGN KEY (MId) REFERENCES movie (id) ON DELETE CASCADE
);