The question is incomplete! Complete question along with answer and step by step explanation is provided below.
Please find the attached question.
Answer:
a) SQL Query:
SELECT population
FROM bsg_planets
WHERE name='Caprica';
b) SQL Query:
SELECT fname, lname, age
FROM bsg_people
WHERE lname!='Adama';
c) SQL Query:
SELECT name, population
FROM bsg_planets
WHERE population > 2600000000
d) SQL Query:
SELECT fname, lname, age
FROM bsg_people
WHERE age IS NULL;
Step-by-step explanation:
a) Write a SQL query to find the population of the planet named 'Caprica'
Syntax:
SELECT Column
FROM TableName
WHERE Condition;
For the given case,
Column = population
TableName = bsg_planets
Condition = name='Caprica'
SQL Query:
SELECT population
FROM bsg_planets
WHERE name='Caprica';
Therefore, the above SQL query finds the population of the planet named 'Caprica' from the table bsg_planets.
b) Find the first name, last name, and age of people from bsg_people whose last name is not 'Adama'
Syntax:
SELECT Column1, Column2, Column3
FROM TableName
WHERE Condition;
For the given case,
Column1 = fname
Column2 = lname
Column3 = age
TableName = bsg_people
Condition = lname!='Adama'
SQL Query:
SELECT fname, lname, age
FROM bsg_people
WHERE lname!='Adama';
Therefore, the above SQL query finds the first name, last name and age of people whose last name is not 'Adama' from the table bsg_people.
c) Find the name and population of the planets with a population larger than 2,600,000,000
Syntax:
SELECT Column1, Column2
FROM TableName
WHERE Condition;
For the given case,
Column1 = name
Column2 = population
TableName = bsg_planets
Condition = population > 2600000000
SQL Query:
SELECT name, population
FROM bsg_planets
WHERE population > 2600000000
Therefore, the above SQL query finds the name and population of the planets with a population larger than 2,600,000,000 from the table bsg_planets.
d) Find the first name, last name, and age of people from bsg_people whose age is NULL
Syntax:
SELECT Column1, Column2, Column3
FROM TableName
WHERE Condition;
For the given case,
Column1 = fname
Column2 = lname
Column3 = age
TableName = bsg_people
Condition = age IS NULL
SQL Query:
SELECT fname, lname, age
FROM bsg_people
WHERE age IS NULL;
Therefore, the above SQL query finds the first name, last name and age of people whose age is NULL from the table bsg_people.