Create a table to record a passengers information, Database Management System

Assignment Help:

Given the following relations
TRAIN (NAME, START, DEST)
TICKET (PNRNO., START, DEST, FARE)
PASSENGER (NAME, ADDRESS, PNRNO.)
Write SQL expressions for the following queries:
Note: Assume NAME of Train is a column of Ticket.
(i) List the names of passengers who are travelling from the begin to the destination station of the train.
(ii) List the names of passengers who have a return journey ticket.
(iii) Insert a new Shatabti train from Delhi to Bangalore.
(iv) Cancel the ticket of Tintin.

(i) SELECT P.NAME FROM TRAIN T, TICKET I, PASSENGER P
WHERE P.PNRNO = I.PNRNO AND T.NAME = I.NAME
AND T.START = I.START AND T.DEST = I.DEST
(ii) SELECT NAME FROM PASSENGER
WHERE PNRNO IN (SELECT DISTINCT A.PNRNO
FROM TICKET A, TICKET B WHERE A.PNRNO = B.PNRNO
AND A.START = B.DEST AND A.DEST = B.START)
(iii) INSERT INTO TRAIN
VALUES(‘Shatabdi', ‘Delhi', ‘Banglore'
(iv) DELETE FROM TICKET
WHERE PNRNO = (SELECT PNRNO FROM PASSENGER
WHERE NAME = ‘Tintin')


Related Discussions:- Create a table to record a passengers information

What is candidate key, What is Candidate Key Super Key or Candidate Ke...

What is Candidate Key Super Key or Candidate Key: It is such an attribute of a table that can uniquely recognize a row in a table. Generally they have unique values and can n

aggregate functions-data manipulation language, Aggregate functions ...

Aggregate functions Some of these functions are min, count, max, and avg. These functions help in getting consolidated information from a set of tuples. Example:

Fds in relationships and teaches relationship, FDs in Relationships:  E...

FDs in Relationships:  Enrols Relationship: None as it is many to many Teaches Relationship : Course code → Instructor Instructor → Course code The next question is:

What is conceptual schema, What is Conceptual Schema? Conceptual Schema...

What is Conceptual Schema? Conceptual Schema - Conceptual schema elaborates the structure of the overall database for a community of users. It hides the details of physical sto

State the terms designing the database and normalization, State the terms D...

State the terms Designing the database and Normalization Designing the database: Out of the ERD we have formed, it is very easy to verify the tables, the attributes which the

Define partial, Partial Key : It is a group of attributes that can uniquel...

Partial Key : It is a group of attributes that can uniquely identify small entities and that are related to same base entity. It is sometime named as Discriminator.  Altern

Can a stored procedure call itself, Can a stored procedure call itself or r...

Can a stored procedure call itself or recursive stored procedure? How much level SP nesting is possible? Yes. Because Transact-SQL supports recursion, you can write kept proced

Determine the subsystem design issue, Determine the Other System Design Iss...

Determine the Other System Design Issue How to realise subsystems; through hardware or software? How is object model mapped on chosen hardware software? Mapping

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd