0% found this document useful (0 votes)
107 views2 pages

SQL TEST1 Spring 2020.: Produce The Given Result Using SQL Syntax

The document provides instructions for a SQL test assignment that is due by 8 PM on September 11, 2020. Students are asked to submit screenshot answers to SQL code questions in a Word document. The document provides 3 sample questions to answer using SQL syntax like SELECT statements and joins.

Uploaded by

Tyra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views2 pages

SQL TEST1 Spring 2020.: Produce The Given Result Using SQL Syntax

The document provides instructions for a SQL test assignment that is due by 8 PM on September 11, 2020. Students are asked to submit screenshot answers to SQL code questions in a Word document. The document provides 3 sample questions to answer using SQL syntax like SELECT statements and joins.

Uploaded by

Tyra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Student number: 13846593

Student name: Olivia Martin


Subject number : (32606/31061).

SQL TEST1 Spring 2020.


Submit via UTS online or Canvas. Take a screenshot of your answers and SQL code and paste it in a
word document and upload it like an assignment upload. All questions carry equal marks.

Submit by 8 PM 11 Sep 2020.

Produce the given result using SQL syntax.

postgres=# Select astroNo, astroName, birth, death, country, gender from Nasa2_Astronaut where
astrono = 103 or astrono = 360 or astrono = 395;

astrono | astroname | birth | death | country | gender

---------+--------------------+-------+-------+-----------+--------

103 | Chawla, Kalpana | 1961 | 2003 | India |F

360 | Scully-Power, Paul | 1944 | | Australia | M

395 | Thomas, Andrew | 1951 | | Australia | M

(3 rows)

Produce the below result using a natural join.


Hint : missionno is not an integer data type.
Student number: 13846593
Student name: Olivia Martin
Subject number : (32606/31061).
postgres=# Select distinct astrono, astroname, birth, death, country, gender, projectname,
missionno, role from nasa2_astronaut natural join nasa2_Assigned where missionno = '1' and role =
'Commander';

Produce the below result using cross product.

postgres=# select astroname, birth from nasa2_astronaut, nasa2_assigned where


nasa2_astronaut.astrono = nasa2_assigned.astrono and missionno

= '1' and role = 'Commander';

You might also like